xref: /freebsd/lib/libc/gen/setprogname.c (revision f5463265955b829775bbb32e1fd0bc11dafc36ce)
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