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