GETPROGNAME(3C) Standard C Library Functions GETPROGNAME(3C)
- get or set the program name
SYNOPSIS #include <stdlib.h> const char * getprogname
); void setprogname
(const char *progname
() function is used to obtain the program name. The program
name is set at program start-up, before main
() is called. Note, other
operating systems, do not guarantee that a program name has been set at
start up time and therefore may return a null pointer if setprogname
not been called.
() function is used to change the program name to another
value. The argument progname
must contain a null terminated character
string, whose last component which will become the new program name.
() function always returns the current program name. The
program name is always set, it will not return a null pointer.
INTERFACE STABILITY CommittedMT-LEVEL getprogname
() is MT-Safe
() is Unsafe
The use of setprogname
() does not modify the program name as reported by
utilities like ps(1)
; however, it does ensure a consistent
program name for the err(3C)
family of functions.
OmniOS November 26, 2017 OmniOS