|
NAMEgetprogname , setprogname
—
get or set the program name
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <stdlib.h>
const char *
void
DESCRIPTIONThegetprogname () and
setprogname () functions manipulate the name of the
current program. They are used by error-reporting routines to produce
consistent output.
The The In FreeBSD, the name of the program is set
by the start-up code that is run before EXAMPLESThe following example presents a simple program, which shows the difference betweengetprogname () and
argv[0].
#include <stdio.h> #include <stdlib.h> int main(int argc, char** argv) { printf("getprogname(): %s\n", getprogname()); printf("argv[0]: %s\n", argv[0]); return (0); } When compiled and executed (e.g., with
‘ getprogname(): a.out argv[0]: ./a.out SEE ALSOerr(3), setproctitle(3)HISTORYThese functions first appeared in NetBSD 1.6, and made their way into FreeBSD 4.4.
Visit the GSP FreeBSD Man Page Interface. |