about summary refs log tree commit diff
path: root/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff
blob: d61019207436756e3485c7faa19f8844643da784 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff -ur a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
--- a/Source/kwsys/ProcessUNIX.c	2024-04-11 07:12:19.000000000 -0700
+++ b/Source/kwsys/ProcessUNIX.c	2024-05-15 10:41:00.286160616 -0700
@@ -2501,20 +2501,20 @@
    have two integers to store: the pid and then the ppid.  */
 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) ||       \
   defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__)
-#  define KWSYSPE_PS_COMMAND "ps axo pid,ppid"
+#  define KWSYSPE_PS_COMMAND "@ps@ axo pid,ppid"
 #  define KWSYSPE_PS_FORMAT "%d %d\n"
 #elif defined(__sun) && (defined(__SVR4) || defined(__svr4__)) /* Solaris */
-#  define KWSYSPE_PS_COMMAND "ps -e -o pid,ppid"
+#  define KWSYSPE_PS_COMMAND "@ps@ -e -o pid,ppid"
 #  define KWSYSPE_PS_FORMAT "%d %d\n"
 #elif defined(__hpux) || defined(__sun__) || defined(__sgi) ||                \
   defined(_AIX) || defined(__sparc)
-#  define KWSYSPE_PS_COMMAND "ps -ef"
+#  define KWSYSPE_PS_COMMAND "@ps@ -ef"
 #  define KWSYSPE_PS_FORMAT "%*s %d %d %*[^\n]\n"
 #elif defined(__QNX__)
-#  define KWSYSPE_PS_COMMAND "ps -Af"
+#  define KWSYSPE_PS_COMMAND "@ps@ -Af"
 #  define KWSYSPE_PS_FORMAT "%*d %d %d %*[^\n]\n"
 #elif defined(__CYGWIN__)
-#  define KWSYSPE_PS_COMMAND "ps aux"
+#  define KWSYSPE_PS_COMMAND "@ps@ aux"
 #  define KWSYSPE_PS_FORMAT "%d %d %*[^\n]\n"
 #endif
 
diff -ur a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
--- a/Source/kwsys/SystemInformation.cxx	2024-04-11 07:12:19.000000000 -0700
+++ b/Source/kwsys/SystemInformation.cxx	2024-05-15 10:40:00.901059278 -0700
@@ -3884,7 +3884,7 @@
   long long memUsed = 0;
   pid_t pid = getpid();
   std::ostringstream oss;
-  oss << "ps -o rss= -p " << pid;
+  oss << "@ps@ -o rss= -p " << pid;
   FILE* file = popen(oss.str().c_str(), "r");
   if (file == nullptr) {
     return -1;