Files
ports/graphics/mesa-dri/files/patch-src_util_u__process.c
T
Emmanuel Vadot 57ce68a0c0 graphics/mesa*: Update to 20.2
Update to 20.2
Move graphics/libxatracker to graphics/mesa-gallium-xa
Remove VAAPI and VDPAU options in mesa-libs in favor of
two new ports : mesa-gallium-va and mesa-gallium-vdpau
Bump needed llvm to llvm10
Change a lot of meson option from false to disabled as it's
deprecated.
Remove the drm and surfaceless platform from mesa* as it's always
enabled now.
Add zstd option, used for shader cache.

Reviewed by:	x11 (zeising@)
Differential Revision:	https://reviews.freebsd.org/D26682
2020-10-12 08:30:54 +00:00

30 lines
781 B
C

--- src/util/u_process.c.orig 2020-10-05 09:53:46 UTC
+++ src/util/u_process.c
@@ -44,6 +44,11 @@
#include <mach-o/dyld.h>
#endif
+#if DETECT_OS_FREEBSD
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
#if defined(__linux__) && defined(HAVE_PROGRAM_INVOCATION_NAME)
static char *path = NULL;
@@ -175,6 +180,14 @@ util_get_process_exec_path(char* process_path, size_t
int result = _NSGetExecutablePath(process_path, &bufSize);
return (result == 0) ? strlen(process_path) : 0;
+#elif DETECT_OS_FREEBSD
+ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
+ size_t read_len = len;
+
+ (void) sysctl(mib, 4, process_path, &read_len, NULL, 0);
+ process_path[len - 1] = '\0';
+
+ return read_len;
#elif DETECT_OS_UNIX
ssize_t r;