Index: base/process/process_handle_mac.cc |
diff --git a/base/process/process_handle_mac.cc b/base/process/process_handle_mac.cc |
index 6cb8d686e4d77c1a605e6d18b5f0613fb398da90..89d54e663e3fc8aac422d463d224b5f6084a0776 100644 |
--- a/base/process/process_handle_mac.cc |
+++ b/base/process/process_handle_mac.cc |
@@ -4,6 +4,7 @@ |
#include "base/process/process_handle.h" |
+#include <libproc.h> |
#include <sys/sysctl.h> |
#include <sys/types.h> |
@@ -24,4 +25,13 @@ ProcessId GetParentProcessId(ProcessHandle process) { |
return info.kp_eproc.e_ppid; |
Scott Hess - ex-Googler
2014/04/14 19:21:33
Weird, I wonder why this isn't just getppid()? Th
jackhou1
2014/04/17 07:55:54
Yeah, I'm not sure. I'll rope one of the authors o
mattm
2014/04/17 21:44:54
Heh, I had to stare at it a while too. It's becaus
|
} |
+ |
Scott Hess - ex-Googler
2014/04/14 19:21:33
excess newline.
jackhou1
2014/04/17 07:55:54
Done.
|
+FilePath GetProcessExecutablePath(ProcessHandle process) { |
+ char pathbuf[PROC_PIDPATHINFO_MAXSIZE]; |
Scott Hess - ex-Googler
2014/04/14 19:21:33
This seems weird - this constant is defined as 4*M
jackhou1
2014/04/17 07:55:54
Yeah I think 4* MAXPATHLEN just happens to be the
|
+ if (!proc_pidpath(process, pathbuf, sizeof(pathbuf))) |
+ return FilePath(); |
+ |
+ return FilePath(pathbuf); |
+} |
+ |
} // namespace base |