Query: getprogname
OS: mojave
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GETPROGNAME(3) BSD Library Functions Manual GETPROGNAME(3)NAMEgetprogname, setprogname -- get or set the program nameLIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <stdlib.h> const char * getprogname(void); void setprogname(const char *progname);DESCRIPTIONThe getprogname() and setprogname() functions manipulate the name of the current program. They are used by error-reporting routines to pro- duce consistent output. The getprogname() function returns the name of the program. If the name has not been set yet, it will return NULL. The setprogname() function sets the name of the program to be the last component of the progname argument. Since a pointer to the given string is kept as the program name, it should not be modified for the rest of the program's lifetime. In FreeBSD, the name of the program is set by the start-up code that is run before main(); thus, running setprogname() is not necessary. Programs that desire maximum portability should still call it; on another operating system, these functions may be implemented in a portabil- ity library. Calling setprogname() allows the aforementioned library to learn the program name without modifications to the start-up code.SEE ALSOerr(3)HISTORYThese functions first appeared in NetBSD 1.6, and made their way into FreeBSD 4.4.BSDMay 1, 2001 BSD
Related Man Pages |
---|
getprogname(3) - mojave |
getprogname(3) - netbsd |
getprogname(3) - debian |
setprogname(3) - debian |
setprogname(3) - freebsd |
Similar Topics in the Unix Linux Community |
---|
Where do I start to learn PERL? |
External comands in C? |
FreeBSD or Linux, which one is more fit for new man |
Running a program (Dynflow) |
Calling compiled C program with Perl program |