summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-07-31 16:43:27 +0000
committerderaadt <deraadt@openbsd.org>2013-07-31 16:43:27 +0000
commit6e792a6eee53571062d1be31796278df25b9f326 (patch)
tree9698a8673d8965d18eb966a66143a9003a52e5b5 /lib/libc
parentfixup pfctl regress fallout from the "set tos" and "set queue" changes (diff)
downloadwireguard-openbsd-6e792a6eee53571062d1be31796278df25b9f326.tar.xz
wireguard-openbsd-6e792a6eee53571062d1be31796278df25b9f326.zip
remove complete balony description of the setprogname() interface [as
imported from netbsd] -- like, if maximum portability requires you to setprogname(), what NAME WOULD YOU PASS IT? LIKE DUH!!!!! also add some historical context so that people understand how this fits into the scheme of things. ok okan kettenis jmc
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getprogname.330
1 files changed, 7 insertions, 23 deletions
diff --git a/lib/libc/gen/getprogname.3 b/lib/libc/gen/getprogname.3
index ed7ccfd9e85..d4ade82a186 100644
--- a/lib/libc/gen/getprogname.3
+++ b/lib/libc/gen/getprogname.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getprogname.3,v 1.3 2013/06/01 17:14:45 jmc Exp $
+.\" $OpenBSD: getprogname.3,v 1.4 2013/07/31 16:43:27 deraadt Exp $
.\"
.\" Copyright (c) 2001 Christopher G. Demetriou
.\" All rights reserved.
@@ -30,7 +30,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 1 2013 $
+.Dd $Mdocdate: July 31 2013 $
.Dt GETPROGNAME 3
.Os
.Sh NAME
@@ -51,10 +51,6 @@ as used by various error-reporting functions.
returns the name of the current program.
This function is typically useful when generating error messages
or other diagnostic output.
-If the program name has not been set,
-.Fn getprogname
-will return
-.Dv NULL .
.Pp
The
.Fn setprogname
@@ -64,22 +60,6 @@ argument.
Internally, only the pointer to the given string is kept as the program name,
so it should not be modified and the storage for the string must remain valid
for the rest of the program's lifetime.
-.Pp
-In
-.Ox ,
-the name of the program is set by the start-up code that is run before
-.Fn main ;
-thus,
-running
-.Fn setprogname
-is not necessary.
-Programs that desire maximum portability should still call it;
-on other operating systems,
-these functions may be implemented in a portability library.
-Calling
-.Fn setprogname
-allows the aforementioned library to learn the program name without
-modifications to the start-up code.
.Sh SEE ALSO
.Xr err 3 ,
.Xr setproctitle 3
@@ -89,7 +69,11 @@ The
and
.Nm setprogname
functions first appeared in
-.Ox 5.4 .
+.Ox 5.4
+as function-based wrappers around the
+.Bx 4.4
+.Va __progname
+interface.
.Sh CAVEATS
The string returned by
.Fn getprogname