blob: 10cf983a039a8ad4f02dee0983e067747ab5b255 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/proc is gone on DragonFly and OpenBSD but deprecated on FreeBSD and NetBSD
--- IGC/common/SysUtils.cpp.orig 2019-11-27 01:05:20 UTC
+++ IGC/common/SysUtils.cpp
@@ -82,6 +82,11 @@ namespace IGC
if (!in.good())
assert(0 && "Error reading from cmdline pseudo file");
+#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
+ defined(__OpenBSD__) || defined(__sun)
+ // KERN_PROC_ARGS returns similar value to /proc/<pid>/cmdline but as
+ // neither invocation path nor arguments are used just ask libc
+ ret = getprogname();
#elif defined(_WIN64) || defined(_WIN32)
ret.resize(MAX_PATH);
DWORD size = ::GetModuleFileNameA(NULL, &ret[0], ret.size());
|