xref: /freebsd/lib/libc/gen/setprogname.c (revision 7c43148a974877188a930e4078a164f83da8e652)
1 #include <stdlib.h>
2 #include <string.h>
3 
4 #include "libc_private.h"
5 
6 void
7 setprogname(const char *progname)
8 {
9 	const char *p;
10 
11 	p = strrchr(progname, '/');
12 	if (p != NULL)
13 		__progname = p + 1;
14 	else
15 		__progname = progname;
16 }
17