summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-07-04 08:52:31 +0000
committerderaadt <deraadt@openbsd.org>1998-07-04 08:52:31 +0000
commitb3557063929460680f24d0997b2eb94e79a6d64a (patch)
tree099033033d0221bb18fdf4c17a2750e1c7789f6d /lib/libc
parentmap registers of the qec+be 100mbit card (diff)
downloadwireguard-openbsd-b3557063929460680f24d0997b2eb94e79a6d64a.tar.xz
wireguard-openbsd-b3557063929460680f24d0997b2eb94e79a6d64a.zip
split dirname and basename man pages
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/Makefile.inc6
-rw-r--r--lib/libc/gen/basename.350
2 files changed, 14 insertions, 42 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 24bd548766a..de17321af12 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.16 1997/12/22 10:13:55 deraadt Exp $
+# $OpenBSD: Makefile.inc,v 1.17 1998/07/04 08:52:34 deraadt Exp $
# gen sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/gen ${.CURDIR}/gen
@@ -43,7 +43,8 @@ errlst.o errlst.po:
.endif # _NOTDEF_XXX_
MAN+= alarm.3 basename.3 clock.3 confstr.3 ctermid.3 ctype.3 daemon.3 \
- devname.3 directory.3 err.3 exec.3 fnmatch.3 frexp.3 ftok.3 fts.3 \
+ devname.3 directory.3 dirname.3 err.3 exec.3 fnmatch.3 frexp.3 \
+ ftok.3 fts.3 \
getbsize.3 getcap.3 getcwd.3 getdomainname.3 getdiskbyname.3 \
getfsent.3 getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \
getmntinfo.3 getnetgrent.3 getpagesize.3 getpass.3 getpwent.3 \
@@ -99,4 +100,3 @@ MLINKS+=syslog.3 closelog.3 syslog.3 openlog.3 syslog.3 setlogmask.3 \
syslog.3 vsyslog.3
MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyslot.3
MLINKS+=vis.3 strvis.3 vis.3 strvisx.3 unvis.3 strunvis.3
-MLINKS+=basename.3 dirname.3
diff --git a/lib/libc/gen/basename.3 b/lib/libc/gen/basename.3
index a6e063ac876..29779573643 100644
--- a/lib/libc/gen/basename.3
+++ b/lib/libc/gen/basename.3
@@ -24,21 +24,18 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: basename.3,v 1.3 1998/06/21 22:13:38 millert Exp $
+.\" $OpenBSD: basename.3,v 1.4 1998/07/04 08:52:35 deraadt Exp $
.\"
.Dd August 17, 1997
.Dt BASENAME 3
.Os
.Sh NAME
-.Nm basename ,
-.Nm dirname
-.Nd extract the base or directory portition of a pathname
+.Nm basename
+.Nd extract the base portition of a pathname
.Sh SYNOPSIS
.Fd #include <libgen.h>
.Ft char *
.Fn basename "char *path"
-.Ft char *
-.Fn dirname "char *path"
.Sh DESCRIPTION
The
.Fn basename
@@ -52,36 +49,16 @@ is returned. If
.Ar path
is a NULL pointer or the empty string, a pointer to the string "."
is returned.
-.Pp
-The
-.Fn dirname
-function
-is the converse of
-.Fn basename ;
-it returns a pointer to the parent directory of the pathname pointed to by
-.Ar path .
-Any trailing '/' characters are not counted as part of the directory
-name. If
-.Ar path
-is a NULL pointer, the empty string, or contains no '/' characters,
-.Fn dirname
-returns a pointer to the string ".", signifying the current directory.
.Sh RETURN VALUES
On successful completion,
.Fn basename
returns a pointer to the last component of
.Ar path.
.Pp
-On successful completion,
-.Fn dirname
-returns a pointer to the parent directory of
-.Ar path.
.Pp
If
.Fn basename
-or
-.Fn dirname
-fail, a NULL pointer is returned and the global variable
+fails, a NULL pointer is returned and the global variable
.Va errno
is set to indicate the error.
.Sh ERRORS
@@ -92,28 +69,23 @@ The following error codes may be set in
the path component to be returned was larger than
.Va MANPATHLEN .
.Sh WARNINGS
-Both
.Fn basename
-and
-.Fn dirname
-return pointers to internal static storage space that will be overwritten
-by subsequent calls (each function has its own separate storage).
+returns a pointer to internal static storage space that will be overwritten
+by subsequent calls.
.Sh SEE ALSO
.Xr basename 1 ,
+.Xr dirname 1 ,
+.Xr dirname 3 ,
.Xr dirname 1
.Sh STANDARDS
The
-.Fn basename
-and
-.Fn dirname
-functions conform to
+.Fn basename
+function conforms to
.St -xpg4.2 .
.Sh HISTORY
The
.Fn basename
-and
-.Fn dirname
-functions first appeared in
+function first appeared in
.Ox 2.2 .
.Sh AUTHOR
.nf