depot/third_party/nixpkgs/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff

41 lines
1.8 KiB
Diff

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;