diff options
author | Robert Mustacchi <rm@joyent.com> | 2014-12-22 09:57:27 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2014-12-27 08:30:24 -0800 |
commit | b65dd972486b1f5913d705d2a0cb9c3fb189a9e0 (patch) | |
tree | 2928c5187e9eca7ad1622c999ef3317ac9a3649e /usr/src/man/man3c | |
parent | d2b9ba291ef0d1dc8807b6d46996674c723924d0 (diff) | |
download | illumos-gate-b65dd972486b1f5913d705d2a0cb9c3fb189a9e0.tar.gz |
5476 need manuals for getprogname(3C) and setprogname(3C)
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r-- | usr/src/man/man3c/Makefile | 4 | ||||
-rw-r--r-- | usr/src/man/man3c/getprogname.3c | 77 |
2 files changed, 81 insertions, 0 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index 2e6ebee2a1..8702d82265 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -168,6 +168,7 @@ MANFILES= __fbufsize.3c \ getpass.3c \ getpeerucred.3c \ getpriority.3c \ + getprogname.3c \ getpw.3c \ getpwnam.3c \ getrusage.3c \ @@ -1096,6 +1097,7 @@ MANLINKS= FD_CLR.3c \ setlogmask.3c \ setnetgrent.3c \ setpriority.3c \ + setprogname.3c \ setpwent.3c \ setspent.3c \ setstate.3c \ @@ -1673,6 +1675,8 @@ getpassphrase.3c := LINKSRC = getpass.3c setpriority.3c := LINKSRC = getpriority.3c +setprogname.3c := LINKSRC = getprogname.3c + endpwent.3c := LINKSRC = getpwnam.3c fgetpwent.3c := LINKSRC = getpwnam.3c fgetpwent_r.3c := LINKSRC = getpwnam.3c diff --git a/usr/src/man/man3c/getprogname.3c b/usr/src/man/man3c/getprogname.3c new file mode 100644 index 0000000000..5bc48e6d69 --- /dev/null +++ b/usr/src/man/man3c/getprogname.3c @@ -0,0 +1,77 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright (c) 2014, Joyent, Inc. +.\" +.Dd "Dec 22, 2014" +.Dt GETPROGNAME 3C +.Os +.Sh NAME +.Nm getprogname , +.Nm setprogname +.Nd get or set the program name +.Sh SYNOPSIS +.In stdlib.h +.Ft const char * +.Fo getprogname +.Fa void +.Fc +.Ft void +.Fo setprogname +.Fa "const char *progname" +.Fc +.Sh DESCRIPTION +The +.Fn getprogname +function is used to obtain the program name. The program name is set at +program start-up, before +.Fn 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 +.Fn setprogname +has not been called. +.Lp +The +.Fn setprogname +function is used to change the program name to another value. The +argument +.Fa progname +must contain a null terminatd character string, whose last component +which will become the new program name. +.Sh RETURN VALUES +The +.Fn getprogname +function always returns the current program name. The program name is +always set, it will not return a null pointer. +.Sh INTERFACE STABILITY +.Sy Committed +.Sh MT-LEVEL +.Fn getprogname +is +.Sy MT-Safe . +.Lp +.Fn setprogname +is +.Sy Unsafe . +.Sh SEE ALSO +.Xr err 3c , +.Xr attributes 5 +.Sh NOTES +The use of +.Fn setprogname +does not modify the program name as reported by utilities like +.Xr ps 1 +or +.Xr pargs 1 ; +however, it does ensure a consistent program name for the +.Xr err 3C +family of functions. |