procinfo: fix buck build on OSX

Summary:
As part of getting buck build to work on OSX, we need procinfo to
include it's OSX specific library.

Reviewed By: sfilipco

Differential Revision: D24513234

fbshipit-source-id: 69d8dd546e28b4403718351ff7984ee6b2ed3d1d
This commit is contained in:
Durham Goode 2020-11-03 17:38:33 -08:00 committed by Facebook GitHub Bot
parent 014db196ff
commit d2e3736f67

View File

@ -7,10 +7,15 @@
// See:
// https://github.com/osquery/osquery/blob/4.0.0/osquery/tables/system/darwin/processes.cpp
// The build system is disappointing and can't exclude this target from Linux
// builds. So let's ifdef out the entire file.
#ifdef __APPLE__
#include <assert.h>
#include <libproc.h>
#include <mach-o/dyld_images.h>
#include <mach/mach.h>
#include <libproc.h> // @manual
#include <mach-o/dyld_images.h> // @manual
#include <mach/mach.h> // @manual
/// Return pid's parent process id.
/// Return 0 on error or if pid does not have a parent.
@ -37,3 +42,5 @@ const char* darwin_exepath(pid_t pid) {
}
return path;
}
#endif