]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/gen/setprogname.c
zfs: merge openzfs/zfs@e13538856
[FreeBSD/FreeBSD.git] / lib / libc / gen / setprogname.c
1 #include <sys/cdefs.h>
2 #include <stdlib.h>
3 #include <string.h>
4
5 #include "libc_private.h"
6
7 void
8 setprogname(const char *progname)
9 {
10         const char *p;
11
12         p = strrchr(progname, '/');
13         if (p != NULL)
14                 __progname = p + 1;
15         else
16                 __progname = progname;
17 }