summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/setprogname.c
blob: 341e910553f1ce4e464d87b855ec54cca594c3ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#if defined(LIBC_RCS) && !defined(lint)
static const char rcsid[] =
  "$FreeBSD$";
#endif /* LIBC_RCS and not lint */

#include <string.h>

extern const char *__progname;

void
setprogname(const char *progname)
{
	char *p;

	p = strrchr(progname, '/');
	__progname = p ? p + 1 : progname;
}
OpenPOWER on IntegriCloud