diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-09-22 01:35:23 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-09-22 01:35:23 +0000 |
commit | 27e7bb02bd0f89f96d9e3b402b46c2c97ee4defe (patch) | |
tree | 274247cd9317896d1f4f7b12d469b85dbbae9205 /lib/mesa/src/util/u_process.c | |
parent | 294c26e88dc461cbb485be73fd6624ec386b4f0b (diff) |
Import Mesa 20.0.8
Diffstat (limited to 'lib/mesa/src/util/u_process.c')
-rw-r--r-- | lib/mesa/src/util/u_process.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/mesa/src/util/u_process.c b/lib/mesa/src/util/u_process.c index 68fda93a5..b9328d58d 100644 --- a/lib/mesa/src/util/u_process.c +++ b/lib/mesa/src/util/u_process.c @@ -26,24 +26,12 @@ */ #include "u_process.h" -#include "detect_os.h" -#include "macros.h" #include <string.h> #include <errno.h> #include <stdlib.h> #undef GET_PROGRAM_NAME -#if DETECT_OS_WINDOWS -#include <windows.h> -#else -#include <unistd.h> -#endif - -#if DETECT_OS_APPLE -#include <mach-o/dyld.h> -#endif - #if defined(__linux__) && defined(HAVE_PROGRAM_INVOCATION_NAME) static char *path = NULL; @@ -164,35 +152,3 @@ util_get_process_name(void) { return GET_PROGRAM_NAME(); } - -size_t -util_get_process_exec_path(char* process_path, size_t len) -{ -#if DETECT_OS_WINDOWS - return GetModuleFileNameA(NULL, process_path, len); -#elif DETECT_OS_APPLE - uint32_t bufSize = len; - int result = _NSGetExecutablePath(process_path, &bufSize); - - return (result == 0) ? strlen(process_path) : 0; -#elif DETECT_OS_UNIX - ssize_t r; - - if ((r = readlink("/proc/self/exe", process_path, len)) > 0) - goto success; - if ((r = readlink("/proc/curproc/exe", process_path, len)) > 0) - goto success; - if ((r = readlink("/proc/curproc/file", process_path, len)) > 0) - goto success; - - return 0; -success: - if (r == len) - return 0; - - process_path[r] = '\0'; - return r; - -#endif - return 0; -} |