From f9e640f1c0dc5d4fbffde207f2a4b0350d1a0019 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 11 Oct 2015 21:12:54 +0000 Subject: Finally use __progname, err(3) and warn(3). That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, let's provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. The compat module has an UCB Copyright (c) 1993... --- test-progname.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test-progname.c (limited to 'test-progname.c') diff --git a/test-progname.c b/test-progname.c new file mode 100644 index 00000000..79add7eb --- /dev/null +++ b/test-progname.c @@ -0,0 +1,9 @@ +#include + +extern char *__progname; + +int +main(void) +{ + return !!strcmp(__progname, "test-progname"); +} -- cgit v1.2.3-56-ge451