1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#if defined(LIBC_RCS) && !defined(lint) static const char rcsid[] = "$FreeBSD$"; #endif /* LIBC_RCS and not lint */ #include <stdlib.h> #include <string.h> extern const char *__progname; void setprogname(const char *progname) { const char *p; p = strrchr(progname, '/'); __progname = p ? p + 1 : progname; }