setprogname man page on FreeBSD

Man page or keyword search:  
man Server   9747 pages
apropos Keyword Search (all sections)
Output format
FreeBSD logo
[printable version]

GETPROGNAME(3)		 BSD Library Functions Manual		GETPROGNAME(3)

     getprogname, setprogname — get or set the program name

     Standard C Library (libc, -lc)

     #include <stdlib.h>

     const char *

     setprogname(const char *progname);

     The getprogname() and setprogname() functions manipulate the name of the
     current program.  They are used by error-reporting routines to produce
     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.  Pro‐
     grams that desire maximum portability should still call it; on another
     operating system, these functions may be implemented in a portability
     library.  Calling setprogname() allows the aforementioned library to
     learn the program name without modifications to the start-up code.

     err(3), setproctitle(3)

     These functions first appeared in NetBSD 1.6, and made their way into
     FreeBSD 4.4.

BSD				  May 1, 2001				   BSD

List of man pages available for FreeBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net