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..cbf0bc5c4393fb9d3e0100e21ec3514ac504657b 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,12 @@ ProcessId GetParentProcessId(ProcessHandle process) { |
return info.kp_eproc.e_ppid; |
} |
+FilePath GetProcessExecutablePath(ProcessHandle process) { |
+ char pathbuf[PROC_PIDPATHINFO_MAXSIZE]; |
+ if (!proc_pidpath(process, pathbuf, sizeof(pathbuf))) |
+ return FilePath(); |
+ |
+ return FilePath(pathbuf); |
+} |
+ |
} // namespace base |