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 | |
parent | d2b9ba291ef0d1dc8807b6d46996674c723924d0 (diff) | |
download | illumos-joyent-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')
-rw-r--r-- | usr/src/man/man3c/Makefile | 4 | ||||
-rw-r--r-- | usr/src/man/man3c/getprogname.3c | 77 | ||||
-rw-r--r-- | usr/src/man/man3lib/libc.3lib | 6 | ||||
-rw-r--r-- | usr/src/pkg/manifests/system-library.man3c.inc | 2 |
4 files changed, 87 insertions, 2 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. diff --git a/usr/src/man/man3lib/libc.3lib b/usr/src/man/man3lib/libc.3lib index 793e3d56e6..6bb3e5b5ec 100644 --- a/usr/src/man/man3lib/libc.3lib +++ b/usr/src/man/man3lib/libc.3lib @@ -300,7 +300,8 @@ l l . \fBgetpgid\fR \fBgetpgrp\fR \fBgetpid\fR \fBgetpmsg\fR \fBgetppid\fR \fBgetppriv\fR -\fBgetpriority\fR \fBgetprojid\fR +\fBgetpriority\fR \fbgetprogname\fR +\fBgetprojid\fR \fBgetpw\fR \fBgetpwent\fR \fBgetpwent_r\fR \fBgetpwnam\fR \fBgetpwnam_r\fR \fBgetpwuid\fR @@ -629,7 +630,8 @@ l l . \fBsetlogmask\fR \fBsetnetgrent\fR \fBsetpflags\fR \fBsetpgid\fR \fBsetpgrp\fR \fBsetppriv\fR -\fBsetpriority\fR \fBsetpwent\fR +\fBsetpriority\fR \fBsetprogname\fR +\fBsetpwent\fR \fBsetrctl\fR \fBsetregid\fR \fBsetreuid\fR \fBsetrlimit\fR \fBsetsid\fR \fBsetspent\fR diff --git a/usr/src/pkg/manifests/system-library.man3c.inc b/usr/src/pkg/manifests/system-library.man3c.inc index 6214caccf7..9cccc7aeeb 100644 --- a/usr/src/pkg/manifests/system-library.man3c.inc +++ b/usr/src/pkg/manifests/system-library.man3c.inc @@ -164,6 +164,7 @@ file path=usr/share/man/man3c/getpagesizes.3c file path=usr/share/man/man3c/getpass.3c file path=usr/share/man/man3c/getpeerucred.3c file path=usr/share/man/man3c/getpriority.3c +file path=usr/share/man/man3c/getprogname.3c file path=usr/share/man/man3c/getpw.3c file path=usr/share/man/man3c/getpwnam.3c file path=usr/share/man/man3c/getrusage.3c @@ -1164,6 +1165,7 @@ link path=usr/share/man/man3c/setlinebuf.3c target=setbuffer.3c link path=usr/share/man/man3c/setlogmask.3c target=syslog.3c link path=usr/share/man/man3c/setnetgrent.3c target=getnetgrent.3c link path=usr/share/man/man3c/setpriority.3c target=getpriority.3c +link path=usr/share/man/man3c/setprogname.3c target=getprogname.3c link path=usr/share/man/man3c/setpwent.3c target=getpwnam.3c link path=usr/share/man/man3c/setspent.3c target=getspnam.3c link path=usr/share/man/man3c/setstate.3c target=random.3c |