mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Process name retrieval on apple.
This commit is contained in:
parent
8f75839d66
commit
9c966b6224
@ -27,6 +27,11 @@
|
|||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <libproc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -219,6 +224,10 @@ static const char* GetProcessName()
|
|||||||
# endif
|
# endif
|
||||||
#elif defined _GNU_SOURCE || defined __CYGWIN__
|
#elif defined _GNU_SOURCE || defined __CYGWIN__
|
||||||
processName = program_invocation_short_name;
|
processName = program_invocation_short_name;
|
||||||
|
#elif defined __APPLE__
|
||||||
|
static char buf[1024];
|
||||||
|
proc_name( getpid(), buf, 1024 );
|
||||||
|
processName = buf;
|
||||||
#endif
|
#endif
|
||||||
return processName;
|
return processName;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user