aboutsummaryrefslogtreecommitdiff
path: root/compat/getprogname.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/getprogname.c')
-rw-r--r--compat/getprogname.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/compat/getprogname.c b/compat/getprogname.c
index ea7c2a3..7386263 100644
--- a/compat/getprogname.c
+++ b/compat/getprogname.c
@@ -16,7 +16,19 @@
#include "../config.h"
-#if HAVE_PROGRAM_INVOCATION_SHORT_NAME
+#if HAVE___PROGNAME
+
+#include <stddef.h>
+
+extern char *__progname;
+
+const char *
+getprogname(void)
+{
+ return __progname;
+}
+
+#elif HAVE_PROGRAM_INVOCATION_SHORT_NAME
#include <errno.h>
@@ -29,7 +41,7 @@ getprogname(void)
}
#else
-
+# warning Found no way to get the program name, will use "gmid" for all utilities.
const char *
getprogname(void)
{