macro and text revision (-mdoc version 3)
authorCynthia A. E. Livingston <cael@ucbvax.Berkeley.EDU>
Sat, 20 Apr 1991 05:50:58 +0000 (21:50 -0800)
committerCynthia A. E. Livingston <cael@ucbvax.Berkeley.EDU>
Sat, 20 Apr 1991 05:50:58 +0000 (21:50 -0800)
SCCS-vsn: share/man/man3/end.3 6.3
SCCS-vsn: share/man/man3/stdarg.3 6.5
SCCS-vsn: share/man/man3/assert.3 6.3
SCCS-vsn: share/man/man3/bitstring.3 5.4
SCCS-vsn: lib/libcompat/4.3/re_comp.3 6.3
SCCS-vsn: lib/libcompat/4.3/insque.3 6.3
SCCS-vsn: lib/libcompat/4.3/rexec.3 6.9
SCCS-vsn: lib/libcompat/4.3/lsearch.3 5.5
SCCS-vsn: lib/libcompat/4.1/ftime.3 6.3
SCCS-vsn: lib/libcompat/4.1/vtimes.3 6.5
SCCS-vsn: lib/libcompat/4.1/vlimit.3 6.4
SCCS-vsn: lib/libcompat/4.1/stty.3 6.4
SCCS-vsn: lib/libcompat/4.1/getpw.3 6.4
SCCS-vsn: lib/libc/gen/getloadavg.3 6.3
SCCS-vsn: lib/libc/gen/pwcache.3 5.4
SCCS-vsn: lib/libc/stdlib/getopt.3 6.16
SCCS-vsn: lib/libc/stdlib/random.3 6.5
SCCS-vsn: lib/libc/stdlib/malloc.3 6.5
SCCS-vsn: lib/libc/stdlib/ldiv.3 5.2
SCCS-vsn: lib/libc/stdlib/div.3 5.2
SCCS-vsn: lib/libc/stdlib/labs.3 5.2
SCCS-vsn: lib/libc/stdlib/bsearch.3 5.4
SCCS-vsn: lib/libc/stdlib/system.3 6.4
SCCS-vsn: lib/libc/stdlib/abs.3 6.3
SCCS-vsn: lib/libc/stdlib/exit.3 6.5
SCCS-vsn: lib/libc/stdlib/strtod.3 5.2
SCCS-vsn: lib/libc/stdlib/atol.3 5.2
SCCS-vsn: lib/libc/stdlib/atoi.3 5.2
SCCS-vsn: lib/libc/stdlib/atof.3 6.3
SCCS-vsn: lib/libc/stdlib/abort.3 6.6
SCCS-vsn: lib/libc/stdlib/atexit.3 5.2
SCCS-vsn: lib/libc/stdlib/radixsort.3 5.5
SCCS-vsn: lib/libc/stdlib/getenv.3 6.10
SCCS-vsn: lib/libc/stdlib/strtol.3 5.2
SCCS-vsn: lib/libc/stdlib/rand.3 6.6
SCCS-vsn: lib/libc/stdlib/qsort.3 6.5
SCCS-vsn: lib/libc/string/rindex.3 5.2
SCCS-vsn: lib/libc/string/strstr.3 5.2
SCCS-vsn: lib/libc/string/strspn.3 5.2
SCCS-vsn: lib/libc/string/strrchr.3 5.2
SCCS-vsn: lib/libc/string/strxfrm.3 5.3
SCCS-vsn: lib/libc/string/strcspn.3 5.2
SCCS-vsn: lib/libc/string/string.3 6.9
SCCS-vsn: lib/libc/string/strcpy.3 5.3
SCCS-vsn: lib/libc/string/strchr.3 5.2
SCCS-vsn: lib/libc/string/strcoll.3 5.4
SCCS-vsn: lib/libc/string/strcmp.3 5.4
SCCS-vsn: lib/libc/string/strcat.3 5.4
SCCS-vsn: lib/libc/string/strcasecmp.3 5.3
SCCS-vsn: lib/libc/string/memchr.3 5.2
SCCS-vsn: lib/libc/string/memmove.3 5.3
SCCS-vsn: lib/libc/string/index.3 5.2
SCCS-vsn: lib/libc/string/memcpy.3 5.3
SCCS-vsn: lib/libc/string/strpbrk.3 5.2
SCCS-vsn: lib/libc/string/ffs.3 5.2
SCCS-vsn: lib/libc/string/memset.3 5.2
SCCS-vsn: lib/libc/string/memcmp.3 5.3
SCCS-vsn: lib/libc/string/bzero.3 5.2
SCCS-vsn: lib/libc/string/bstring.3 6.7
SCCS-vsn: lib/libc/string/swab.3 6.4
SCCS-vsn: lib/libc/string/strmode.3 5.2
SCCS-vsn: lib/libc/string/strsep.3 5.2
SCCS-vsn: lib/libc/string/memccpy.3 5.3
SCCS-vsn: lib/libc/string/bcopy.3 5.2
SCCS-vsn: lib/libc/string/strtok.3 5.6
SCCS-vsn: lib/libc/string/bcmp.3 5.3
SCCS-vsn: lib/libc/string/strftime.3 5.10
SCCS-vsn: lib/libc/string/strdup.3 5.2
SCCS-vsn: lib/libc/string/strlen.3 5.2
SCCS-vsn: lib/libc/string/strerror.3 6.7
SCCS-vsn: lib/libc/stdio/setbuf.3 6.8
SCCS-vsn: lib/libc/stdio/tmpnam.3 5.12
SCCS-vsn: lib/libc/stdio/remove.3 5.2
SCCS-vsn: lib/libc/stdio/funopen.3 5.2
SCCS-vsn: lib/libc/stdio/printf.3 6.10
SCCS-vsn: lib/libc/stdio/fflush.3 5.2
SCCS-vsn: lib/libc/stdio/ungetc.3 6.4
SCCS-vsn: lib/libc/stdio/scanf.3 6.5
SCCS-vsn: lib/libc/stdio/fputs.3 6.4
SCCS-vsn: lib/libc/stdio/putc.3 6.5
SCCS-vsn: lib/libc/stdio/mktemp.3 6.9
SCCS-vsn: lib/libc/stdio/getc.3 6.6
SCCS-vsn: lib/libc/string/strcoll.3 5.5
SCCS-vsn: lib/libc/string/strcmp.3 5.5
SCCS-vsn: lib/libc/string/strcat.3 5.5
SCCS-vsn: lib/libc/string/strcasecmp.3 5.4
SCCS-vsn: lib/libc/string/memchr.3 5.3
SCCS-vsn: lib/libc/string/memmove.3 5.4
SCCS-vsn: lib/libc/string/index.3 5.3
SCCS-vsn: lib/libc/string/memcpy.3 5.4
SCCS-vsn: lib/libc/string/strpbrk.3 5.3
SCCS-vsn: lib/libc/string/ffs.3 5.3
SCCS-vsn: lib/libc/string/memset.3 5.3
SCCS-vsn: lib/libc/string/memcmp.3 5.4
SCCS-vsn: lib/libc/string/bzero.3 5.3
SCCS-vsn: lib/libc/string/bstring.3 6.8
SCCS-vsn: lib/libc/string/swab.3 6.5
SCCS-vsn: lib/libc/string/strmode.3 5.3
SCCS-vsn: lib/libc/string/strsep.3 5.3
SCCS-vsn: lib/libc/string/memccpy.3 5.4
SCCS-vsn: lib/libc/string/bcopy.3 5.3
SCCS-vsn: lib/libc/string/strtok.3 5.7
SCCS-vsn: lib/libc/string/bcmp.3 5.4
SCCS-vsn: lib/libc/string/strftime.3 5.11
SCCS-vsn: lib/libc/string/strdup.3 5.3
SCCS-vsn: lib/libc/string/strlen.3 5.3
SCCS-vsn: lib/libc/string/strerror.3 6.8
SCCS-vsn: lib/libc/stdio/setbuf.3 6.9
SCCS-vsn: lib/libc/stdio/tmpnam.3 5.13
SCCS-vsn: lib/libc/stdio/remove.3 5.3
SCCS-vsn: lib/libc/stdio/funopen.3 5.3
SCCS-vsn: lib/libc/stdio/printf.3 6.11
SCCS-vsn: lib/libc/stdio/fflush.3 5.3
SCCS-vsn: lib/libc/stdio/ungetc.3 6.5
SCCS-vsn: lib/libc/stdio/scanf.3 6.6
SCCS-vsn: lib/libc/stdio/fputs.3 6.5
SCCS-vsn: lib/libc/stdio/putc.3 6.6
SCCS-vsn: lib/libc/stdio/mktemp.3 6.10
SCCS-vsn: lib/libc/stdio/getc.3 6.7
SCCS-vsn: lib/libc/stdio/fseek.3 6.9
SCCS-vsn: lib/libc/stdio/fread.3 6.5
SCCS-vsn: lib/libc/stdio/fgets.3 6.8
SCCS-vsn: lib/libc/stdio/ferror.3 6.7
SCCS-vsn: lib/libc/stdio/fopen.3 6.7
SCCS-vsn: lib/libc/stdio/fclose.3 6.6
SCCS-vsn: lib/libc/stdio/fgetln.3 5.4
SCCS-vsn: lib/libc/gen/valloc.3 6.3
SCCS-vsn: lib/libc/gen/usleep.3 6.4
SCCS-vsn: lib/libc/gen/ualarm.3 6.5
SCCS-vsn: lib/libc/gen/nice.3 6.2
SCCS-vsn: lib/libc/gen/ttyname.3 6.2
SCCS-vsn: lib/libc/gen/sleep.3 6.3
SCCS-vsn: lib/libc/gen/siginterrupt.3 6.2
SCCS-vsn: lib/libc/sys/setuid.2 6.4
SCCS-vsn: lib/libc/gen/psignal.3 6.2
SCCS-vsn: lib/libc/gen/nlist.3 6.2
SCCS-vsn: lib/libc/gen/pause.3 6.3
SCCS-vsn: lib/libc/gen/initgroups.3 6.3
SCCS-vsn: lib/libc/gen/getpass.3 6.3
SCCS-vsn: lib/libc/gen/frexp.3 6.4
SCCS-vsn: lib/libc/gen/tzset.3 5.2
SCCS-vsn: lib/libc/locale/ctype.3 6.5
SCCS-vsn: lib/libc/gen/times.3 6.4
SCCS-vsn: lib/libc/gen/fnmatch.3 5.3
SCCS-vsn: lib/libc/gen/getdiskbyname.3 6.6
SCCS-vsn: lib/libc/gen/getfsent.3 6.9
SCCS-vsn: lib/libc/stdlib/getsubopt.3 5.3
SCCS-vsn: lib/libc/gen/getusershell.3 6.5
SCCS-vsn: lib/libc/gen/exec.3 6.4
SCCS-vsn: lib/libc/gen/time.3 5.3
SCCS-vsn: lib/libc/gen/setjmp.3 6.5
SCCS-vsn: lib/libc/gen/ctermid.3 5.2
SCCS-vsn: lib/libc/gen/getcwd.3 6.4
SCCS-vsn: lib/libc/gen/scandir.3 6.8
SCCS-vsn: lib/libc/gen/raise.3 5.2
SCCS-vsn: lib/libc/gen/ctime.3 6.15
SCCS-vsn: lib/libc/gen/clock.3 5.3
SCCS-vsn: lib/libc/gen/alarm.3 6.4
SCCS-vsn: lib/libc/gen/getmntinfo.3 6.5
SCCS-vsn: lib/libc/gen/utime.3 6.3
SCCS-vsn: lib/libc/gen/glob.3 5.4
SCCS-vsn: lib/libc/gen/unvis.3 1.3
SCCS-vsn: lib/libc/gen/syslog.3 6.17
SCCS-vsn: lib/libc/gen/getpwent.3 6.8
SCCS-vsn: lib/libc/gen/vis.3 5.7
SCCS-vsn: lib/libc/gen/getttyent.3 6.7
SCCS-vsn: lib/libc/gen/directory.3 6.7
SCCS-vsn: lib/libc/gen/fts.3 5.10
SCCS-vsn: lib/libc/gen/sigsetops.3 6.2
SCCS-vsn: lib/libc/gen/setmode.3 5.4
SCCS-vsn: lib/libc/gen/signal.3 6.6
SCCS-vsn: lib/libc/gen/crypt.3 6.3
SCCS-vsn: lib/libc/gen/getgrent.3 6.7
SCCS-vsn: lib/libc/net/gethostbyname.3 6.13
SCCS-vsn: lib/libc/net/getnetent.3 6.6
SCCS-vsn: lib/libc/net/getprotoent.3 6.6
SCCS-vsn: lib/libc/net/byteorder.3 6.7
SCCS-vsn: lib/libc/net/getservent.3 6.6
SCCS-vsn: lib/libc/net/ns.3 6.5
SCCS-vsn: lib/libc/net/rcmd.3 6.11
SCCS-vsn: lib/libc/net/inet.3 6.10
SCCS-vsn: lib/libmp/mp.3 6.5
SCCS-vsn: lib/libterm/termcap.3 6.6
SCCS-vsn: lib/libm/common_source/sqrt.3 6.3
SCCS-vsn: lib/libm/common_source/sinh.3 6.6
SCCS-vsn: lib/libm/common_source/sin.3 6.7
SCCS-vsn: lib/libm/common_source/j0.3 6.7
SCCS-vsn: lib/libm/common_source/infnan.3 6.5
SCCS-vsn: lib/libm/common_source/ieee.3 6.3
SCCS-vsn: lib/libm/common_source/hypot.3 6.6
SCCS-vsn: lib/libm/common_source/floor.3 6.5
SCCS-vsn: lib/libm/common_source/erf.3 6.3
SCCS-vsn: lib/libm/common_source/asinh.3 6.3
SCCS-vsn: lib/libm/common_source/exp.3 6.10
SCCS-vsn: lib/libcurses/curses.3 6.6

158 files changed:
usr/src/lib/libc/gen/alarm.3
usr/src/lib/libc/gen/clock.3
usr/src/lib/libc/gen/crypt.3
usr/src/lib/libc/gen/ctermid.3
usr/src/lib/libc/gen/ctime.3
usr/src/lib/libc/gen/directory.3
usr/src/lib/libc/gen/exec.3
usr/src/lib/libc/gen/fnmatch.3
usr/src/lib/libc/gen/frexp.3
usr/src/lib/libc/gen/fts.3
usr/src/lib/libc/gen/getcwd.3
usr/src/lib/libc/gen/getdiskbyname.3
usr/src/lib/libc/gen/getfsent.3
usr/src/lib/libc/gen/getgrent.3
usr/src/lib/libc/gen/getloadavg.3
usr/src/lib/libc/gen/getmntinfo.3
usr/src/lib/libc/gen/getpass.3
usr/src/lib/libc/gen/getpwent.3
usr/src/lib/libc/gen/getttyent.3
usr/src/lib/libc/gen/getusershell.3
usr/src/lib/libc/gen/glob.3
usr/src/lib/libc/gen/initgroups.3
usr/src/lib/libc/gen/nice.3
usr/src/lib/libc/gen/nlist.3
usr/src/lib/libc/gen/pause.3
usr/src/lib/libc/gen/psignal.3
usr/src/lib/libc/gen/pwcache.3
usr/src/lib/libc/gen/raise.3
usr/src/lib/libc/gen/scandir.3
usr/src/lib/libc/gen/setjmp.3
usr/src/lib/libc/gen/setmode.3
usr/src/lib/libc/gen/siginterrupt.3
usr/src/lib/libc/gen/signal.3
usr/src/lib/libc/gen/sigsetops.3
usr/src/lib/libc/gen/sleep.3
usr/src/lib/libc/gen/syslog.3
usr/src/lib/libc/gen/time.3
usr/src/lib/libc/gen/times.3
usr/src/lib/libc/gen/ttyname.3
usr/src/lib/libc/gen/tzset.3
usr/src/lib/libc/gen/ualarm.3
usr/src/lib/libc/gen/unvis.3
usr/src/lib/libc/gen/usleep.3
usr/src/lib/libc/gen/utime.3
usr/src/lib/libc/gen/valloc.3
usr/src/lib/libc/gen/vis.3
usr/src/lib/libc/locale/ctype.3
usr/src/lib/libc/net/byteorder.3
usr/src/lib/libc/net/gethostbyname.3
usr/src/lib/libc/net/getnetent.3
usr/src/lib/libc/net/getprotoent.3
usr/src/lib/libc/net/getservent.3
usr/src/lib/libc/net/inet.3
usr/src/lib/libc/net/ns.3
usr/src/lib/libc/net/rcmd.3
usr/src/lib/libc/stdio/fclose.3
usr/src/lib/libc/stdio/ferror.3
usr/src/lib/libc/stdio/fflush.3
usr/src/lib/libc/stdio/fgetln.3
usr/src/lib/libc/stdio/fgets.3
usr/src/lib/libc/stdio/fopen.3
usr/src/lib/libc/stdio/fputs.3
usr/src/lib/libc/stdio/fread.3
usr/src/lib/libc/stdio/fseek.3
usr/src/lib/libc/stdio/funopen.3
usr/src/lib/libc/stdio/getc.3
usr/src/lib/libc/stdio/mktemp.3
usr/src/lib/libc/stdio/printf.3
usr/src/lib/libc/stdio/putc.3
usr/src/lib/libc/stdio/remove.3
usr/src/lib/libc/stdio/scanf.3
usr/src/lib/libc/stdio/setbuf.3
usr/src/lib/libc/stdio/tmpnam.3
usr/src/lib/libc/stdio/ungetc.3
usr/src/lib/libc/stdlib/abort.3
usr/src/lib/libc/stdlib/abs.3
usr/src/lib/libc/stdlib/atexit.3
usr/src/lib/libc/stdlib/atof.3
usr/src/lib/libc/stdlib/atoi.3
usr/src/lib/libc/stdlib/atol.3
usr/src/lib/libc/stdlib/bsearch.3
usr/src/lib/libc/stdlib/div.3
usr/src/lib/libc/stdlib/exit.3
usr/src/lib/libc/stdlib/getenv.3
usr/src/lib/libc/stdlib/getopt.3
usr/src/lib/libc/stdlib/getsubopt.3
usr/src/lib/libc/stdlib/labs.3
usr/src/lib/libc/stdlib/ldiv.3
usr/src/lib/libc/stdlib/malloc.3
usr/src/lib/libc/stdlib/qsort.3
usr/src/lib/libc/stdlib/radixsort.3
usr/src/lib/libc/stdlib/rand.3
usr/src/lib/libc/stdlib/random.3
usr/src/lib/libc/stdlib/strtod.3
usr/src/lib/libc/stdlib/strtol.3
usr/src/lib/libc/stdlib/system.3
usr/src/lib/libc/string/bcmp.3
usr/src/lib/libc/string/bcopy.3
usr/src/lib/libc/string/bstring.3
usr/src/lib/libc/string/bzero.3
usr/src/lib/libc/string/ffs.3
usr/src/lib/libc/string/index.3
usr/src/lib/libc/string/memccpy.3
usr/src/lib/libc/string/memchr.3
usr/src/lib/libc/string/memcmp.3
usr/src/lib/libc/string/memcpy.3
usr/src/lib/libc/string/memmove.3
usr/src/lib/libc/string/memset.3
usr/src/lib/libc/string/rindex.3
usr/src/lib/libc/string/strcasecmp.3
usr/src/lib/libc/string/strcat.3
usr/src/lib/libc/string/strchr.3
usr/src/lib/libc/string/strcmp.3
usr/src/lib/libc/string/strcoll.3
usr/src/lib/libc/string/strcpy.3
usr/src/lib/libc/string/strcspn.3
usr/src/lib/libc/string/strdup.3
usr/src/lib/libc/string/strerror.3
usr/src/lib/libc/string/strftime.3
usr/src/lib/libc/string/string.3
usr/src/lib/libc/string/strlen.3
usr/src/lib/libc/string/strmode.3
usr/src/lib/libc/string/strpbrk.3
usr/src/lib/libc/string/strrchr.3
usr/src/lib/libc/string/strsep.3
usr/src/lib/libc/string/strspn.3
usr/src/lib/libc/string/strstr.3
usr/src/lib/libc/string/strtok.3
usr/src/lib/libc/string/strxfrm.3
usr/src/lib/libc/string/swab.3
usr/src/lib/libc/sys/setuid.2
usr/src/lib/libcompat/4.1/ftime.3
usr/src/lib/libcompat/4.1/getpw.3
usr/src/lib/libcompat/4.1/stty.3
usr/src/lib/libcompat/4.1/vlimit.3
usr/src/lib/libcompat/4.1/vtimes.3
usr/src/lib/libcompat/4.3/insque.3
usr/src/lib/libcompat/4.3/lsearch.3
usr/src/lib/libcompat/4.3/re_comp.3
usr/src/lib/libcompat/4.3/rexec.3
usr/src/lib/libcurses/curses.3
usr/src/lib/libm/common_source/asinh.3
usr/src/lib/libm/common_source/erf.3
usr/src/lib/libm/common_source/exp.3
usr/src/lib/libm/common_source/floor.3
usr/src/lib/libm/common_source/hypot.3
usr/src/lib/libm/common_source/ieee.3
usr/src/lib/libm/common_source/infnan.3
usr/src/lib/libm/common_source/j0.3
usr/src/lib/libm/common_source/sin.3
usr/src/lib/libm/common_source/sinh.3
usr/src/lib/libm/common_source/sqrt.3
usr/src/lib/libmp/mp.3
usr/src/lib/libterm/termcap.3
usr/src/share/man/man3/assert.3
usr/src/share/man/man3/bitstring.3
usr/src/share/man/man3/end.3
usr/src/share/man/man3/stdarg.3

index 901a8fb..02c50a4 100644 (file)
@@ -1,37 +1,60 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)alarm.3     6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH ALARM 3C  ""
-.UC 4
-.SH NAME
-alarm \- schedule signal after specified time
-.SH SYNOPSIS
-.nf
-.B alarm(seconds)
-.B unsigned seconds;
-.fi
-.SH DESCRIPTION
-.ft B
+.\"     @(#)alarm.3    6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt ALARM 3
+.Os BSD 4
+.Sh NAME
+.Nm alarm
+.Nd set signal timer alarm
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft u_int
+.Fn alarm "u_int seconds"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is made obsolete by setitimer(2).
 This interface is made obsolete by setitimer(2).
-.ft R
-.PP
-.I Alarm
-causes signal SIGALRM, see
-.IR sigvec (2),
-to be sent to the invoking process
-in a number of seconds given by the argument.
-Unless caught or ignored, the signal terminates the process.
-.PP
-Alarm requests are not stacked; successive calls reset the alarm clock.
-If the argument is 0, any alarm request is canceled.
-Because of scheduling delays,
-resumption of execution of when the signal is
-caught may be delayed an arbitrary amount.
-The longest specifiable delay time is 2147483647 seconds.
-.PP
-The return value is the amount of time previously remaining in the alarm clock.
-.SH "SEE ALSO"
-sigpause(2), sigvec(2), signal(3C), sleep(3), ualarm(3), usleep(3)
+.Ef
+.Pp
+The
+.Fn alarm
+function
+waits a count of
+.Ar seconds
+before asserting the terminating signal
+.Dv SIGALRM .
+When the signal has successfully been caught,
+.Fn alarm
+returns the amount of time left on the clock.
+The maximum mumber of
+.Ar seconds
+allowed
+is 2147483647.
+.Pp
+If an alarm has been set with
+.Fn alarm ,
+another call to
+.Fn alarm
+will superceed the prior call.
+The request
+.Fn alarm "0"
+voids the current
+alarm.
+.Sh SEE ALSO
+.Xr sigaction 2 ,
+.Xr setitimer 2 ,
+.Xr sigpause 2 ,
+.Xr sigvec 2 ,
+.Xr signal 3 ,
+.Xr sleep 3 ,
+.Xr ualarm 3 ,
+.Xr usleep 3
+.Sh HISTORY
+An
+.Fn alarm
+function appeared in 
+.At v7 .
index f9aabbc..fc5121b 100644 (file)
@@ -1,29 +1,36 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)clock.3     5.2 (Berkeley) %G%
+.\"     @(#)clock.3    5.3 (Berkeley) %G%
 .\"
 .\"
-.TH CLOCK 3 ""
-.AT 3
-.SH NAME
-clock - determine processor time used
-.SH SYNOPSIS
-.nf
-#include <sys/types.h>
-
-clock_t
-clock()
-.fi
-.SH DESCRIPTION
-.I Clock
-returns the amount of processor time used since the process
-invocation, measured in
-.IR CLK_TCK 's.
-.PP
-On error,
-.I clock
-returns -1.
-.SH "SEE ALSO"
-getrusage(2)
+.Dd 
+.Dt CLOCK 3
+.Os
+.Sh NAME
+.Nm clock
+.Nd determine processor time used
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft clock_t
+.Fn clock void
+.Sh DESCRIPTION
+The
+.Fn clock
+function
+determines the amount of processor time used since the invocation of the
+calling process, measured in
+.Dv CLK_TCK Ns s.
+.Sh RETURN VALUES
+The
+.Fn clock
+function returns the amount of time used unless an error occurs, in which
+case the return value is \-1.
+.Sh SEE ALSO
+.Xr getrusage 2
+.Sh STANDARDS
+The
+.Fn clock
+function conforms to
+.St -ansiC .
index bb9ae97..a667837 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" All rights reserved.
 .\"
-.\" Redistribution and use in source and binary forms are permitted
-.\" provided that the above copyright notice and this paragraph are
-.\" duplicated in all such forms and that any documentation,
-.\" advertising materials, and other materials related to such
-.\" distribution and use acknowledge that the software was developed
-.\" by the University of California, Berkeley.  The name of the
-.\" University may not be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.\"    @(#)crypt.3     6.2 (Berkeley) %G%
+.\"     @(#)crypt.3    6.3 (Berkeley) %G%
 .\"
 .\"
-.TH CRYPT 3  ""
-.AT 3
-.SH NAME
-crypt, setkey, encrypt, des_setkey, des_cipher \- DES encryption
-.SH SYNOPSIS
-.nf
-.ft B
-char *crypt(char *key, char *setting);
-
-void setkey(char *key);
-void encrypt(char *block, int flag);
-
-void des_setkey(char *key);
-void des_cipher(char *in, char *out, unsigned long salt, int count);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Crypt
-is the password encryption routine.
-It is based on the NBS Data Encryption Standard, with variations intended to
-frustrate key search attempts.
-.IR Crypt 's
-first argument is a NUL-terminated string (normally a user's typed
-password).
+.Dd 
+.Dt CRYPT 3
+.Os
+.Sh NAME
+.Nm crypt ,
+.Nm setkey ,
+.Nm encrypt ,
+.Nm des_setkey ,
+.Nm des_cipher
+.Nd DES encryption
+.Sh SYNOPSIS
+.Ft char
+.Fn *crypt "const char *key" "const char *setting"
+.Ft void
+.Fn setkey "char *key"
+.Ft void
+.Fn encrypt "char *block" "int flag"
+.Ft void
+.Fn des_setkey "const char *key"
+.Ft void
+.Fn des_cipher "const char *in" "char *out" "u_long salt" "int count"
+.Sh DESCRIPTION
+The
+.Xr crypt
+function
+performs password encryption.
+It is derived from the
+.Tn NBS
+Data Encryption Standard.
+Additional code has been added to deter
+key search attempts.
+The first argument to
+.Nm crypt
+is
+a
+.Dv NUL Ns -terminated
+string (normally a password typed by
+a user)
+first argument is a
+.Dv NUL Ns -terminated
+(normally a user's typed
 The second is a character array, 9 bytes in length, consisting of an
 underscore (``_'') followed by 4 bytes of iteration count and 4 bytes
 of salt.
 Both the iteration
 The second is a character array, 9 bytes in length, consisting of an
 underscore (``_'') followed by 4 bytes of iteration count and 4 bytes
 of salt.
 Both the iteration
-.I count
+.Fa count
 and the 
 and the 
-.I salt 
+.Fa salt
 are encoded as follows: only 6 bits per character are used, with the least
 significant bits occurring first.
 The values 0 to 63 are encoded by the characters ``./0-9A-Za-z'',
 respectively.
 The
 are encoded as follows: only 6 bits per character are used, with the least
 significant bits occurring first.
 The values 0 to 63 are encoded by the characters ``./0-9A-Za-z'',
 respectively.
 The
-.I salt
-is used to perturb the DES algorithm in one of 16777216 different ways
+.Fa salt
+is used to induce disorder in to the
+.Tn DES
+algorithm
+in one of 16777216
+possible ways
 (specifically, if bit
 (specifically, if bit
-.I N
+.Em N
 of the
 of the
-.I salt
+.Ar salt
 is set then bits
 is set then bits
-.I N
+.Em N
 and
 and
-.I N+24
-are swapped in the DES ``E'' box output).
+.Em N+24
+are swapped in the
+.Tn DES
+``E'' box output).
 Then the
 Then the
-.I key
+.Ar key
 is used to perform
 is used to perform
-.I count
+.Ar count
 cumulative encryptions of a 64-bit constant.
 cumulative encryptions of a 64-bit constant.
-.\" XXX need to describe what really happens with the key.
-The returned value is a character array, 20 bytes in length, consisting
+The value returned is a character array, 20 bytes in length, consisting
 of the
 of the
-.I setting
+.Ar setting
 followed by the encoded 64-bit encryption.
 followed by the encoded 64-bit encryption.
-.PP
+.Pp
 For compatibility with historical versions of
 For compatibility with historical versions of
-.IR crypt (3),
+.Xr crypt 3 ,
 the
 the
-.I setting
+.Ar setting
 may consist of 2 bytes of salt, encoded as above, in which case an
 iteration
 may consist of 2 bytes of salt, encoded as above, in which case an
 iteration
-.I count
-of 25 is used, fewer perturbations of DES are available, at most 8
+.Ar count
+of 25 is used, fewer perturbations of
+.Tn DES
+are available, at most 8
 characters of
 characters of
-.I key
+.Ar key
 are used, and the returned value is a character array 13 bytes in length.
 are used, and the returned value is a character array 13 bytes in length.
-.PP
-The other four functions provide (rather primitive) access to the actual
-DES algorithm.
-The argument to
-.I setkey
-is a character array of length 64 containing only the characters
-with numerical value 0 and 1.
+.Pp
+The
+functions,
+.Fn encrypt ,
+.Fn setkey ,
+.Fn des_setkey
+and
+.Fn des_cipher
+allow limited access to the
+.Tn DES
+algorithm itself.
+The
+.Ar key
+argument to
+.Fn setkey
+is a 64 character array of
+.Tn ASCII
+binary values (0 or 1).
 A 56-bit key is derived from dividing this array by dividing the string
 into groups of 8 and ignoring the last bit in each group.
 A 56-bit key is derived from dividing this array by dividing the string
 into groups of 8 and ignoring the last bit in each group.
-.PP
-The argument to the
-.I encrypt
-entry is likewise a character array of length 64 containing 0's and 1's.
-The argument array is modified in place to a similar array representing
-the bits of the argument after having been subjected to the DES algorithm
-using the key set by
-.IR setkey .
-The
-flag is ignored;
-the argument can only be encrypted.
-.SH "SEE ALSO"
-login(1), passwd(1), getpass(3), passwd(5)
-.sp
-.IR "Mathematical Cryptology for Computer Scientists and Mathematicians" ,
-Wayne Patterson, 1987, ISBN 0-8476-7438-X.
-.sp
-.IR "Password Security: A Case History" ,
-R. Morris and Ken Thompson,
-Communications of the ACM, vol. 22, pp. 594-597, Nov. 1979.
-.sp
-.IR "DES will be Totally Insecure within Ten Years" ,
-M.E. Hellman, IEEE Spectrum, vol. 16, pp. 32-39, July 1979.
-.SH BUGS
+.Fa salt
+specifies perturbations to
+.Tn DES
+as described above.
+.Sh SEE ALSO
+.Xr login 1 ,
+.Xr passwd 1 ,
+.Xr getpass 3 ,
+.Xr passwd 5
+.Rs
+.%T "Mathematical Cryptology for Computer Scientists and Mathematicians"
+.%A Wayne Patterson
+.%D 1987
+.%N ISBN 0-8476-7438-X
+.Re
+.Rs
+.%T "Password Security: A Case History"
+.%A R. Morris
+.%A Ken Thompson
+.%J "Communications of the ACM"
+.%V vol. 22
+.%P pp. 594-597
+.%D Nov. 1979
+.Re
+.Rs
+.%T "DES will be Totally Insecure within Ten Years"
+.%A M.E. Hellman
+.%J "IEEE Spectrum"
+.%V vol. 16
+.%P pp. 32-39
+.%D July 1979
+.Re
+.Sh HISTORY
+A
+.Fn crypt
+function appeared in
+.At v6 .
+.Sh BUGS
 Dropping the
 Dropping the
-.I least
+.Em least
 significant bit in each character of the argument to
 significant bit in each character of the argument to
-.I des_setkey
+.Fn des_setkey
 is ridiculous.
 is ridiculous.
-.PP
-The return value of
-.I crypt
-points to static data whose content is overwritten by each call.
+.Pp
+The
+.Fn crypt
+function leaves its result in an internal static object and returns
+a pointer to that object. Subsequent calls to
+.Fn crypt
+will modify the same object.
index 1a6b1ad..2e98202 100644 (file)
@@ -1,51 +1,67 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ctermid.3   5.1 (Berkeley) %G%
+.\"     @(#)ctermid.3  5.2 (Berkeley) %G%
 .\"
 .\"
-.TH CTERMID 3 ""
-.UC 7
-.SH NAME
-ctermid \- generate terminal pathname
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-.sp
-char *ctermid(char *buf);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt CTERMID 3
+.Os
+.Sh NAME
+.Nm ctermid
+.Nd generate terminal pathname
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft char *
+.Fn ctermid "char *buf"
+.Sh DESCRIPTION
 The
 The
-.I ctermid
+.Fn ctermid
 function generates a string, that, when used as a pathname, refers to
 function generates a string, that, when used as a pathname, refers to
-the current controlling terminal for the current process.
-.PP
+the current controlling terminal of the calling process.
+.Pp
 If
 If
-.I buf
-is a NULL pointer, a pointer to a static area is returned.
+.Ar buf
+is the
+.Dv NULL
+pointer, a pointer to a static area is returned.
 Otherwise, the pathname is copied into the memory referenced by
 Otherwise, the pathname is copied into the memory referenced by
-.IR buf .
-.I Buf
-is assumed to be at least L_ctermid (as defined in the include
-file <stdio.h>) bytes long.
-.PP
-The current implementation simply returns ``/dev/tty''.
-.SH RETURN
-Upon successful completion, a non-NULL pointer is returned.
-Otherwise, a NULL pointer is returned and
-.I errno
+.Ar buf .
+The argument
+.Ar buf
+is assumed to be at least
+.Dv L_ctermid
+(as defined in the include
+file
+.Aq Pa stdio.h )
+bytes long.
+.Pp
+The current implementation simply returns
+.Ql /dev/tty .
+.Sh RETURN VALUES
+Upon successful completion, a
+.Pf non- Dv NULL
+pointer is returned.
+Otherwise, a
+.Dv NULL
+pointer is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
+.Sh ERRORS
 The current implementation detects no error conditions.
 The current implementation detects no error conditions.
-.SH "SEE ALSO"
-ttyname(3)
-.SH STANDARDS
-.I Ctermid
-conforms to IEEE Std 1003.1-1988 (``POSIX'').
-.SH BUGS
-By default, all information is contained in a static buffer which is
-overwritten by each new call.
-It must be copied elsewhere to be retained.
+.Sh SEE ALSO
+.Xr ttyname 3
+.Sh STANDARDS
+The
+.Xr ctermid
+function conforms to
+.St -p1003.1-88 .
+.Sh BUGS
+By default the
+.Fn ctermid
+function
+writes all information to an internal static object.
+Subsequent calls to
+.Fn ctermid
+will modify the same object.
index a87de63..d59bf08 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Arthur Olson.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Arthur Olson.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ctime.3     6.14 (Berkeley) %G%
+.\"     @(#)ctime.3    6.15 (Berkeley) %G%
 .\"
 .\"
-.TH CTIME 3 ""
-.SH NAME
-asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time to ASCII
-.SH SYNOPSIS
-.nf
-.ft B
-extern char *tzname[2];
-
-#include <sys/types.h>
-
-char *ctime(time_t *clock);
-
-double difftime(time_t time1, time_t time0);
-
-#include <time.h>
-
-char *asctime(struct tm *tm);
-
-struct tm *localtime(long *clock);
-
-struct tm *gmtime(long *clock);
-
-time_t mktime(struct tm *tm);
-.ft R
-.fi
-.SH DESCRIPTION
-.IR Ctime ,
-.I gmtime
+.Dd 
+.Dt CTIME 3
+.Os BSD 4.3
+.Sh NAME
+.Nm asctime ,
+.Nm ctime ,
+.Nm difftime ,
+.Nm gmtime ,
+.Nm localtime ,
+.Nm mktime
+.Nd transform binary date and time value to
+.Tn ASCII
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Vt extern char *tzname[2];
+.Ft char *
+.Fn ctime "const time_t *clock"
+.Ft double
+.Fn difftime "time_t time1" "time_t time0"
+.Fd #include <time.h>
+.Ft char *
+.Fn asctime "const struct tm *tm"
+.Ft struct tm *
+.Fn localtime "const time_t *clock"
+.Ft struct tm *
+.Fn gmtime "const time_t *clock"
+.Ft time_t
+.Fn mktime "struct tm *tm"
+.Sh DESCRIPTION
+The functions
+.Fn ctime ,
+.Fn gmtime
 and
 and
-.I localtime
+.Fn localtime
 all take as an argument a time value representing the time in seconds since
 all take as an argument a time value representing the time in seconds since
-the Epoch (00:00:00 UTC, January 1, 1970; see
-.IR time (3)).
-.PP
-.I Localtime
+the Epoch (00:00:00
+.Tn UTC ,
+January 1, 1970; see
+.Xr time 3 ) .
+.Pp
+The function
+.Fn localtime
 converts the time value pointed at by
 converts the time value pointed at by
-.IR clock ,
-and returns a pointer to a ``struct tm'' (described below) which contains
+.Fa clock ,
+and returns a pointer to a
+.Dq Fa struct tm
+(described below) which contains
 the broken-out time information for the value after adjusting for the current
 time zone (and any other factors such as Daylight Saving Time).
 Time zone adjustments are performed as specified by the
 the broken-out time information for the value after adjusting for the current
 time zone (and any other factors such as Daylight Saving Time).
 Time zone adjustments are performed as specified by the
-.B TZ
+.Ev TZ
 environmental variable (see
 environmental variable (see
-.IR tzset (3)).
-.I Localtime 
+.Xr tzset 3 ) .
+The function
+.Fn localtime
 uses
 uses
-.I tzset
+.Xr tzset
 to initialize time conversion information if
 to initialize time conversion information if
-.I tzset
+.Xr tzset
 has not already been called by the process.
 has not already been called by the process.
-.PP
+.Pp
 After filling in the tm structure,
 After filling in the tm structure,
-.I localtime
+.Fn localtime
 sets the
 sets the
-.BR tm_isdst 'th
+.Fa tm_isdst Ns 'th
 element of
 element of
-.B tzname
-to a pointer to an ASCII string that's the time zone abbreviation to be
+.Fa tzname
+to a pointer to an
+.Tn ASCII
+string that's the time zone abbreviation to be
 used with
 used with
-.IR localtime 's
+.Fn localtime Ns 's
 return value.
 return value.
-.PP
-.I Gmtime
+.Pp
+The function
+.Fn gmtime
 similarly converts the time value, but without any time zone adjustment,
 and returns a pointer to a tm structure (described below).
 similarly converts the time value, but without any time zone adjustment,
 and returns a pointer to a tm structure (described below).
-.PP
-.I Ctime
+.Pp
+The
+.Fn ctime
+function
 adjusts the time value for the current time zone in the same manner as
 adjusts the time value for the current time zone in the same manner as
-.IR localtime ,
+.Fn localtime ,
 and returns a pointer to a 26-character string of the form:
 and returns a pointer to a 26-character string of the form:
-.sp
-.RS
+.Bd -literal -offset indent
 Thu Nov 24 18:22:48 1986\en\e0
 Thu Nov 24 18:22:48 1986\en\e0
-.RE
-.sp
+.Ed
+.Pp
 All the fields have constant width.
 All the fields have constant width.
-.PP
-.I Asctime
-converts a time value contained in a tm structure to a 26-character
-string, as shown in the above example, and returns a pointer to the string.
-.PP
-.I Mktime
+.Pp
+The
+.Fn asctime
+function
+converts the broken down time in the structure
+.Fa tm
+pointed at by
+.Fa *tm
+to the form
+shown in the example above.
+.Pp
+The function
+.Fn mktime
 converts the broken-down time, expressed as local time, in the structure
 pointed to by tm into a time value with the same encoding as that of the
 values returned by the
 converts the broken-down time, expressed as local time, in the structure
 pointed to by tm into a time value with the same encoding as that of the
 values returned by the
-.IR time (3)
-function, that is, seconds from the Epoch, UTC.
-.PP
+.Xr time 3
+function, that is, seconds from the Epoch,
+.Tn UTC .
+.Pp
 The original values of the
 The original values of the
-.B tm_wday
+.Fa tm_wday
 and
 and
-.B tm_yday
+.Fa tm_yday
 components of the structure are ignored, and the original values of the
 other components are not restricted to their normal ranges.
 (A positive or zero value for
 components of the structure are ignored, and the original values of the
 other components are not restricted to their normal ranges.
 (A positive or zero value for
-.B tm_isdst
+.Fa tm_isdst
 causes
 causes
-.I mktime
+.Fn mktime
 to presume initially that summer time (for example, Daylight Saving Time)
 is or is not in effect for the specified time, respectively.
 A negative value for
 to presume initially that summer time (for example, Daylight Saving Time)
 is or is not in effect for the specified time, respectively.
 A negative value for
-.B tm_isdst
+.Fa tm_isdst
 causes the
 causes the
-.I mktime
+.Fn mktime
 function to attempt to divine whether summer time is in effect for the
 specified time.)
 function to attempt to divine whether summer time is in effect for the
 specified time.)
-.PP
+.Pp
 On successful completion, the values of the
 On successful completion, the values of the
-.B tm_wday
+.Fa tm_wday
 and
 and
-.B tm_yday
+.Fa tm_yday
 components of the structure are set appropriately, and the other components
 are set to represent the specified calendar time, but with their values
 forced to their normal ranges; the final value of
 components of the structure are set appropriately, and the other components
 are set to represent the specified calendar time, but with their values
 forced to their normal ranges; the final value of
-.B tm_mday
+.Fa tm_mday
 is not set until
 is not set until
-.B tm_mon
+.Fa tm_mon
 and
 and
-.B tm_year
+.Fa tm_year
 are determined.
 are determined.
-.I Mktime
+.Fn Mktime
 returns the specified calendar time; if the calendar time cannot be
 returns the specified calendar time; if the calendar time cannot be
-represented, it returns
-.BR -1 .
-.PP
-.I Difftime
+represented, it returns \-1;
+.Pp
+The
+.Fn difftime
+function
 returns the difference between two calendar times,
 returns the difference between two calendar times,
-.RI ( time1
+.Pf ( Fa time1
 -
 -
-.IR time0 ),
+.Fa time0 ) ,
 expressed in seconds.
 expressed in seconds.
-.PP
+.Pp
 External declarations as well as the tm structure definition are in the 
 External declarations as well as the tm structure definition are in the 
-``<time.h>'' include file.
+.Aq Pa time.h
+include file.
 The tm structure includes at least the following fields:
 The tm structure includes at least the following fields:
-.sp
-.RS
-.nf
-.ta .5i +\w'long tm_gmtoff;\0\0'u
+.Bd -literal -offset indent
 int tm_sec;    /\(** seconds (0 - 60) \(**/
 int tm_min;    /\(** minutes (0 - 59) \(**/
 int tm_hour;   /\(** hours (0 - 23) \(**/
 int tm_sec;    /\(** seconds (0 - 60) \(**/
 int tm_min;    /\(** minutes (0 - 59) \(**/
 int tm_hour;   /\(** hours (0 - 23) \(**/
@@ -158,40 +178,55 @@ int tm_yday;      /\(** day of year (0 - 365) \(**/
 int tm_isdst;  /\(** is summer time in effect? \(**/
 char \(**tm_zone;      /\(** abbreviation of timezone name \(**/
 long tm_gmtoff;        /\(** offset from UTC in seconds \(**/
 int tm_isdst;  /\(** is summer time in effect? \(**/
 char \(**tm_zone;      /\(** abbreviation of timezone name \(**/
 long tm_gmtoff;        /\(** offset from UTC in seconds \(**/
-.fi
-.RE
-.PP
-.I Tm_isdst
+.Ed
+.Pp
+The
+field
+.Fa tm_isdst
 is non-zero if summer time is in effect.
 is non-zero if summer time is in effect.
-.PP
-.I Tm_gmtoff
-is the offset (in seconds) of the time represented from UTC, with positive
+.Pp
+The field
+.Fa tm_gmtoff
+is the offset (in seconds) of the time represented from
+.Tn UTC ,
+with positive
 values indicating east of the Prime Meridian.
 values indicating east of the Prime Meridian.
-.SH SEE ALSO
-date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5)
-.SH BUGS
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr gettimeofday 2 ,
+.Xr getenv 3 ,
+.Xr time 3 ,
+.Xr tzset 3 ,
+.Xr tzfile 5
+.Sh HISTORY
+This manual page is derived from
+the time package contributed to Berkeley by
+Arthur Olsen and which appeared in
+.Bx 4.3 .
+.Sh BUGS
 Except for 
 Except for 
-.I difftime 
+.Fn difftime
 and
 and
-.IR mktime ,
-these routines all return pointers to static data whose content is
-overwritten by each call.
-.PP
+.Fn mktime ,
+these functions leaves their result in an internal static object and return
+a pointer to that object. Subsequent calls to these
+function will modify the same object.
+.Pp
 The
 The
-.B tm_zone
+.Fa tm_zone
 field of a returned tm structure points to a static array of characters,
 which will also be overwritten by any subsequent calls (as well as by
 subsequent calls to
 field of a returned tm structure points to a static array of characters,
 which will also be overwritten by any subsequent calls (as well as by
 subsequent calls to
-.IR tzset (3)
+.Xr tzset 3
 and
 and
-.IR tzsetwall (3)).
-.PP
+.Xr tzsetwall 3 ) .
+.Pp
 Use of the external variable
 Use of the external variable
-.B tzname
+.Fa tzname
 is discouraged; the
 is discouraged; the
-.B tm_zone 
+.Fa tm_zone
 entry in the tm structure is preferred.
 entry in the tm structure is preferred.
-.PP
+.Pp
 Avoid using out-of-range values with
 Avoid using out-of-range values with
-.I mktime
+.Fn mktime
 when setting up lunch with promptness sticklers in Riyadh.
 when setting up lunch with promptness sticklers in Riyadh.
index c863ea8..606d301 100644 (file)
-.\" Copyright (c) 1983 Regents of the University of California.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)directory.3 6.6 (Berkeley) %G%
+.\"     @(#)directory.3        6.7 (Berkeley) %G%
 .\"
 .\"
-.TH DIRECTORY 3 ""
-.UC 5
-.SH NAME
-opendir, readdir, telldir, seekdir, rewinddir, closedir, dirfd \- directory operations
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <dirent.h>
-
-DIR *
-opendir(const char *filename);
-
-struct direct
-*readdir(DIR * dirp);
-
-long
-telldir(const DIR *dirp);
-
-void
-seekdir(DIR *dirp, long loc);
-
-void
-rewinddir(DIR *dirp);
-
-int
-closedir(DIR *dirp);
-
-int
-dirfd(DIR *dirp)
-.ft R
-.fi
-.SH DESCRIPTION
-.I Opendir
+.Dd 
+.Dt DIRECTORY 3
+.Os BSD 4.2
+.Sh NAME
+.Nm opendir ,
+.Nm readdir ,
+.Nm telldir ,
+.Nm seekdir ,
+.Nm rewinddir ,
+.Nm closedir ,
+.Nm dirfd
+.Nd directory operations
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <dirent.h>
+.Ft DIR *
+.Fn opendir "const char *filename"
+.Ft struct direct
+.Fn readdir "DIR *dirp"
+.Ft long
+.Fn telldir "const DIR *dirp"
+.Ft void
+.Fn seekdir "DIR *dirp" "long  loc"
+.Ft void
+.Fn rewinddir "DIR *dirp"
+.Ft int
+.Fn closedir "DIR *dirp"
+.Ft int
+.Fn dirfd "DIR *dirp"
+.Sh DESCRIPTION
+The
+.Fn opendir
+function
 opens the directory named by
 opens the directory named by
-.I filename
-and associates a
-.I directory stream
-with it.
-.I Opendir
+.Fa filename ,
+associates a
+.Em directory stream
+with it
+and
 returns a pointer to be used to identify the
 returns a pointer to be used to identify the
-.I directory stream
+.Em directory stream
 in subsequent operations.  The pointer
 in subsequent operations.  The pointer
-.SM
-.B NULL
+.Dv NULL
 is returned if
 is returned if
-.I filename
+.Fa filename
 cannot be accessed, or if it cannot
 cannot be accessed, or if it cannot
-.IR malloc (3)
+.Xr malloc 3
 enough memory to hold the whole thing.
 enough memory to hold the whole thing.
-.PP
-.I Readdir
+.Pp
+The
+.Fn readdir
+function
 returns a pointer to the next directory entry.  It returns
 returns a pointer to the next directory entry.  It returns
-.B NULL
+.Dv NULL
 upon reaching the end of the directory or detecting an invalid
 upon reaching the end of the directory or detecting an invalid
-.I seekdir
+.Fn seekdir
 operation.
 operation.
-.PP
-.I Telldir
+.Pp
+The
+.Fn telldir
+function
 returns the current location associated with the named
 returns the current location associated with the named
-.I directory stream.
-.PP
-.I Seekdir
+.Em directory stream .
+.Pp
+The
+.Fn seekdir
+function
 sets the position of the next
 sets the position of the next
-.I readdir
+.Fn readdir
 operation on the
 operation on the
-.I directory stream.
+.Em directory stream .
 The new position reverts to the one associated with the
 The new position reverts to the one associated with the
-.I directory stream
+.Em directory stream
 when the
 when the
-.I telldir
+.Fn telldir
 operation was performed.  Values returned by
 operation was performed.  Values returned by
-.I telldir
-are good only for the lifetime of the DIR pointer from which they are derived.
+.Fn telldir
+are good only for the lifetime of the
+.Dv DIR
+pointer,
+.Fa dirp ,
+from which they are derived.
 If the directory is closed and then reopened, the 
 If the directory is closed and then reopened, the 
-.I telldir
+.Fn telldir
 value may be invalidated due to undetected directory compaction.
 It is safe to use a previous
 value may be invalidated due to undetected directory compaction.
 It is safe to use a previous
-.I telldir
+.Fn telldir
 value immediately after a call to
 value immediately after a call to
-.I opendir
+.Fn opendir
 and before any calls to
 and before any calls to
-.I readdir.
-.PP
-.I Rewinddir
+.Fn readdir .
+.Pp
+The
+.Fn rewinddir
+function
 resets the position of the named
 resets the position of the named
-.I directory stream
+.Em directory stream
 to the beginning of the directory.
 to the beginning of the directory.
-.PP
-.I Closedir
+.Pp
+The
+.Fn closedir
+function
 closes the named
 closes the named
-.I directory stream
-and frees the structure associated with the DIR pointer,
+.Em directory stream
+and frees the structure associated with the
+.Fa dirp
+pointer,
 returning 0 on success.
 returning 0 on success.
-On failure, -1 is returned and errno is set to indicate the error.
-.PP
-.I Dirfd
+On failure, \-1 is returned and the global variable
+.Va errno
+is set to indicate the error.
+.Pp
+The
+.Fn dirfd
+function
 returns the integer file descriptor associated with the named
 returns the integer file descriptor associated with the named
-.I directory stream,
-see open(2).
-.PP
+.Em directory stream ,
+see
+.Xr open 2 .
+.Pp
 Sample code which searchs a directory for entry ``name'' is:
 Sample code which searchs a directory for entry ``name'' is:
-.PP
-.nf
-.RS
+.Bd -literal -offset indent
 len = strlen(name);
 dirp = opendir(".");
 for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
 len = strlen(name);
 dirp = opendir(".");
 for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
@@ -119,7 +136,22 @@ for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
        }
 (void)closedir(dirp);
 return NOT_FOUND;
        }
 (void)closedir(dirp);
 return NOT_FOUND;
-.RE
-.fi
-.SH "SEE ALSO"
-open(2), close(2), read(2), lseek(2), dir(5)
+.Ed
+.Sh SEE ALSO
+.Xr open 2 ,
+.Xr close 2 ,
+.Xr read 2 ,
+.Xr lseek 2 ,
+.Xr dir 5
+.Sh HISTORY
+The
+.Fn opendir ,
+.Fn readdir ,
+.Fn telldir ,
+.Fn seekdir ,
+.Fn rewinddir ,
+.Fn closedir ,
+and
+.Fn dirfd
+functions appeared in
+.Bx 4.2 .
index 5733b65..2552b77 100644 (file)
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)exec.3      6.3 (Berkeley) %G%
+.\"     @(#)exec.3     6.4 (Berkeley) %G%
 .\"
 .\"
-.TH EXEC 3 ""
-.UC 5
-.SH NAME
-execl, execlp, execle, exect, execv, execvp \- execute a file
-.SH SYNOPSIS
-.nf
-.ft B
-extern char **environ;
-.sp
-execl(const char *path, const char *arg, ...);
-execlp(const char *file, const char *arg, ...);
-execle(const char *path, const char *arg, ...,
-.ti +5
-char *const envp[]);
-exect(const char *path, char *const argv[],
-.ti +5
-char *const envp[]);
-execv(const char *path, char *const argv[]);
-execvp(const char *file, char *const argv[]);
-.ft R
-.fi
-.SH DESCRIPTION
-The exec family of functions replaces the current process image with a
+.Dd 
+.Dt EXEC 3
+.Os
+.Sh NAME
+.Nm execl ,
+.Nm execlp ,
+.Nm execle ,
+.Nm exect ,
+.Nm execv ,
+.Nm execvp
+.Nd execute a file
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Vt extern char **environ;
+.Ft int
+.Fn execl "const char *path" "const char *arg" ...
+.Ft int
+.Fn execlp "const char *file" "const char *arg" ...
+.Ft int
+.Fn execle "const char *path" "const char *arg" ... "char *const envp[]"
+.Ft int
+.Fn exect "const char *path" "char *const argv[]" 
+.Ft int
+.Fn execv "const char *path" "char *const argv[]"
+.Ft int
+.Fn execvp "const char *file" "char *const argv[]"
+.Sh DESCRIPTION
+The
+.Nm exec
+family of functions replaces the current process image with a
 new process image.
 The functions described in this manual page are front-ends for the function
 new process image.
 The functions described in this manual page are front-ends for the function
-.IR execve (2).
+.Xr execve 2 .
 (See the manual page for
 (See the manual page for
-.I execve
+.Xr execve
 for detailed information about the replacement of the current process.)
 for detailed information about the replacement of the current process.)
-.PP
+.Pp
 The initial argument for these functions is the pathname of a file which
 is to be executed.
 The initial argument for these functions is the pathname of a file which
 is to be executed.
-.PP
-The ``const char *arg'' and subsequent ellipses in the
-.IR execl ,
-.IR execlp ,
+.Pp
+The
+.Fa "const char *arg"
+and subsequent ellipses in the
+.Fn execl ,
+.Fn execlp ,
 and
 and
-.I execle
+.Fn execle
 functions can be thought of as
 functions can be thought of as
-.IR arg0 ,
-.IR arg1 ,
+.Em arg0 ,
+.Em arg1 ,
 \&...,
 \&...,
-.IR argn .
+.Em argn .
 Together they describe a list of one or more pointers to null-terminated
 strings that represent the argument list available to the executed program.
 The first argument, by convention, should point to the file name associated
 with the file being executed.
 The list of arguments
 Together they describe a list of one or more pointers to null-terminated
 strings that represent the argument list available to the executed program.
 The first argument, by convention, should point to the file name associated
 with the file being executed.
 The list of arguments
-.B must
-be terminated by a NULL pointer.
-.PP
+.Em must
+be terminated by a
+.Dv NULL
+pointer.
+.Pp
 The
 The
-.IR exect ,
-.IR execv ,
+.Fn exect ,
+.Fn execv ,
 and
 and
-.I execvp
+.Fn execvp
 functions provide an array of pointers to null-terminated strings that
 represent the argument list available to the new program.
 The first argument, by convention, should point to the file name associated
 with the file begin executed.
 The array of pointers
 functions provide an array of pointers to null-terminated strings that
 represent the argument list available to the new program.
 The first argument, by convention, should point to the file name associated
 with the file begin executed.
 The array of pointers
-.B must
-be terminated by a NULL pointer.
-.PP
+.Sy must
+be terminated by a
+.Dv NULL
+pointer.
+.Pp
 The
 The
-.I execle
+.Fn execle
 and
 and
-.I exect
+.Fn exect
 functions also specify the environment of the executed process by following
 functions also specify the environment of the executed process by following
-the NULL pointer that terminates the list of arguments in the parameter list
+the
+.Dv NULL
+pointer that terminates the list of arguments in the parameter list
 or the pointer to the argv array with an additional parameter.
 This additional parameter is an array of pointers to null-terminated strings
 and
 or the pointer to the argv array with an additional parameter.
 This additional parameter is an array of pointers to null-terminated strings
 and
-.B must
-be terminated by a NULL pointer.
+.Em must
+be terminated by a
+.Dv NULL
+pointer.
 The other functions take the environment for the new process image from the
 external variable
 The other functions take the environment for the new process image from the
 external variable
-.I environ
+.Va environ
 in the current process.
 in the current process.
-.PP
+.Pp
 Some of these functions have special semantics.
 Some of these functions have special semantics.
-.PP
+.Pp
 The functions
 The functions
-.I execlp
+.Fn execlp
 and
 and
-.I execvp
+.Fn execvp
 will duplicate the actions of the shell in searching for an executable file
 will duplicate the actions of the shell in searching for an executable file
-if the specified file name does not contain a slash (``/'') character.
-The search path is the path specified in the environment by ``PATH'' variable.
-If this variable isn't specified, the default path ``/bin:/usr/bin:'' is
+if the specified file name does not contain a slash
+.Dq Li /
+character.
+The search path is the path specified in the environment by
+.Dq Ev PATH
+variable.
+If this variable isn't specified, the default path
+.Dq Ev /bin:/usr/bin:
+is
 used.
 In addtion, certain errors are treated specially.
 used.
 In addtion, certain errors are treated specially.
-.PP
+.Pp
 If permission is denied for a file (the attempted
 If permission is denied for a file (the attempted
-.I execve
-returned EACCES), these functions will continue searching the rest of
+.Xr execve
+returned
+.Er EACCES ) ,
+these functions will continue searching the rest of
 the search path.
 the search path.
-If no other file is found, however, they will return with
-.I errno
-set to EACCES.
-.PP
+If no other file is found, however, they will return with the global variable
+.Va errno
+set to
+.Er EACCES .
+.Pp
 If the header of a file isn't recognized (the attempted
 If the header of a file isn't recognized (the attempted
-.I execve
-returned ENOEXEC), these functions will execute the shell with the path of
+.Xr execve
+returned
+.Er ENOEXEC ) ,
+these functions will execute the shell with the path of
 the file as its first argument.
 (If this attempt fails, no further searching is done.)
 the file as its first argument.
 (If this attempt fails, no further searching is done.)
-.PP
+.Pp
 If the file is currently busy (the attempted
 If the file is currently busy (the attempted
-.I execve
-returned ETXTBUSY), these functions will sleep for several seconds,
+.Xr execve
+returned
+.Er ETXTBUSY ) ,
+these functions will sleep for several seconds,
 periodically re-attempting to execute the file.
 periodically re-attempting to execute the file.
-.PP
+.Pp
 The function
 The function
-.I exect
+.Fn exect
 executes a file with the program tracing facilities enabled (see
 executes a file with the program tracing facilities enabled (see
-.IR ptrace (2)).
-.SH "RETURN VALUE"
+.Xr ptrace 2 ) .
+.Sh RETURN VALUES
 If any of the
 If any of the
-.I exec
+.Xr exec
 functions returns, an error will have occurred.
 functions returns, an error will have occurred.
-The return value is -1, and
-.I errno
+The return value is \-1, and the global variable
+.Va errno
 will be set to indicate the error.
 will be set to indicate the error.
-.SH ERRORS
-.IR Execl ,
-.IR execle ,
-.I execlp
+.Sh FILES
+.Bl -tag -width /bin/sh - compact
+.It Pa /bin/sh
+The shell.
+.El
+.Sh ERRORS
+.Fn Execl ,
+.Fn execle ,
+.Fn execlp
 and
 and
-.I execvp
+.Fn execvp
 may fail and set
 may fail and set
-.I errno
+.Va errno
 for any of the errors specified for the library functions
 for any of the errors specified for the library functions
-.IR execve (2)
+.Xr execve 2
 and
 and
-.IR malloc (3).
-.PP
-.I Exect
+.Xr malloc 3 .
+.Pp
+.Fn Exect
 and
 and
-.I execv
+.Fn execv
 may fail and set
 may fail and set
-.I errno
+.Va errno
 for any of the errors specified for the library function
 for any of the errors specified for the library function
-.IR execve (2).
-.SH FILES
-/bin/sh                The shell.
-.SH "SEE ALSO"
-sh(1), execve(2), fork(2),  ptrace(2), environ(7),
-.SH COMPATIBILITY
+.Xr execve 2 .
+.Sh SEE ALSO
+.Xr sh 1 ,
+.Xr execve 2 ,
+.Xr fork 2 ,
+.Xr trace 2 ,
+.Xr environ 7 ,
+.Xr ptrace 2 ,
+.Xr environ 7 ,
+.Sh COMPATIBILITY
 Historically, the default path for the
 Historically, the default path for the
-.I execlp
+.Fn execlp
 and
 and
-.I execvp
-functions was ``:/bin:/usr/bin''.
+.Fn execvp
+functions was
+.Dq Pa :/bin:/usr/bin .
 This was changed to place the current directory last to enhance system
 security.
 This was changed to place the current directory last to enhance system
 security.
-.PP
+.Pp
 The behavior of
 The behavior of
-.I execlp
+.Fn execlp
 and
 and
-.I execvp
+.Fn execvp
 when errors occur while attempting to execute the file is historic
 practice, but has not traditionally been documented and is not specified
 when errors occur while attempting to execute the file is historic
 practice, but has not traditionally been documented and is not specified
-by the POSIX standard.
-.PP
+by the
+.Tn POSIX
+standard.
+.Pp
 Traditionally, the functions
 Traditionally, the functions
-.I execlp
+.Fn execlp
+and
+.Fn execvp
+ignored all errors except for the ones described above and
+.Er ENOMEM
 and
 and
-.I execvp
-ignored all errors except for the ones described above and ENOMEM and
-E2BIG, upon which they returned.
+.Er E2BIG ,
+upon which they returned.
 They now return if any error other than the ones described above occurs.
 They now return if any error other than the ones described above occurs.
-.SH STANDARDS
-.IR Execl ,
-.IR execv ,
-.IR execle ,
-.IR execlp
+.Sh STANDARDS
+.Fn Execl ,
+.Fn execv ,
+.Fn execle ,
+.Fn execlp
 and
 and
-.I execvp
-conform to IEEE Std 1003.1-1988 (``POSIX'').
+.Fn execvp
+conform to
+.St -p1003.1-88 .
index 43de144..436baa2 100644 (file)
@@ -1,72 +1,87 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Guido van Rossum.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Guido van Rossum.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fnmatch.3   5.2 (Berkeley) %G%
+.\"     @(#)fnmatch.3  5.3 (Berkeley) %G%
 .\"
 .\"
-.TH FNMATCH 3 ""
-.UC 7
-.SH NAME
-fnmatch \- match filename or pathname
-.SH SYNOPSIS
-.nf
-#include <unistd.h>
-
-int fnmatch(const char *pattern, const char *string, int flags);
-.fi
-.SH DESCRIPTION
-.I Fnmatch
+.Dd 
+.Dt FNMATCH 3
+.Os
+.Sh NAME
+.Nm fnmatch
+.Nd match filename or pathname
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn fnmatch "const char *pattern" "const char *string" "int flags"
+.Sh DESCRIPTION
+The
+.Fn fnmatch
+function
 matches patterns according to the rules used by the shell.
 It checks the string specified by the
 matches patterns according to the rules used by the shell.
 It checks the string specified by the
-.I string
+.Fa string
 argument to see if it matches the pattern specified by the
 argument to see if it matches the pattern specified by the
-.I pattern
+.Fa pattern
 argument.
 argument.
-.PP
+.Pp
 The
 The
-.I flags
+.Fa flags
 argument modifies the interpretation of
 argument modifies the interpretation of
-.I pattern
+.Fa pattern
 and
 and
-.I string.
+.Fa string .
 The value of
 The value of
-.I flags
-is the bitwise inclusive OR of any of the following
+.Fa flags
+is the bitwise inclusive
+.Tn OR
+of any of the following
 constants, which are defined in the include file
 constants, which are defined in the include file
-.IR unistd.h .
-.TP
-FNM_PATHNAME
+.Pa unistd.h .
+.Bl -tag -width FNM_PATHNAME
+.It Dv FNM_PATHNAME
 Slash characters in
 Slash characters in
-.I string
+.Fa string
 must be explicitly matched by slashes in
 must be explicitly matched by slashes in
-.IR pattern .
+.Fa pattern .
 If this flag is not set, then slashes are treated as regular characters.
 If this flag is not set, then slashes are treated as regular characters.
-.TP
-FNM_QUOTE
-Every occurrence of a backslash (``\e'') followed by a character in
-.I pattern
+.It Dv FNM_QUOTE
+Every occurrence of a backslash
+.Pq Ql \e
+followed by a character in
+.Fa pattern
 is replaced by that character.
 This is done to negate any special meaning for the character.
 is replaced by that character.
 This is done to negate any special meaning for the character.
-.SH RETURNS
+.El
+.Sh RETURN VALUES
 If
 If
-.I string
+.Fa string
 matches the pattern specified by
 matches the pattern specified by
-.IR pattern ,
+.Fa pattern ,
 then
 then
-.I fnmatch
+.Fn fnmatch
 returns zero.
 Otherwise,
 returns zero.
 Otherwise,
-.I fnmatch
+.Fn fnmatch
 returns nonzero.
 returns nonzero.
-.SH SEE ALSO
-sh(1), glob(3), wordexp(3), regexp(3)
-.SH BUGS
+.Sh SEE ALSO
+.Xr sh 1 ,
+.Xr glob 3 ,
+.Xr wordexp 3 ,
+.Xr regexp 3
+.Sh HISTORY
+The
+.Fn fnmatch
+function is
+.Ud .
+.Sh BUGS
 Quotes and slashes in range patterns are not handled correctly.
 Quotes and slashes in range patterns are not handled correctly.
-.PP
-The pattern ``*'' matches the empty string, even if
-.I FNM_PATHNAME
+.Pp
+The pattern
+.Ql *
+matches the empty string, even if
+.Dv FNM_PATHNAME
 is specified.
 is specified.
index 147d1ad..1d43d36 100644 (file)
@@ -1,37 +1,55 @@
-.\"    @(#)frexp.3     6.3 (Berkeley) %G%
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH FREXP 3 ""
-.AT 3
-.SH NAME
-frexp, ldexp, modf \- split into mantissa and exponent
-.SH SYNOPSIS
-.nf
-.B double frexp(value, eptr)
-.B double value;
-.B int *eptr;
-.PP
-.B double ldexp(value, exp)
-.B double value;
-.PP
-.B double modf(value, iptr)
-.B double value, *iptr;
-.SH DESCRIPTION
-Every nonzero number can be written uniquely as
-.if t \fIx\fP\|\(**\|2\u\fIn\fP\d,
-.if n \fIx\fP * 2^\fIn\fP,
-where the ``mantissa'' (fraction) \fIx\fP is in the range 0.5 <= |x| < 1.0,
-and the ``exponent'' \fIn\fP is an integer.  \fIFrexp\fP returns the
-mantissa of a double \fIvalue\fP, and stores the exponent indirectly in
-the location pointed to by \fIeptr\fP.  If \fIvalue\fP is 0, both results
-returned by \fIfrexp\fP are 0.
-.PP
-\fILdexp\fP returns the quantity
-.if t \fIvalue\|\(**\|2\u\fIexp\fP\d.
-.if n \fIvalue\fP * 2^\fIexp\fP.
-.PP
-\fIModf\fP returns the signed fractional part of \fIvalue\fP
-and stores the integer part indirectly in the location pointed
-to by \fIiptr\fP.
-.SH DIAGNOSTICS
-If \fIldexp\fP would cause overflow, \fBHUGE\fP is returned
-and \fIerrno\fP is set to \fBERANGE\fP.
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)frexp.3    6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt FREXP 3
+.Os
+.Sh NAME
+.Nm frexp
+.Nd convert floating-point number to fractional and integral components
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn frexp "double value" "int *exp"
+.Sh DESCRIPTION
+The
+.Fn frexp
+function breaks a floating-point number into a normalized
+fraction and an integral power of 2.
+It stores the integer in the
+.Em int
+object pointed to by
+.Fa exp .
+.Sh RETURN VALUES
+The
+.Fn frexp
+function returns the value
+.Em x ,
+such that
+.Em x
+is a 
+.Em double
+with magnitude in the interval
+.Bq 1/2 , 1
+or zero, and
+.Fa value
+equals
+.Em x
+times 2 raised to the power
+.Fa *exp .
+If
+.Fa value
+is zero, both parts of the result are zero. 
+.Sh SEE ALSO
+.Xr ldexp 3 ,
+.Xr modf 3 ,
+.Xr math 3
+.Sh STANDARDS
+The
+.Fn frexp
+function conforms to
+.St -ansiC .
index d53e5ba..3cf215c 100644 (file)
@@ -1,53 +1,49 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fts.3       5.9 (Berkeley) %G%
+.\"     @(#)fts.3      5.10 (Berkeley) %G%
 .\"
 .\"
-.TH FTS 3 ""
-.UC 7
-.SH NAME
-fts \- traverse a file hierarchy
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fts.h>
-
-FTS *fts_open(char * const *path_argv, int options,
-.ti +5
-int *compar(const FTSENT *, const FTSENT *));
-
-FTSENT *
-fts_read(FTS *ftsp);
-
-FTSENT *
-fts_children(FTS *ftsp);
-
-fts_set(FTS ftsp, FTSENT *f, int options);
-
-fts_close(FTS *ftsp);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt FTS 3
+.Os
+.Sh NAME
+.Nm fts
+.Nd traverse a file hierarchy
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/stat.h>
+.Fd #include <fts.h>
+.Ft FTS *
+.Fn fts_open "char * const *path_argv" "int options" "int *compar(const FTSENT *, const FTSENT *)"
+.Ft FTSENT *
+.Fn fts_read "FTS *ftsp"
+.Ft FTSENT *
+.Fn fts_children "FTS *ftsp"
+.Ft int
+.Fn fts_set "FTS ftsp" "FTSENT *f" "int options"
+.Ft int
+.Fn fts_close "FTS *ftsp"
+.Sh DESCRIPTION
 The
 The
-.IR fts (3)
-functions are provided for traversing UNIX file hierarchies.
-.PP
+.Nm fts
+functions are provided for traversing
+.Tn UNIX
+file hierarchies.
+.Pp
 The simple overview is that the
 The simple overview is that the
-.I fts_open
+.Fn fts_open
 function returns a ``handle'' on a file hierarchy, which is supplied to
 the other
 function returns a ``handle'' on a file hierarchy, which is supplied to
 the other
-.I fts
+.Nm fts
 functions to determine which hierarchy they operate on.
 The function
 functions to determine which hierarchy they operate on.
 The function
-.I fts_read
+.Fn fts_read
 returns a pointer to a structure describing one of the files in the file
 hierarchy.
 The function
 returns a pointer to a structure describing one of the files in the file
 hierarchy.
 The function
-.I fts_children
+.Fn fts_children
 returns a pointer to a linked list of structures, each of which describes
 one of the files contained in a directory in the hierarchy.
 In general, directories are visited two distinguishable times; in pre-order
 returns a pointer to a linked list of structures, each of which describes
 one of the files contained in a directory in the hierarchy.
 In general, directories are visited two distinguishable times; in pre-order
@@ -57,318 +53,373 @@ Files are visited once.
 It is possible to walk the hierarchy ``logically'' (ignoring symbolic links)
 or physically (visiting symbolic links), order the walk of the hierarchy or
 prune and/or re-visit portions of the hierarchy.
 It is possible to walk the hierarchy ``logically'' (ignoring symbolic links)
 or physically (visiting symbolic links), order the walk of the hierarchy or
 prune and/or re-visit portions of the hierarchy.
-.PP
-Two structures are defined (and typedef'd) in the include file <fts.h>.
-The first is FTS, the structure that represents the file hierarchy stream.
-The second is FTSENT, the structure that represents a file in the file
+.Pp
+Two structures are defined (and typedef'd) in the include file
+.Aq Pa fts.h .
+The first is
+.Fa FTS ,
+the structure that represents the file hierarchy stream.
+The second is
+.Fa FTSENT ,
+the structure that represents a file in the file
 hierarchy.
 hierarchy.
-Normally, an FTSENT structure is returned for every file in the file
+Normally, an
+.Fa FTSENT
+structure is returned for every file in the file
 hierarchy.
 hierarchy.
-In this manual page, ``file'' and ``FTSENT structure'' are generally
+In this manual page, ``file'' and
+.Dq Fa FTSENT No structure
+are generally
 interchangeable.
 interchangeable.
-The FTSENT structure contains at least the following fields, which are
+The
+.Fa FTSENT
+structure contains at least the following fields, which are
 described in greater detail below:
 described in greater detail below:
-.sp
-.nf
-.ta .5i +.5i +\w'struct ftsent *parent;\0\0\0'u
+.Bd -literal -offset indent
 typedef struct _ftsent {
 typedef struct _ftsent {
-       u_short fts_info;                       /* flags for FTSENT structure */
-       char *fts_accpath;                      /* access path */
+       u_short fts_info;               /* flags for FTSENT structure */
+       char *fts_accpath;              /* access path */
        char *fts_path;                 /* root path */
        char *fts_path;                 /* root path */
-       short fts_pathlen;                      /* strlen(fts_path) */
+       short fts_pathlen;              /* strlen(fts_path) */
        char *fts_name;                 /* file name */
        char *fts_name;                 /* file name */
-       short fts_namelen;                      /* strlen(fts_name) */
-       short fts_level;                        /* depth (\-1 to N) */
-       long fts_number;                        /* local numeric value */
+       short fts_namelen;              /* strlen(fts_name) */
+       short fts_level;                /* depth (\-1 to N) */
+       long fts_number;                /* local numeric value */
        void *fts_pointer;              /* local address value */
        void *fts_pointer;              /* local address value */
-       struct ftsent *fts_parent;              /* parent directory */
-       struct ftsent *fts_link;                /* cycle or next file structure */
-       struct stat fts_statb;                  /* stat(2) information */
+       struct ftsent *fts_parent;      /* parent directory */
+       struct ftsent *fts_link;        /* cycle or next file structure */
+       struct stat fts_statb;          /* stat(2) information */
 } FTSENT;
 } FTSENT;
-.fi
-.\" Makes the output look a lot better.
-.bp
-.PP
+.Ed
+.Pp
 These fields are defined as follows:
 These fields are defined as follows:
-.TP
-fts_info
-One of the following flags describing the returned FTSENT structure and
+.Bl -tag -width "fts_namelen"
+.It Fa fts_info
+One of the following flags describing the returned
+.Fa FTSENT
+structure and
 the file it represents.
 the file it represents.
-With the exception of directories without errors (FTS_D), all of these
+With the exception of directories without errors
+.Pq Dv FTS_D ,
+all of these
 entries are terminal, that is, they will not be revisited, nor will any
 of their descendants be visited.
 entries are terminal, that is, they will not be revisited, nor will any
 of their descendants be visited.
-.RS
-.TP
-FTS_D
+.Bl  -tag -width FTS_DEFAULT
+.It Dv FTS_D
 A directory being visited in pre-order.
 A directory being visited in pre-order.
-.TP
-FTS_DC
+.It Dv FTS_DC
 A directory that causes a cycle in the tree.
 (The
 A directory that causes a cycle in the tree.
 (The
-.I fts_link
-field of the FTSENT structure will be filled in as well.)
-.TP
-FTS_DEFAULT
-Any FTSENT structure that represents a file type not explicitly described
+.Fa fts_link
+field of the
+.Fa FTSENT
+structure will be filled in as well.)
+.It Dv FTS_DEFAULT
+Any
+.Fa FTSENT
+structure that represents a file type not explicitly described
 by one of the other
 by one of the other
-.I fts_info
+.Fa fts_info
 values.
 values.
-.TP
-FTS_DNR
+.It Dv FTS_DNR
 A directory which cannot be read.
 An error return; the external variable
 A directory which cannot be read.
 An error return; the external variable
-.I errno
+.Va errno
 will be set to indicate the error.
 will be set to indicate the error.
-.TP
-FTS_DOT
-A file named ``.'' or ``..'' which was not specified as a file name to
-.I fts_open
-(see FTS_SEEDOT).
-.TP
-FTS_DP
+.It Dv FTS_DOT
+A file named
+.Ql \&.
+or
+.Ql ..
+which was not specified as a file name to
+.Fn fts_open
+(see
+.Dv FTS_SEEDOT ) .
+.It Dv FTS_DP
 A directory being visited in post-order.
 A directory being visited in post-order.
-The contents of the FTSENT structure will be unchanged from when
+The contents of the
+.Fa FTSENT
+structure will be unchanged from when
 it was returned in pre-order, i.e. with the
 it was returned in pre-order, i.e. with the
-.I fts_info
-field set to FTS_D.
-.TP
-FTS_ERR
+.Fa fts_info
+field set to
+.Dv FTS_D .
+.It Dv FTS_ERR
 An error return; the external variable
 An error return; the external variable
-.I errno
+.Va errno
 will be set to indicate the error.
 will be set to indicate the error.
-.TP
-FTS_F
+.It Dv FTS_F
 A regular file.
 A regular file.
-.TP
-FTS_NS
+.It Dv FTS_NS
 A file for which no
 A file for which no
-.IR stat (2)
+.Xr stat 2
 information was available.
 The contents of the
 information was available.
 The contents of the
-.I fts_statb
+.Fa fts_statb
 field are undefined.
 An error return; the external variable
 field are undefined.
 An error return; the external variable
-.I errno
+.Va errno
 will be set to indicate the error.
 will be set to indicate the error.
-.TP
-FTS_NSOK
+.It Dv FTS_NSOK
 A file for which no
 A file for which no
-.IR stat (2)
+.Xr stat 2
 information was requested.
 The contents of the
 information was requested.
 The contents of the
-.I fts_statb
+.Fa fts_statb
 field are undefined.
 field are undefined.
-.TP
-FTS_SL
+.It Dv FTS_SL
 A symbolic link.
 A symbolic link.
-.TP
-FTS_SLNONE
+.It Dv FTS_SLNONE
 A symbolic link with a non-existent target.
 The contents of the
 A symbolic link with a non-existent target.
 The contents of the
-.I fts_statb
+.Fa fts_statb
 field contain the file characteristic information for the symbolic link
 itself.
 field contain the file characteristic information for the symbolic link
 itself.
-.RE
-.TP
-fts_accpath
+.El
+.It Fa fts_accpath
 A path for accessing the file from the current directory.
 A path for accessing the file from the current directory.
-.TP
-fts_path
+.It Fa fts_path
 The path for the file relative to the root of the traversal.
 This path contains the path specified to
 The path for the file relative to the root of the traversal.
 This path contains the path specified to
-.I fts_open
+.Fn fts_open
 as a prefix.
 as a prefix.
-.TP
-fts_pathlen
+.It Fa fts_pathlen
 The length of the string referenced by
 The length of the string referenced by
-.IR fts_path .
-.TP
-fts_name
+.Fa fts_path .
+.It Fa fts_name
 The name of the file.
 The name of the file.
-.TP
-fts_namelen
+.It Fa fts_namelen
 The length of the string referenced by
 The length of the string referenced by
-.IR fts_name .
-.TP
-fts_level
+.Fa fts_name .
+.It Fa fts_level
 The depth of the traversal, numbered from \-1 to N, where this file
 was found.
 The depth of the traversal, numbered from \-1 to N, where this file
 was found.
-The FTSENT structure representing the parent of the starting point (or root)
-of the traversal is numbered \-1, and the FTSENT structure for the root
+The
+.Fa FTSENT
+structure representing the parent of the starting point (or root)
+of the traversal is numbered \-1, and the
+.Fa FTSENT
+structure for the root
 itself is numbered 0.
 itself is numbered 0.
-.TP
-fts_number
+.It Fa fts_number
 This field is provided for the use of the application program and is
 not modified by the
 This field is provided for the use of the application program and is
 not modified by the
-.I fts
+.Nm fts
 functions.
 It is initialized to 0.
 The fields
 functions.
 It is initialized to 0.
 The fields
-.I fts_number
+.Fa fts_number
 and
 and
-.I fts_pointer
+.Fa fts_pointer
 occupy the same physical location; using both may cause undefined results.
 occupy the same physical location; using both may cause undefined results.
-.TP
-fts_pointer
+.It Fa fts_pointer
 This field is provided for the use of the application program and is
 not modified by the
 This field is provided for the use of the application program and is
 not modified by the
-.I fts
+.Nm fts
 functions.
 functions.
-It is initialized to NULL.
+It is initialized to
+.Dv NULL .
 The fields
 The fields
-.I fts_number
+.Fa fts_number
 and
 and
-.I fts_pointer
+.Fa fts_pointer
 occupy the same physical location; using both may cause undefined results.
 occupy the same physical location; using both may cause undefined results.
-.TP
-fts_parent
-A pointer to the FTSENT structure referencing the file in the hierarchy
+.It Fa fts_parent
+A pointer to the
+.Fa FTSENT
+structure referencing the file in the hierarchy
 immediately above the current file, i.e. the directory of which this
 file is a member.
 A parent structure for the initial entry point is provided as well,
 however, only the
 immediately above the current file, i.e. the directory of which this
 file is a member.
 A parent structure for the initial entry point is provided as well,
 however, only the
-.IR fts_level ,
-.I fts_number
+.Fa fts_level ,
+.Fa fts_number
 and
 and
-.I fts_pointer
+.Fa fts_pointer
 fields are guaranteed to be initialized.
 fields are guaranteed to be initialized.
-.TP
-fts_link
+.It Fa fts_link
 The
 The
-.I fts_link
+.Fa fts_link
 field has two separate uses.
 field has two separate uses.
-If a directory causes a cycle in the hierarchy (see FTS_DC), either because
+If a directory causes a cycle in the hierarchy (see
+.Dv FTS_DC ) ,
+either because
 of a hard link between two directories, or a symbolic link pointing to a
 directory, the
 of a hard link between two directories, or a symbolic link pointing to a
 directory, the
-.I fts_link
-field of the structure will point to the FTSENT structure in the hierarchy
-that references the same file as the current FTSENT structure.
+.Fa fts_link
+field of the structure will point to the
+.Fa FTSENT
+structure in the hierarchy
+that references the same file as the current
+.Fa FTSENT
+structure.
 Also, upon return from the
 Also, upon return from the
-.I fts_children
+.Fn fts_children
 function, the
 function, the
-.I fts_link
+.Fa fts_link
 field points to the next structure in the linked list of directory members.
 Otherwise, the contents of the
 field points to the next structure in the linked list of directory members.
 Otherwise, the contents of the
-.I fts_link
+.Fa fts_link
 field are undefined.
 field are undefined.
-.TP
-fts_statb
-.IR Stat (2)
+.It Fa fts_statb
+.Xr Stat 2
 information for the file.
 information for the file.
-.SH FTS_OPEN
+.El
+.Sh FTS_OPEN
 The
 The
-.I fts_open
+.Fn fts_open
 function takes a pointer to an array of character pointers naming one
 or more paths which make up a logical file hierarchy to be traversed.
 function takes a pointer to an array of character pointers naming one
 or more paths which make up a logical file hierarchy to be traversed.
-The array must be terminated by a NULL pointer.
-.PP
-.I Fts_open
-has a number of options, at least one of which (either FTS_LOGICAL or
-FTS_PHYSICAL) must be specified.
+The array must be terminated by a
+.Dv NULL
+pointer.
+.Pp
+There are
+a number of options, at least one of which (either
+.Dv FTS_LOGICAL
+or
+.Dv FTS_PHYSICAL )
+must be specified.
 The options are selected by
 The options are selected by
-.IR or 'ing
+.Em or Ns 'ing
 the following values:
 the following values:
-.TP
-FTS_LOGICAL
+.Bl -tag -width "FTS_PHYSICAL"
+.It Dv FTS_LOGICAL
 This option causes the
 This option causes the
-.I fts
-routines to return FTSENT structures for the targets of symbolic links
+.Nm fts
+routines to return
+.Fa FTSENT
+structures for the targets of symbolic links
 instead of the symbolic links themselves.
 instead of the symbolic links themselves.
-If this option is set, the only symbolic links for which FTSENT structures
+If this option is set, the only symbolic links for which
+.Fa FTSENT
+structures
 are returned to the application are those referencing non-existent files.
 are returned to the application are those referencing non-existent files.
-Either FTS_LOGICAL or FTS_PHYSICAL
-.B must
+Either
+.Dv FTS_LOGICAL
+or
+.Dv FTS_PHYSICAL
+.Em must
 be provided to the
 be provided to the
-.I fts_open
+.Fn fts_open
 function.
 function.
-.TP
-FTS_NOCHDIR
+.It Dv FTS_NOCHDIR
 As a performance optimization, the
 As a performance optimization, the
-.I fts
+.Nm fts
 functions change directories as they walk the file hierarchy.
 This has the side-effect that an application cannot rely on being
 in any particular directory during the traversal.
 functions change directories as they walk the file hierarchy.
 This has the side-effect that an application cannot rely on being
 in any particular directory during the traversal.
-The FTS_NOCHDIR option turns off this optimization, and the
-.I fts
+The
+.Dv FTS_NOCHDIR
+option turns off this optimization, and the
+.Nm fts
 functions will not change the current directory.
 Note that applications should not themselves change their current directory
 functions will not change the current directory.
 Note that applications should not themselves change their current directory
-and try to access files unless FTS_NOCHDIR is specified and absolute
+and try to access files unless
+.Dv FTS_NOCHDIR
+is specified and absolute
 pathnames were provided as arguments to
 pathnames were provided as arguments to
-.IR fts_open .
-.TP
-FTS_NOSTAT
-By default, returned FTSENT structures contain file characteristic
+.Fn fts_open .
+.It Dv FTS_NOSTAT
+By default, returned
+.Fa FTSENT
+structures contain file characteristic
 information (the
 information (the
-.I statb
+.Fa statb
 field) for each file visited.
 This option relaxes that requirement as a performance optimization,
 allowing the
 field) for each file visited.
 This option relaxes that requirement as a performance optimization,
 allowing the
-.I fts
+.Nm fts
 functions to set the
 functions to set the
-.I fts_info
-field to FTS_NSOK and leave the contents of the
-.I statb
+.Fa fts_info
+field to
+.Dv FTS_NSOK
+and leave the contents of the
+.Fa statb
 field undefined.
 field undefined.
-.TP
-FTS_PHYSICAL
+.It Dv FTS_PHYSICAL
 This option causes the
 This option causes the
-.I fts
-routines to return FTSENT structures for symbolic links themselves instead
+.Nm fts
+routines to return
+.Fa FTSENT
+structures for symbolic links themselves instead
 of the target files they point to.
 of the target files they point to.
-If this option is set, FTSENT structures for all symbolic links in the
+If this option is set,
+.Fa FTSENT
+structures for all symbolic links in the
 hierarchy are returned to the application.
 hierarchy are returned to the application.
-Either FTS_LOGICAL or FTS_PHYSICAL
-.B must
+Either
+.Dv FTS_LOGICAL
+or
+.Dv FTS_PHYSICAL
+.Em must
 be provided to the
 be provided to the
-.I fts_open
+.Fn fts_open
 function.
 function.
-.TP
-FTS_SEEDOT
+.It Dv FTS_SEEDOT
 By default, unless they are specified as path arguments to
 By default, unless they are specified as path arguments to
-.IR fts_open ,
-any files named ``.'' and ``..'' encountered in the file hierarchy are
+.Fn fts_open ,
+any files named
+.Ql \&.
+and
+.Ql ..
+encountered in the file hierarchy are
 ignored.
 This option causes the
 ignored.
 This option causes the
-.I fts
-routines to return FTSENT structures for them.
-.TP
-FTS_XDEV
+.Nm fts
+routines to return
+.Fa FTSENT
+structures for them.
+.It Dv FTS_XDEV
 This option prevents
 This option prevents
-.I fts
+.Nm fts
 from descending into directories that have a different device number
 than the file from which the descent began.
 from descending into directories that have a different device number
 than the file from which the descent began.
-.PP
+.El
+.Pp
 The argument
 The argument
-.I compar
+.Fn compar
 specifies a user-defined function which may be used to order the traversal
 of the hierarchy.
 specifies a user-defined function which may be used to order the traversal
 of the hierarchy.
-.I Compar
-takes two pointers to pointers to FTSENT structures as arguments and
+It
+takes two pointers to pointers to
+.Fa FTSENT
+structures as arguments and
 should return a negative value, zero, or a positive value to indicate
 if the file referenced by its first argument comes before, in any order
 with respect to, or after, the file referenced by its second argument.
 The
 should return a negative value, zero, or a positive value to indicate
 if the file referenced by its first argument comes before, in any order
 with respect to, or after, the file referenced by its second argument.
 The
-.IR fts_accpath ,
-.I fts_path
+.Fa fts_accpath ,
+.Fa fts_path
 and
 and
-.I fts_pathlen
-fields of the FTSENT structures may
-.B never
+.Fa fts_pathlen
+fields of the
+.Fa FTSENT
+structures may
+.Em never
 be used in this comparison.
 If the 
 be used in this comparison.
 If the 
-.I fts_info
-field is set to FTS_NS or FTS_NSOK, the
-.I fts_stab
+.Fa fts_info
+field is set to
+.Dv FTS_NS
+or
+.DV FTS_NSOK ,
+the
+.Fa fts_stab
 field may not either.
 If the
 field may not either.
 If the
-.I compar
-argument is NULL, the directory traversal order is unspecified except
+.Fn compar
+argument is
+.Dv NULL ,
+the directory traversal order is unspecified except
 for the root paths which are traversed in the order listed in
 for the root paths which are traversed in the order listed in
-.IR path_argv .
-.SH FTS_READ
+.Fa path_argv .
+.Sh FTS_READ
 The
 The
-.I fts_read
-function returns a pointer to an FTSENT structure describing a file in
+.Fn fts_read
+function returns a pointer to an
+.Fa FTSENT
+structure describing a file in
 the hierarchy.
 Directories (that are readable and do not cause cycles) are visited at
 least twice, once in pre-order and once in post-order.
 the hierarchy.
 Directories (that are readable and do not cause cycles) are visited at
 least twice, once in pre-order and once in post-order.
@@ -376,203 +427,242 @@ All other files are visited at least once.
 (Hard links between directories that do not cause cycles or symbolic
 links to symbolic links may cause files to be visited more than once,
 or directories more than twice.)
 (Hard links between directories that do not cause cycles or symbolic
 links to symbolic links may cause files to be visited more than once,
 or directories more than twice.)
-.PP
+.Pp
 If all the members of the hierarchy have been returned,
 If all the members of the hierarchy have been returned,
-.I fts_read
-returns NULL and sets the external variable
-.I errno
+.Fn fts_read
+returns
+.Dv NULL
+and sets the external variable
+.Va errno
 to 0.
 If an error unrelated to a file in the hierarchy occurs,
 to 0.
 If an error unrelated to a file in the hierarchy occurs,
-.I fts_read
-returns NULL and sets
-.I errno
+.Fn fts_read
+returns
+.Dv NULL
+and sets
+.Va errno
 appropriately.
 appropriately.
-If an error related to a returned file occurs, a pointer to an FTSENT
+If an error related to a returned file occurs, a pointer to an
+.Fa FTSENT
 structure is returned, and
 structure is returned, and
-.I errno
+.Va errno
 may or may not have been set (see
 may or may not have been set (see
-.IR fts_info ).
-.PP
-The FTSENT structures returned by
-.I fts_read
+.Fa fts_info ) .
+.Pp
+The
+.Fa FTSENT
+structures returned by
+.Fn fts_read
 may be overwritten after a call to
 may be overwritten after a call to
-.I fts_close
+.Fn fts_close
 on the same file hierarchy stream, or, after a call to
 on the same file hierarchy stream, or, after a call to
-.I fts_read
+.Fn fts_read
 on the same file hierarchy stream unless they represent a file of type
 directory, in which case they will not be overwritten until after a call to
 on the same file hierarchy stream unless they represent a file of type
 directory, in which case they will not be overwritten until after a call to
-.I fts_read
-after the FTSENT structure has been returned by the function
-.I fts_read
+.Fn fts_read
+after the
+.Fa FTSENT
+structure has been returned by the function
+.Fn fts_read
 in post-order.
 in post-order.
-.SH FTS_CHILDREN
+.Sh FTS_CHILDREN
 The
 The
-.I fts_children
-function returns a pointer to an FTSENT structure describing the first
+.Fn fts_children
+function returns a pointer to an
+.Fa FTSENT
+structure describing the first
 entry in a linked list of the files in the directory represented by the
 entry in a linked list of the files in the directory represented by the
-FTSENT structure most recently returned by
-.IR fts_read .
+.Fa FTSENT
+structure most recently returned by
+.Fn fts_read .
 The list is linked through the
 The list is linked through the
-.I fts_link
-field of the FTSENT structure, and is ordered by the user-specified
+.Fa fts_link
+field of the
+.Fa FTSENT
+structure, and is ordered by the user-specified
 comparison function, if any.
 Repeated calls to
 comparison function, if any.
 Repeated calls to
-.I fts_children
+.Fn fts_children
 will recreate this linked list.
 will recreate this linked list.
-.PP
-If the FTSENT structure most recently returned by
-.I fts_read
+.Pp
+If the
+.Fa FTSENT
+structure most recently returned by
+.Fn fts_read
 is not a directory being visited in pre-order,
 or the directory does not contain any files,
 is not a directory being visited in pre-order,
 or the directory does not contain any files,
-.I fts_children
-returns NULL and sets
-.I errno
+.Fn fts_children
+returns
+.Dv NULL
+and sets
+.Va errno
 to zero.
 If an error occurs,
 to zero.
 If an error occurs,
-.I fts_children
-returns NULL and sets
-.I errno
+.Fn fts_children
+returns
+.Dv NULL
+and sets
+.Va errno
 appropriately.
 appropriately.
-.PP
-The FTSENT structures returned by
-.I fts_children
+.Pp
+The
+.Fa FTSENT
+structures returned by
+.Fn fts_children
 may be overwritten after a call to
 may be overwritten after a call to
-.I fts_close
+.Fn fts_close
 on the same file hierarchy stream, or after a call to
 on the same file hierarchy stream, or after a call to
-.I fts_children
+.Fn fts_children
 or
 or
-.I fts_read
+.Fn fts_read
 on the same file hierarchy stream.
 on the same file hierarchy stream.
-.PP
+.Pp
 A single buffer is used for all of the paths of all of the files in the
 file hierarchy.
 Therefore, the
 A single buffer is used for all of the paths of all of the files in the
 file hierarchy.
 Therefore, the
-.I fts_path
+.Fa fts_path
 and
 and
-.I fts_accpath
-fields are guaranteed to be NULL-terminated
-.B only
+.Fa fts_accpath
+fields are guaranteed to be
+.Dv NULL Ns -terminated
+.Em only
 for the file most recently returned by
 for the file most recently returned by
-.IR fts_read .
-To use these fields to reference any files represented by other FTSENT
+.Fn fts_read .
+To use these fields to reference any files represented by other
+.Fa FTSENT
 structures will require that the path buffer be modified using the
 structures will require that the path buffer be modified using the
-information contained in that FTSENT structure's
-.I fts_pathlen
+information contained in that
+.Fa FTSENT
+structure's
+.Fa fts_pathlen
 field.
 Any such modifications should be undone before further calls to
 field.
 Any such modifications should be undone before further calls to
-.I fts_read
+.Fn fts_read
 are attempted.
 The
 are attempted.
 The
-.I fts_name
-field is always NULL-terminated.
-.SH FTS_SET
+.Fa fts_name
+field is always
+.Dv NULL Ns -terminated.
+.Sh FTS_SET
 The function
 The function
-.I fts_set
+.Fn fts_set
 allows the user application to determine further processing for the
 file
 allows the user application to determine further processing for the
 file
-.I f
+.Fa f
 of the stream
 of the stream
-.IR ftsp .
-.I Fts_set
-returns 0 on success, and -1 if an error occurs.
-.I Option
+.Fa ftsp .
+The
+.Fn fts_set
+function
+returns 0 on success, and \-1 if an error occurs.
+.Em Option
 must be set to one of the following values:
 must be set to one of the following values:
-.TP
-FTS_AGAIN
+.Bl -tag -width FTS_PHYSICAL
+.It Dv FTS_AGAIN
 Re-visit the file; any file type may be re-visited.
 The next call to
 Re-visit the file; any file type may be re-visited.
 The next call to
-.I fts_read
+.Fn fts_read
 will return the referenced file.
 The
 will return the referenced file.
 The
-.I fts_stat
+.Fa fts_stat
 and
 and
-.I fts_info
+.Fa fts_info
 fields of the structure will be reinitialized at that time,
 but no other fields will have been changed.
 This option is meaningful only for the most recently returned
 file from
 fields of the structure will be reinitialized at that time,
 but no other fields will have been changed.
 This option is meaningful only for the most recently returned
 file from
-.IR fts_read .
+.Fn fts_read .
 Normal use is for post-order directory visits, where it causes the
 directory to be re-visited (in both pre and post-order) as well as all
 of its descendants.
 Normal use is for post-order directory visits, where it causes the
 directory to be re-visited (in both pre and post-order) as well as all
 of its descendants.
-.TP
-FTS_FOLLOW
+.It Dv FTS_FOLLOW
 The referenced file must be a symbolic link.
 If the referenced file is the one most recently returned by
 The referenced file must be a symbolic link.
 If the referenced file is the one most recently returned by
-.IR fts_read ,
+.Fn fts_read ,
 the next call to
 the next call to
-.I fts_read
+.Fn fts_read
 returns the file with the
 returns the file with the
-.I fts_info
+.Fa fts_info
 and
 and
-.I fts_statb
+.Fa fts_statb
 fields reinitialized to reflect the target of the symbolic link instead
 of the symbolic link itself.
 If the file is one of those most recently returned by
 fields reinitialized to reflect the target of the symbolic link instead
 of the symbolic link itself.
 If the file is one of those most recently returned by
-.IR fts_children ,
+.Fn fts_children ,
 the
 the
-.I fts_info
+.Fa fts_info
 and
 and
-.I fts_statb
+.Fa fts_statb
 fields of the structure, when returned by
 fields of the structure, when returned by
-.IR fts_read ,
+.Fn fts_read ,
 will reflect the target of the symbolic link instead of the symbolic link
 itself.
 In either case, if the target of the symbolic link does not exist the
 fields of the returned structure will be unchanged and the
 will reflect the target of the symbolic link instead of the symbolic link
 itself.
 In either case, if the target of the symbolic link does not exist the
 fields of the returned structure will be unchanged and the
-.I fts_info
-field will be set to FTS_SLNONE.
+.Fa fts_info
+field will be set to
+.Dv FTS_SLNONE .
+.Pp
 If the target of the link is a directory, the pre-order return, followed
 by the return of all of its descendants, followed by a post-order return,
 is done.
 If the target of the link is a directory, the pre-order return, followed
 by the return of all of its descendants, followed by a post-order return,
 is done.
-.TP
-FTS_SKIP
+.It Dv FTS_SKIP
 No descendants of this file are visited.
 The file may be one of those most recently returned by either
 No descendants of this file are visited.
 The file may be one of those most recently returned by either
-.I fts_children
+.Fn fts_children
 or
 or
-.IR fts_read .
-.SH FTS_CLOSE
+.Fn fts_read .
+.El
+.Sh FTS_CLOSE
 The
 The
-.I fts_close
+.Fn fts_close
 function closes a file hierarchy stream
 function closes a file hierarchy stream
-.I ftsp
+.Fa ftsp
 and restores the current directory to the directory from which
 and restores the current directory to the directory from which
-.I fts_open
+.Fn fts_open
 was called to open
 was called to open
-.IR ftsp .
-.I Fts_close
-returns 0 on success, and -1 if an error occurs.
-.SH ERRORS
-.I Fts_open
+.Fa ftsp .
+The
+.Fn fts_close
+function
+returns 0 on success, and \-1 if an error occurs.
+.Sh ERRORS
+The function
+.Fn fts_open
 may fail and set errno for any of the errors specified for the library
 functions
 may fail and set errno for any of the errors specified for the library
 functions
-.IR open (2)
+.Xr open 2
 and
 and
-.IR malloc (3).
-.PP
-.I Fts_close
+.Xr malloc 3 .
+.Pp
+The function
+.Fn fts_close
 may fail and set errno for any of the errors specified for the library
 functions
 may fail and set errno for any of the errors specified for the library
 functions
-.IR chdir (2)
+.Xr chdir 2
 and
 and
-.IR close (2).
-.PP
-.I Fts_read
+.Xr close 2 .
+.Pp
+The functions
+.Fn Fts_read
 and
 and
-.I fts_children
+.Fn fts_children
 may fail and set errno for any of the errors specified for the library
 functions
 may fail and set errno for any of the errors specified for the library
 functions
-.IR chdir (2),
-.IR malloc (3),
-.IR opendir (3),
-.IR readdir (3)
+.Xr chdir 2 ,
+.Xr malloc 3 ,
+.Xr opendir 3 ,
+.Xr readdir 3
 and
 and
-.IR stat (2).
-.SH SEE ALSO
-find(1), chdir(2), stat(2), qsort(3)
-.SH STANDARDS
+.Xr stat 2 .
+.Sh SEE ALSO
+.Xr find 1 ,
+.Xr chdir 2 ,
+.Xr stat 2 ,
+.Xr qsort 3
+.Sh STANDARDS
 The
 The
-.I fts
-utility is expected to be a superset of the IEEE Std 1003.1 (``POSIX'')
+.Nm fts
+utility is expected to be a superset of the
+.St -p1003.1-88
 specification.
 specification.
index a08d8ba..b192994 100644 (file)
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getcwd.3    6.3 (Berkeley) %G%
+.\"     @(#)getcwd.3   6.4 (Berkeley) %G%
 .\"
 .\"
-.TH GETWD 3 ""
-.UC 5
-.SH NAME
-getwd \- get working directory pathname
-.SH SYNOPSIS
-.nf
-.ft B
-char *getcwd(char *buf, size_t size);
-char *getwd(char *buf);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt GETCWD 3
+.Os BSD 4.2
+.Sh NAME
+.Nm getwd
+.Nd get working directory pathname
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft char *
+.Fn getcwd "char *buf" "size_t size"
+.Ft char *
+.Fn getwd "char *buf"
+.Sh DESCRIPTION
 The
 The
-.I getcwd
+.Fn getcwd
 function copies the absolute pathname of the current working directory
 into the memory referenced by
 function copies the absolute pathname of the current working directory
 into the memory referenced by
-.I buf
+.Fa buf
 and returns a pointer to
 and returns a pointer to
-.IR buf .
+.Fa buf .
 The
 The
-.I size
+.Fa size
 argument is the size, in bytes, of the array referenced by
 argument is the size, in bytes, of the array referenced by
-.IR buf .
-.PP
+.Fa buf .
+.Pp
 If
 If
-.I buf
-is NULL, space is allocated as necessary to store the pathname.
+.Fa buf
+is
+.Dv NULL ,
+space is allocated as necessary to store the pathname.
 This space may later be
 This space may later be
-.IR free 'd.
-.PP
+.Xr free 3 Ns 'd.
+.Pp
 The function
 The function
-.I getwd
+.Fn getwd
 is a compatibility routine which calls
 is a compatibility routine which calls
-.I getcwd
+.Fn getcwd
 with its
 with its
-.I buf
-argument and a size of MAXPATHLEN (as defined in the include
-file <sys/param.h>).
+.Fa buf
+argument and a size of
+.Dv MAXPATHLEN
+(as defined in the include
+file
+.Aq Pa sys/param.h ) .
 Obviously,
 Obviously,
-.I buf
-should be at least MAXPATHLEN bytes in length.
-.PP
+.Fa buf
+should be at least
+.Dv MAXPATHLEN
+bytes in length.
+.Pp
 These routines have traditionally been used by programs to save the
 name of a working directory for the purpose of returning to it.
 A much faster and less error-prone method of accomplishing this is to
 These routines have traditionally been used by programs to save the
 name of a working directory for the purpose of returning to it.
 A much faster and less error-prone method of accomplishing this is to
-open the current directory (``.'') and use the
-.IR fchdir (2)
+open the current directory
+.Pq Ql \&.
+and use the
+.Xr fchdir 2
 function to return.
 function to return.
-.SH RETURN VALUES
+.Sh RETURN VALUES
 Upon successful completion, a pointer to the pathname is returned.
 Upon successful completion, a pointer to the pathname is returned.
-Otherwise a NULL pointer is returned and
-.I errno
+Otherwise a
+.Dv NULL
+pointer is returned and the global variable
+.Va errno
 is set to indicate the error.
 In addition,
 is set to indicate the error.
 In addition,
-.I getwd
+.Fn getwd
 copies the error message associated with
 copies the error message associated with
-.I errno
+.Va errno
 into the memory referenced by
 into the memory referenced by
-.IR buf .
-.SH ERRORS
-.I Getcwd
+.Fa buf .
+.Sh ERRORS
+The
+.Fn getcwd
+function
 will fail if:
 will fail if:
-.TP 15
-[EACCESS]
+.Bl -tag -width [EACCESS]
+.It Bq Er EACCESS
 Read or search permission was denied for a component of the pathname.
 Read or search permission was denied for a component of the pathname.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The
 The
-.I size
+.Fa size
 argument is zero.
 argument is zero.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A component of the pathname no longer exists.
 A component of the pathname no longer exists.
-.TP 15
-[ENOMEM]
+.It Bq Er ENOMEM
 Insufficient memory is available.
 Insufficient memory is available.
-.TP 15
-[ERANGE]
+.It Bq Er ERANGE
 The
 The
-.I size 
+.Fa size
 argument is greater than zero but smaller than the length of the pathname
 plus 1.
 argument is greater than zero but smaller than the length of the pathname
 plus 1.
-.SH BUGS
-.I Getwd
+.El
+.Sh SEE ALSO
+.Xr chdir 2 ,
+.Xr fchdir 2 ,
+.Xr malloc 3 ,
+.Xr strerror 3
+.Sh STANDARDS
+The
+.Fn getcwd
+function
+conforms to
+.St -ansiC .
+The ability to specify a
+.Dv NULL
+pointer and have
+.Fn getcwd
+allocate memory as necessary is an extension.
+.Sh HISTORY
+The
+.Fn getwd
+function appeared in 
+.Bx 4.0 .
+.Sh BUGS
+The
+.Fn getwd
+function
 does not do sufficient error checking and is not able to return very
 long, but valid, paths.
 It is provided for compatibility.
 does not do sufficient error checking and is not able to return very
 long, but valid, paths.
 It is provided for compatibility.
-.SH SEE ALSO
-chdir(2), fchdir(2), malloc(3), strerror(3)
-.SH STANDARDS
-.I Getcwd
-conforms to IEEE Std 1003.1-1988 (``POSIX'').
-The ability to specify a NULL pointer and have
-.I getcwd
-allocate memory as necessary is an extension.
index 0838815..6ec0fda 100644 (file)
@@ -1,29 +1,38 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getdiskbyname.3     6.5 (Berkeley) %G%
+.\"     @(#)getdiskbyname.3    6.6 (Berkeley) %G%
 .\"
 .\"
-.TH GETDISKBYNAME 3 ""
-.UC 5
-.SH NAME
-getdiskbyname \- get generic disk description by its name
-.SH SYNOPSIS
-.nf
-.B #include <sys/disklabel.h>
-.PP
-.B struct disklabel *
-.B getdiskbyname(name)
-.B char *name;
-.fi
-.SH DESCRIPTION
-.I Getdiskbyname
-takes a disk name (e.g. rm03) and returns a prototype disk label
+.Dd 
+.Dt GETDISKBYNAME 3
+.Os BSD 4.2
+.Sh NAME
+.Nm getdiskbyname
+.Nd get generic disk description by its name
+.Sh SYNOPSIS
+.Fd #include <sys/disklabel.h>
+.Ft struct disklabel *
+.Fn getdiskbyname "const char *name"
+.Sh DESCRIPTION
+The
+.Fn getdiskbyname
+function
+takes a disk name (e.g.
+.Ql rm03 )
+and returns a prototype disk label
 describing its geometry information and the standard
 disk partition tables.  All information is obtained from
 the 
 describing its geometry information and the standard
 disk partition tables.  All information is obtained from
 the 
-.IR disktab (5)
+.Xr disktab 5
 file.
 file.
-.SH "SEE ALSO"
-disklabel(5), disktab(5), disklabel(8)
+.Sh SEE ALSO
+.Xr disklabel 5 ,
+.Xr disktab 5 ,
+.Xr disklabel 8
+.Sh HISTORY
+The
+.Fn getdiskbyname
+function appeared in 
+.Bx 4.3 .
index bec6027..d76d428 100644 (file)
@@ -1,43 +1,44 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getfsent.3  6.8 (Berkeley) %G%
+.\"     @(#)getfsent.3 6.9 (Berkeley) %G%
 .\"
 .\"
-.TH GETFSENT 3  ""
-.UC 4
-.SH NAME
-getfsent, getfsspec, getfsfile, setfsent, endfsent \- get file system descriptor file entry
-.SH SYNOPSIS
-.nf
-.B #include <fstab.h>
-.PP
-.B struct fstab *getfsent()
-.PP
-.B struct fstab *getfsspec(spec)
-.B char *spec;
-.PP
-.B struct fstab *getfsfile(file)
-.B char *file;
-.PP
-.B int setfsent()
-.PP
-.B void endfsent()
-.fi
-.SH DESCRIPTION
-.IR Getfsent ,
-.IR getfsspec ,
+.Dd 
+.Dt GETFSENT 3
+.Os BSD 4
+.Sh NAME
+.Nm getfsent ,
+.Nm getfsspec ,
+.Nm getfsfile ,
+.Nm setfsent ,
+.Nm endfsent
+.Nd get file system descriptor file entry
+.Sh SYNOPSIS
+.Fd #include <fstab.h>
+.Ft fstab *
+.Fn getfsent void
+.Ft struct fstab *
+.Fn getfsspec "const char *spec"
+.Ft struct fstab *
+.Fn getfsfile "const char *file"
+.Ft int
+.Fn setfsent void
+.Ft void
+.Fn endfsent void
+.Sh DESCRIPTION
+The
+.Fn getfsent ,
+.Fn getfsspec ,
 and
 and
-.I getfsfile
+.Fn getfsfile
+functions
 each return a pointer to an object with the following structure
 containing the broken-out fields of a line in the file system
 description file,
 each return a pointer to an object with the following structure
 containing the broken-out fields of a line in the file system
 description file,
-.IR < fstab.h >.
-.RS
-.PP
-.nf
-.ta \w'#define 'u +\w'char\ \ 'u +\w'*fs_vfstype;\ \ 'u
+.Aq Pa fstab.h .
+.Bd -literal -offset indent
 struct fstab {
        char    *fs_spec;       /* block special device name */
        char    *fs_file;       /* file system path prefix */
 struct fstab {
        char    *fs_spec;       /* block special device name */
        char    *fs_file;       /* file system path prefix */
@@ -47,48 +48,75 @@ struct fstab {
        int     fs_freq;        /* dump frequency, in days */
        int     fs_passno;      /* pass number on parallel dump */
 };
        int     fs_freq;        /* dump frequency, in days */
        int     fs_passno;      /* pass number on parallel dump */
 };
-.ft R
-.ad
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The fields have meanings described in
 The fields have meanings described in
-.IR fstab (5).
-.PP
-.I Setfsent
+.Xr fstab 5 .
+.Pp
+The
+.Fn setfsent
+function
 opens the file (closing any previously opened file) or rewinds it
 if it is already open.
 opens the file (closing any previously opened file) or rewinds it
 if it is already open.
-.PP
-.I Endfsent
+.Pp
+The
+.Fn endfsent
+function
 closes the file.
 closes the file.
-.PP
-.I Getfsspec
+.Pp
+The
+.Fn getfsspec
 and
 and
-.I getfsfile
+.Fn getfsfile
+functions
 search the entire file (opening it if necessary) for a matching special
 file name or file system file name.
 search the entire file (opening it if necessary) for a matching special
 file name or file system file name.
-.PP
+.Pp
 For programs wishing to read the entire database,
 For programs wishing to read the entire database,
-.I getfsent
+.Fn getfsent
 reads the next entry (opening the file if necessary).
 reads the next entry (opening the file if necessary).
-.PP
+.Pp
 All entries in the file with a type field equivalent to
 All entries in the file with a type field equivalent to
-.I FSTAB_XX
+.Dv FSTAB_XX
 are ignored.
 are ignored.
-.SH FILES
-/etc/fstab
-.SH "SEE ALSO"
-fstab(5)
-.SH DIAGNOSTICS
-.IR Getfsent ,
-.IR getfsspec ,
+.Sh RETURN VALUES
+The
+.Fn getfsent ,
+.Fn getfsspec ,
 and
 and
-.I getfsfile
-return a null pointer (0) on EOF or error.
-.I Setfsent
+.Fn getfsfile
+functions
+return a null pointer (0) on
+.Dv EOF
+or error.
+The
+.Fn setfsent
+function
 returns 0 on failure, 1 on success.
 returns 0 on failure, 1 on success.
-.I Endfsent
+The
+.Fn endfsent
+function
 returns nothing.
 returns nothing.
-.SH BUGS
-All information is contained in a static area so it must be copied if it is
-to be saved.
+.Sh FILES
+.Bl -tag -width /etc/fstab -compact
+.It Pa /etc/fstab
+.El
+.Sh SEE ALSO
+.Xr fstab 5
+.Sh HISTORY
+The
+.Fn getfsent
+function appeared in 
+.Bx 4.0 ;
+the
+.Fn endfsent ,
+.Fn getfsfile ,
+.Fn getfsspec ,
+and 
+.Fn setfsent
+functions appeared in
+.Bx 4.3 .
+.Sh BUGS
+These functions use static data storage;
+if the data is needed for future use, it should be
+copied before any subsequent calls overwrite it.
index a9befb3..6485b10 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
+.\"  All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getgrent.3  6.6 (Berkeley) %G%
+.\"     @(#)getgrent.3 6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETGRENT 3  ""
-.AT 3
-.SH NAME
-getgrent, getgrnam, getgrgid, setgroupent, setgrent,
-endgrent \- get group file entry
-.SH SYNOPSIS
-.nf
-.ft B
-#include <grp.h>
-
-struct group *getgrent(void);
-
-struct group *getgrnam(char *name);
-
-struct group *getgrgid(gid_t gid);
-
-setgrent(void);
-setgroupent(int stayopen);
-
-void endgrent(void);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Getgrent,
-.I getgrgid
-and
-.I getgrnam
-each return a pointer to a structure containing the broken-out fields
-of a line in the group file.  This structure is defined by the include
+.Dd 
+.Dt GETGRENT 3
+.Os
+.Sh NAME
+.Nm getgrent ,
+.Nm getgrnam ,
+.Nm getgrgid ,
+.Nm setgroupent ,
+.Nm setgrfile ,
+.Nm setgrent ,
+.Nm endgrent
+.Nd group database operations
+.Sh SYNOPSIS
+.Fd #include <grp.h>
+.Ft struct group *
+.Fn getgrent void
+.Ft struct group *
+.Fn getgrname "const char *name"
+.Ft struct group *
+.Fn getgrgid "gid_t gid"
+.Ft struct group *
+.Fn setgroupent "int stayopen"
+.Ft void
+.Fn setgrfile "const char *name"
+.Ft int
+.Fn setgrent void
+.Ft void
+.Fn endgrent void
+.Sh DESCRIPTION
+These functions operate on the group database file
+.Pa /etc/group
+which is described
+in
+.Xr group 5 .
+Each line of the database is defined by the structure
+.Ar group
+found in the include
 file
 file
-.IR < grp.h >,
-and contains the following fields:
-.PP
-.RS
-.nf
+.Aq Pa grp.h :
+.Bd -literal -offset indent
 struct group {
 struct group {
-       char            *gr_name;               /* group name */
-       char            *gr_passwd;     /* group password */
+       char    *gr_name;       /* group name */
+       char    *gr_passwd;     /* group password */
        gid_t   gr_gid;         /* group id */
        gid_t   gr_gid;         /* group id */
-       char            **gr_mem;               /* group members */
+       char    **gr_mem;       /* group members */
 };
 };
-.ft R
-.ad
-.fi
-.RE
-.PP
-These fields are more completely described in
-.IR group (5).
-.PP
-.I Getgrnam
+.Ed
+.Pp
+The functions
+.Fn getgrnam
 and
 and
-.I getgrgid
-search the group database for a matching group name or group id,
+.Fn getgrgid
+search the group database for the given group name pointed to by
+.Ar name
+or the group id pointed to by
+.Ar gid ,
 respectively, returning the first one encountered.  Identical group
 names or group gids may result in undefined behavior.
 respectively, returning the first one encountered.  Identical group
 names or group gids may result in undefined behavior.
-.PP
-.I Getgrent
+.Pp
+The
+.Fn getgrent
+function
 sequentially reads the group database and is intended for programs
 that wish to step through the complete list of groups.
 sequentially reads the group database and is intended for programs
 that wish to step through the complete list of groups.
-.PP
+.Pp
 All three routines will open the group file for reading, if necesssary.
 All three routines will open the group file for reading, if necesssary.
-.PP
-.I Setgroupent
+.Pp
+The
+.Fn setgrfile
+function
+changes the default group file to
+.Fa file ,
+thus allowing the use of alternate group files.
+.Pp
+The
+.Fn setgroupent
+function
 opens the file, or rewinds it if it is already open.  If
 opens the file, or rewinds it if it is already open.  If
-.I stayopen
+.Fa stayopen
 is non-zero, file descriptors are left open, significantly speeding
 is non-zero, file descriptors are left open, significantly speeding
-up subsequent calls.  This functionality is unnecessary for
-.I getgrent
+functions subsequent calls.  This functionality is unnecessary for
+.Fn getgrent
 as it doesn't close its file descriptors by default.  It should also
 be noted that it is dangerous for long-running programs to use this
 functionality as the group file may be updated.
 as it doesn't close its file descriptors by default.  It should also
 be noted that it is dangerous for long-running programs to use this
 functionality as the group file may be updated.
-.PP
-.I Setgrent
+.Pp
+The
+.Fn setgrent
+function
 is identical to
 is identical to
-.I setgroupent
+.Fn setgroupent
 with an argument of zero.
 with an argument of zero.
-.PP
-.I Endgrent
+.Pp
+The
+.Fn endgrent
+function
 closes any open files.
 closes any open files.
-.PP
-.PP
-.SH FILES
-/etc/group
-.SH "SEE ALSO"
- getpwent(3), group(5)
-.SH DIAGNOSTICS
-The routines
-.IR getgrent ,
-.IR getgrnam ,
+.Sh RETURN VALUES
+The functions
+.Fn getgrent ,
+.Fn getgrnam ,
+and
+.Fn getgrgid ,
+return a pointer to the group entry if successful; if end-of-file
+is reached or an error occurs a null pointer is returned.
+The functions
+.Fn setgroupent
+and
+.Fn setgrent
+return the value 1 if successful, otherwise the value
+0 is returned.
+The functions
+.Fn endgrent
+and
+.Fn setgrfile
+have no return value.
+.Sh FILES
+.Bl -tag -width /etc/group -compact
+.It Pa /etc/group
+group database file
+.El
+.Sh SEE ALSO
+.Fn getpwent 3 ,
+.Fn group 5
+.Sh HISTORY
+The functions
+.Fn endgrent ,
+.Fn getgrent ,
+.Fn getgrnam ,
+.Fn getgrgid ,
+and
+.Fn setgrent
+appeared in
+.At v7 .
+The functions
+.Fn setgrfile
 and
 and
-.IR getgrgid ,
-return a null pointer on EOF or error.
-.I Setgroupent
+.Fn setgroupent
+appeared in
+.Bx 4.3 Reno .
+.Sh BUGS
+The functions
+.Fn getgrent ,
+.Fn getgrnam ,
+.Fn getgrgid ,
+.Fn setgroupent
 and
 and
-.I setgrent
-return 0 on failure, 1 on success.
-.I Endgrent
-has no return value.
-.SH BUGS
-All information is contained in a static buffer which is overwritten
-by each new call.  It must be copied elsewhere to be retained.
-.PP
-The routines
-.IR getgrent ,
-.IR endgrent ,
-.IR setgroupent ,
+.Fn setgrent
+leave their results in an internal static object and return
+a pointer to that object. Subsequent calls to
+the same function
+will modify the same object.
+.Pp
+The functions
+.Fn getgrent ,
+.Fn endgrent ,
+.Fn setgroupent ,
 and
 and
-.IR setgrent
+.Fn setgrent
 are fairly useless in a networked environment and should be
 avoided, if possible.
 are fairly useless in a networked environment and should be
 avoided, if possible.
-.SH COMPATIBILITY
-The historic function
-.IR setgrfile ,
-which allowed the specification of alternate password databases, has
-been deprecated and is no longer available.
index c9fd4e0..0faf2d6 100644 (file)
@@ -1,35 +1,42 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getloadavg.3        6.2 (Berkeley) %G%
+.\"     @(#)getloadavg.3       6.3 (Berkeley) %G%
 .\"
 .\"
-.TH GETLOADAVG 3  ""
-.UC 7
-.SH NAME
-getloadavg \- get system load averages
-.SH SYNOPSIS
-.nf
-.B getloadavg(loadavg, nelem)
-.B double loadavg[nelem];
-.B int nelem;
-.fi
-.SH DESCRIPTION
-.I Getloadavg
+.Dd 
+.Dt GETLOADAVG 3
+.Os
+.Sh NAME
+.Nm getloadavg
+.Nd get system load averages
+.Sh SYNOPSIS
+.Fn getloadavg "double loadavg[]" "int nelem"
+.Sh DESCRIPTION
+The
+.Fn getloadavg
+function
 returns the number of processes in the system run queue
 averaged over various periods of time.  Up to
 returns the number of processes in the system run queue
 averaged over various periods of time.  Up to
-.I nelem
+.Fa nelem
 samples are retrieved and assigned to successive elements of
 samples are retrieved and assigned to successive elements of
-.I loadavg[].
+.Fa loadavg Ns Bq .
 The system imposes a maximum of 3 samples, representing averages
 over the last 1, 5, and 15 minutes, respectively.
 The system imposes a maximum of 3 samples, representing averages
 over the last 1, 5, and 15 minutes, respectively.
-.SH "SEE ALSO"
-uptime(1), nlist(3), kmem(4)
-.SH DIAGNOSTICS
+.Sh DIAGNOSTICS
 If the load average was unobtainable, \-1 is returned; otherwise,
 the number of samples actually retrieved is returned.
 If the load average was unobtainable, \-1 is returned; otherwise,
 the number of samples actually retrieved is returned.
-.SH BUGS
+.Sh SEE ALSO
+.Xr uptime 1 ,
+.Xr nlist 3 ,
+.Xr kmem 4
+.Sh HISTORY
+The
+.Fn getloadavg
+function is
+.Ud .
+.Sh BUGS
 Programs using this utility must have read permission on
 Programs using this utility must have read permission on
-.I /dev/kmem.
+.Pa /dev/kmem .
 This restriction will eventually be lifted.
 This restriction will eventually be lifted.
index 3e87d33..b126dc3 100644 (file)
@@ -1,68 +1,82 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getmntinfo.3        6.4 (Berkeley) %G%
+.\"     @(#)getmntinfo.3       6.5 (Berkeley) %G%
 .\"
 .\"
-.TH GETMNTINFO 3 ""
-.UC 7
-.SH NAME
-getmntinfo - get information about mounted file systems
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/mount.h>
-.LP
-.ft B
-int getmntinfo(mntbufp, flags)
-struct statfs **mntbufp;
-int flags
-.fi
-.ft R
-.SH DESCRIPTION
-.I Getmntinfo
+.Dd 
+.Dt GETMNTINFO 3
+.Os
+.Sh NAME
+.Nm getmntinfo
+.Nd get information about mounted file systems
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/mount.h>
+.Ft int
+.Fn getmntinfo "int mntbufp" "int flags"
+.Sh DESCRIPTION
+The
+.Fn getmntinfo
+function
 returns an array of
 returns an array of
-.I statfs
+.Xr statfs
 structures describing each currently mounted file system (see
 structures describing each currently mounted file system (see
-.IR statfs (2)).
-.PP
-.I Getmntinfo
+.Xr statfs 2 ) .
+.Pp
+The
+.Fn getmntinfo
+function
 passes its
 passes its
-.I flags
+.Fa flags
 parameter transparently to
 parameter transparently to
-.IR getfsstat (2).
-.SH "RETURN VALUE"
+.Xr getfsstat 2 .
+.Sh RETURN VALUES
 On successful completion,
 On successful completion,
-.I getmntinfo
+.Fn getmntinfo
 returns a count of the number of elements in the array.
 The pointer to the array is stored into
 returns a count of the number of elements in the array.
 The pointer to the array is stored into
-.IR mntbufp .
-.PP
+.Fa mntbufp .
+.Pp
 If an error occurs, zero is returned and the external variable
 If an error occurs, zero is returned and the external variable
-.I errno
+.Va errno
 is set to indicate the error.
 Although the pointer 
 is set to indicate the error.
 Although the pointer 
-.I mntbufp
+.Fa mntbufp
 will be unmodified, any information previously returned by 
 will be unmodified, any information previously returned by 
-.I getmntinfo
+.Fn getmntinfo
 will be lost.
 will be lost.
-.SH BUGS
-All information is contained in a static area,
-so it must be copied if it is to be saved.
-.PP
-The memory allocated by
-.I getmntinfo
-cannot be
-.IR free 'd
-by the application.
-.SH ERRORS
-.I Getmntinfo
+.Sh ERRORS
+The
+.Fn getmntinfo
+function
 may fail and set errno for any of the errors specified for the library 
 routines
 may fail and set errno for any of the errors specified for the library 
 routines
-.IR getfsstat (2)
+.Xr getfsstat 2
 or 
 or 
-.IR malloc (3).
-.SH SEE ALSO
-getfsstat(2), statfs(2), mount(2), mount(8)
+.Xr malloc 3 .
+.Sh SEE ALSO
+.Xr getfsstat 2 ,
+.Xr statfs 2 ,
+.Xr mount 2 ,
+.Xr mount 8
+.Sh HISTORY
+The
+.Fn getmntinfo
+function is
+.Ud .
+.Sh BUGS
+The
+.Fn getmntinfo
+function writes the array of structures to an internal static object
+and returns
+a pointer to that object. Subsequent calls to
+.Fn getmntinfo
+will modify the same object.
+.Pp
+The memory allocated by
+.Fn getmntinfo
+cannot be
+.Xr free 2 Ns 'd
+by the application.
index 1f71a2d..5c27ec8 100644 (file)
@@ -1,31 +1,62 @@
-.\"    @(#)getpass.3   6.2 (Berkeley) %G%
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH GETPASS 3  ""
-.AT 3
-.SH NAME
-getpass \- read a password
-.SH SYNOPSIS
-.nf
-.B char *getpass(prompt)
-.B char *prompt;
-.fi
-.SH DESCRIPTION
-.I Getpass
-reads a password from the file
-.IR /dev/tty ,
-or if that cannot be opened, from the standard input,
-after prompting with the null-terminated string
-.I prompt
-and disabling echoing.
-A pointer is returned to a null-terminated string
-of at most 8 characters.
-A calling process should zero the password as soon
-as possible to avoid leaving the cleartext password
-visible in the process' address space.
-.SH FILES
-/dev/tty
-.SH "SEE ALSO"
-crypt(3)
-.SH BUGS
-The return value points to static data
-whose content is overwritten by each call.
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)getpass.3  6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETPASS 3
+.Os
+.Sh NAME
+.Nm getpass
+.Nd get a password
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft char *
+.Fn getpass "const char *prompt"
+.Sh DESCRIPTION
+The
+.Fn getpass
+function prompts for a password
+from
+.Pa /dev/tty .
+If the file
+.Pa /dev/tty is not accessible,
+.Fn getpass
+reads from the
+.Em stdin .
+The prompt string must be
+.Dv NUL Ns -terminated
+and after it is written
+to the output,
+.Fn getpass
+turns off character echoing.
+.Pp
+.Sh RETURN VALUES
+If successful,
+.Fn getpass
+returns a pointer to the
+password. The password may be up to 128
+characters long and is null terminated.
+The calling process should zero the password as soon as possible
+to avoid leaving the cleartext password visible in the process's
+address space.
+.Sh FILES
+.Bl -tag -width /dev/tty - compact
+.It Pa /dev/tty
+.El
+.Sh SEE ALSO
+.Xr crypt 3
+.Sh HISTORY
+A
+.Fn getpass
+function appeared in
+.At v7 .
+.Sh BUGS
+The
+.Fn getpass
+function leaves its result in an internal static object and returns
+a pointer to that object. Subsequent calls to
+.Fn getpass
+will modify the same object.
index e4ef707..dba3842 100644 (file)
-.\" Copyright (c) 1988 The Regents of the University of California.
+.\" Copyright (c) 1988, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getpwent.3  6.7 (Berkeley) %G%
+.\"     @(#)getpwent.3 6.8 (Berkeley) %G%
 .\"
 .\"
-.TH GETPWENT 3  ""
-.AT 3
-.SH NAME
-getpwent, getpwnam, getpwuid, setpassent, setpwent,
-endpwent \- get password file entries
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <pwd.h>
-
-struct passwd *getpwent(void);
-struct passwd *getpwnam(char *login);
-struct passwd *getpwuid(uid_t uid);
-int setpassent(int stayopen);
-int setpwent(void);
-void endpwent(void);
-.ft R
-.fi
-.SH DESCRIPTION
-.IR Getpwent ,
-.IR getpwuid ,
-and
-.I getpwnam
-each return a pointer to a structure containing the broken-out
-fields of a line in the password file.  This structure is defined
-by the include file
-.IR < pwd.h > ,
-and contains the following fields:
-.PP
-.RS
-.nf
+.Dd 
+.Dt GETPWENT 3
+.Os
+.Sh NAME
+.Nm getpwent ,
+.Nm getpwnam ,
+.Nm getpwuid ,
+.Nm setpassent ,
+.Nm setpwent ,
+.Nm endpwent
+.Nd password database operations
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <pwd.h>
+.Ft struct passwd *
+.Fn getpwent void
+.Ft struct passwd *
+.Fn getpwnam "const char *login"
+.Ft struct passwd *
+.Fn getpwuid "uid_t uid" 
+.Ft int
+.Fn setpassent "int  stayopen"
+.Ft int
+.Fn setpwent void
+.Ft void
+.Fn endpwent void
+.Sh DESCRIPTION
+These functions
+operate on the password database file
+which is described
+in
+.Xr passwd 5 .
+Each entry in the database is defined by the structure
+.Ar passwd
+found in the include
+file
+.Aq Pa pwd.h :
+.Bd -literal -offset indent
 struct passwd {
 struct passwd {
-       char    *pw_name;                       /* user name */
-       char    *pw_passwd;             /* encrypted password */
+       char    *pw_name;       /* user name */
+       char    *pw_passwd;     /* encrypted password */
        uid_t   pw_uid;         /* user uid */
        gid_t   pw_gid;         /* user gid */
        time_t  pw_change;      /* password change time */
        uid_t   pw_uid;         /* user uid */
        gid_t   pw_gid;         /* user gid */
        time_t  pw_change;      /* password change time */
-       char    *pw_class;              /* user access class */
-       char    *pw_gecos;              /* Honeywell login info */
-       char    *pw_dir;                        /* home directory */
-       char    *pw_shell;              /* default shell */
+       char    *pw_class;      /* user access class */
+       char    *pw_gecos;      /* Honeywell login info */
+       char    *pw_dir;        /* home directory */
+       char    *pw_shell;      /* default shell */
        time_t  pw_expire;      /* account expiration */
 };
        time_t  pw_expire;      /* account expiration */
 };
-.fi
-.RE
-.PP
-These fields are more completely described in
-.IR passwd (5).
-.PP
-.I Getpwnam
+.Ed
+.Pp
+The functions
+.Fn getpwnam
 and
 and
-.I getpwuid
-search the password database for a matching user name or user uid,
+.Fn getpwuid
+search the password database for the given login name or user uid,
 respectively, always returning the first one encountered.
 respectively, always returning the first one encountered.
-.PP
-.I Getpwent
+.Pp
+The
+.Fn getpwent
+function
 sequentially reads the password database and is intended for programs
 that wish to process the complete list of users.
 sequentially reads the password database and is intended for programs
 that wish to process the complete list of users.
-.PP
-.I Setpassent
+.Pp
+The
+.Fn setpassent
+function
 accomplishes two purposes.
 First, it causes
 accomplishes two purposes.
 First, it causes
-.I getpwent
+.Fn getpwent
 to ``rewind'' to the beginning of the database.
 Additionally, if
 to ``rewind'' to the beginning of the database.
 Additionally, if
-.I stayopen
+.Fa stayopen
 is non-zero, file descriptors are left open, significantly speeding
 up subsequent accesses for all of the routines.
 (This latter functionality is unnecessary for
 is non-zero, file descriptors are left open, significantly speeding
 up subsequent accesses for all of the routines.
 (This latter functionality is unnecessary for
-.I getpwent
+.Fn getpwent
 as it doesn't close its file descriptors by default.)
 as it doesn't close its file descriptors by default.)
-.PP
+.Pp
 It is dangerous for long-running programs to keep the file descriptors
 open the database will become out of date if it is updated while the
 program is running.
 It is dangerous for long-running programs to keep the file descriptors
 open the database will become out of date if it is updated while the
 program is running.
-.PP
-.I Setpwent
+.Pp
+The
+.Fn setpwent
+function
 is identical to
 is identical to
-.I setpassent
+.Fn setpassent
 with an argument of zero.
 with an argument of zero.
-.PP
-.I Endpwent
+.Pp
+The
+.Fn endpwent
+function
 closes any open files.
 closes any open files.
-.PP
+.Pp
 These routines have been written to ``shadow'' the password file, e.g.
 allow only certain programs to have access to the encrypted password.
 If the process which calls them has an effective uid of 0, the encrypted
 password will be returned, otherwise, the password field of the retuned
 These routines have been written to ``shadow'' the password file, e.g.
 allow only certain programs to have access to the encrypted password.
 If the process which calls them has an effective uid of 0, the encrypted
 password will be returned, otherwise, the password field of the retuned
-structure will point to the string ``*''.
-.SH FILES
-/var/db/pwd.db                 The insecure password database file
-.br
-/var/db/spwd.db                The secure password database file
-.br
-/etc/master.passwd             The current password file
-.br
-/etc/passwd                    A Version 7 format password file
-.SH "SEE ALSO"
-getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8)
-.SH DIAGNOSTICS
-The routines
-.IR getpwent ,
-.IR getpwnam ,
+structure will point to the string
+.Ql * .
+.Sh RETURN VALUES
+The functions
+.Fn getpwent ,
+.Fn getpwnam ,
 and
 and
-.IR getpwuid ,
-return a null pointer on EOF or error.
-.I Setpassent
+.Fn getpwuid ,
+return a valid pointer to a passwd structure on success
+and a null pointer if end-of-file is reached or an error occurs.
+The functions
+.Fn setpassent
 and
 and
-.I setpwent
+.Fn setpwent
 return 0 on failure and 1 on success.
 return 0 on failure and 1 on success.
-.I Endpwent
+The
+.Fn endpwent
+function
 has no return value.
 has no return value.
-.SH BUGS
-All information is contained in a static buffer which is overwritten
-by each new call.
-It must be copied elsewhere to be retained.
-.PP
+.Sh FILES
+.Bl -tag -width /etc/master.passwd -compact
+.It Pa /var/db/pwd.db
+The insecure password database file
+.It Pa /var/db/spwd.db
+The secure password database file
+.It Pa /etc/master.passwd
+The current password file
+.It Pa /etc/passwd
+A Version 7 format password file
+.El
+.Sh SEE ALSO
+.Xr getlogin 3 ,
+.Xr getgrent 3 ,
+.Xr passwd 5 ,
+.Xr pwd_mkdb 8 ,
+.Xr vipw 8
+.Sh HISTORY
+The
+.Nm getpwent ,
+.Nm getpwnam ,
+.Nm getpwuid ,
+.Nm setpwent,
+and
+.Nm endpwent
+functions appeared in
+.At v7 .
+The
+.Nm setpassent
+function appeared in
+.Bx 4.3 Reno .
+.Sh BUGS
+The functions
+.Fn getpwent ,
+.Fn getpwnam ,
+and
+.Fn getpwuid ,
+leave their results in an internal static object and return
+a pointer to that object. Subsequent calls to
+the same function
+will modify the same object.
+.Pp
 The routines
 The routines
-.IR getpwent ,
-.IR endpwent ,
-.IR setpassent ,
+.Fn getpwent ,
+.Fn endpwent ,
+.Fn setpassent ,
 and
 and
-.IR setpwent
+.Fn setpwent
 are fairly useless in a networked environment and should be
 avoided, if possible.
 are fairly useless in a networked environment and should be
 avoided, if possible.
-.SH COMPATIBILITY
+.Sh COMPATIBILITY
 The historic function
 The historic function
-.IR setpwfile ,
+.Xr setpwfile 3 ,
 which allowed the specification of alternate password databases,
 has been deprecated and is no longer available.
 which allowed the specification of alternate password databases,
 has been deprecated and is no longer available.
index fbae422..52d142c 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getttyent.3 6.6 (Berkeley) %G%
+.\"     @(#)getttyent.3        6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETTTYENT 3  ""
-.UC 6
-.SH NAME
-getttyent, getttynam, setttyent, endttyent \- get ttys file entry
-.SH SYNOPSIS
-.nf
-.B #include <ttyent.h>
-.PP
-.B struct ttyent *getttyent()
-.PP
-.B struct ttyent *getttynam(name)
-.B char *name;
-.PP
-.B setttyent()
-.PP
-.B endttyent()
-.fi
-.SH DESCRIPTION
-.I Getttyent,
+.Dd 
+.Dt GETTTYENT 3
+.Os BSD 4.3
+.Sh NAME
+.Nm getttyent ,
+.Nm getttynam ,
+.Nm setttyent ,
+.Nm endttyent
+.Nd get ttys file entry
+.Sh SYNOPSIS
+.Fd #include <ttyent.h>
+.Ft struct ttyent *
+.Fn getttyent
+.Ft struct ttyent *
+.Fn getttynam "char *name"
+.Ft int
+.Fn setttyent void
+.Ft int
+.Fn endttyent void
+.Sh DESCRIPTION
+The
+.Fn getttyent ,
 and
 and
-.I getttynam
+.Fn getttynam
+functions
 each return a pointer to an object, with the following structure,
 containing the broken-out fields of a line from the tty description
 file.
 each return a pointer to an object, with the following structure,
 containing the broken-out fields of a line from the tty description
 file.
-.sp
-.nf
+.Bd -literal
 struct ttyent {
 struct ttyent {
-       char    *ty_name;                       /* terminal device name */
-       char    *ty_getty;              /* command to execute */
-       char    *ty_type;                       /* terminal type */
+       char    *ty_name;       /* terminal device name */
+       char    *ty_getty;      /* command to execute */
+       char    *ty_type;       /* terminal type */
 #define        TTY_ON          0x01    /* enable logins */
 #define        TTY_SECURE      0x02    /* allow uid of 0 to login */
 #define        TTY_ON          0x01    /* enable logins */
 #define        TTY_SECURE      0x02    /* allow uid of 0 to login */
-       int     ty_status;              /* flag values */
-       char    *ty_window;             /* command for window manager */
-       char    *ty_comment;            /* comment field */
+       int     ty_status;      /* flag values */
+       char    *ty_window;     /* command for window manager */
+       char    *ty_comment;    /* comment field */
 };
 };
-.fi
-.PP
+.Ed
+.Pp
 The fields are as follows:
 The fields are as follows:
-.TP
-ty_name
+.Bl -tag -width ty_comment
+.It Fa ty_name
 The name of the character-special file.
 The name of the character-special file.
-.TP
-ty_getty
+.It Fa ty_getty
 The name of the command invoked by
 The name of the command invoked by
-.IR init (8)
+.Xr init 8
 to initialize tty line characteristics.
 to initialize tty line characteristics.
-.TP
-ty_type
+.It Fa ty_type
 The name of the default terminal type connected to this tty line.
 The name of the default terminal type connected to this tty line.
-.TP
-ty_status
+.It Fa ty_status
 A mask of bit fields which indicate various actions allowed on this
 tty line.
 The possible flags are as follows:
 A mask of bit fields which indicate various actions allowed on this
 tty line.
 The possible flags are as follows:
-.IP
-TTY_ON
-.IP
+.Bl -tag -width TTY_SECURE
+.It Dv TTY_ON
 Enables logins (i.e.,
 Enables logins (i.e.,
-.IR init (8)
+.Xr init 8
 will start the command referenced by
 will start the command referenced by
-.I ty_getty
+.Fa ty_getty
 on this entry).
 on this entry).
-.IP
-TTY_SECURE
-.IP
+.It Dv TTY_SECURE
 Allow users with a uid of 0 to login on this terminal.
 Allow users with a uid of 0 to login on this terminal.
-.TP
-ty_window
+.El
+.It Fa ty_window
 The command to execute for a window system associated with the line.
 The command to execute for a window system associated with the line.
-.TP
-ty_comment
+.It Fa ty_comment
 Any trailing comment field, with any leading hash marks (``#'') or
 whitespace removed.
 Any trailing comment field, with any leading hash marks (``#'') or
 whitespace removed.
-.PP
+.El
+.Pp
 If any of the fields pointing to character strings are unspecified,
 they are returned as null pointers.
 The field
 If any of the fields pointing to character strings are unspecified,
 they are returned as null pointers.
 The field
-.I ty_status
+.Fa ty_status
 will be zero if no flag values are specified.
 will be zero if no flag values are specified.
-.PP
+.Pp
 See
 See
-.IR ttys (5)
+.Xr ttys 5
 for a more complete discussion of the meaning and usage of the
 fields.
 for a more complete discussion of the meaning and usage of the
 fields.
-.PP
-.I Getttyent
+.Pp
+The
+.Fn getttyent
+function
 reads the next line from the ttys file, opening the file if necessary.
 reads the next line from the ttys file, opening the file if necessary.
-.I Setttyent
+The
+.Fn setttyent
+function
 rewinds the file if open, or opens the file if it is unopened.
 rewinds the file if open, or opens the file if it is unopened.
-.I Endttyent
+The
+.Fn endttyent
+function
 closes any open files.
 closes any open files.
-.PP
-.I Getttynam
+.Pp
+The
+.Fn getttynam
+function
 searches from the beginning of the file until a matching
 searches from the beginning of the file until a matching
-.I name
+.Fa name
 is found
 is found
-(or until EOF is encountered).
-.SH FILES
-/etc/ttys
-.SH "SEE ALSO"
-login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), init(8)
-.SH DIAGNOSTICS
+(or until
+.Dv EOF
+is encountered).
+.Sh RETURN VALUES
 The routines
 The routines
-.I getttyent
+.Fn getttyent
 and
 and
-.I getttynam
-return a null pointer on EOF or error.
-.I Setttyent
+.Fn getttynam
+return a null pointer on
+.Dv EOF
+or error.
+The
+.Fn setttyent
+function
 and
 and
-.I endttyent
+.Fn endttyent
 return 0 on failure and 1 on success.
 return 0 on failure and 1 on success.
-.SH BUGS
-All information is contained in a static area so it must be copied if
-it is to be saved.
+.Sh FILES
+.Bl -tag -width /etc/ttys -compact
+.It Pa /etc/ttys
+.El
+.Sh SEE ALSO
+.Xr login 1 ,
+.Xr ttyslot 3 ,
+.Xr gettytab 5 ,
+.Xr termcap 5 ,
+.Xr ttys 5 ,
+.Xr getty 8 ,
+.Xr init 8
+.Sh HISTORY
+The
+.Fn getttyent ,
+.Fn getttynam ,
+.Fn setttyent ,
+and
+.Fn endttyent
+functions appeared in
+.Bx 4.3 .
+.Sh BUGS
+These functions use static data storage;
+if the data is needed for future use, it should be
+copied before any subsequent calls overwrite it.
index 98bce93..1127769 100644 (file)
@@ -1,54 +1,71 @@
-.\" Copyright (c) 1985 The Regents of the University of California.
+.\" Copyright (c) 1985, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getusershell.3      6.4 (Berkeley) %G%
+.\"     @(#)getusershell.3     6.5 (Berkeley) %G%
 .\"
 .\"
-.TH GETUSERSHELL 3  ""
-.UC 6
-.SH NAME
-getusershell, setusershell, endusershell \- get legal user shells
-.SH SYNOPSIS
-.nf
-.B char *getusershell()
-.PP
-.B setusershell()
-.PP
-.B endusershell()
-.fi
-.SH DESCRIPTION
-.I Getusershell
+.Dd 
+.Dt GETUSERSHELL 3
+.Os BSD 4.3
+.Sh NAME
+.Nm getusershell ,
+.Nm setusershell ,
+.Nm endusershell
+.Nd get legal user shells
+.Sh SYNOPSIS
+.Ft char *
+.Fn getusershell void
+.Ft void
+.Fn setusershell void
+.Ft void
+.Fn endusershell void
+.Sh DESCRIPTION
+The
+.Fn getusershell
+function
 returns a pointer to a legal user shell as defined by the
 system manager in the file 
 returns a pointer to a legal user shell as defined by the
 system manager in the file 
-.IR /etc/shells .
+.Pa /etc/shells .
 If 
 If 
-.I /etc/shells
+.Pa /etc/shells
 is unreadable or does not exist,
 is unreadable or does not exist,
-.I getusershell
+.Fn getusershell
 behaves as if
 behaves as if
-.I /bin/sh
+.Pa /bin/sh
 and
 and
-.I /bin/csh
+.Pa /bin/csh
 were listed in the file.
 were listed in the file.
-.PP
-.I Getusershell
+.Pp
+The
+.Fn getusershell
+function
 reads the next
 line (opening the file if necessary);
 reads the next
 line (opening the file if necessary);
-.I setusershell
+.Fn setusershell
 rewinds the file;
 rewinds the file;
-.I endusershell
+.Fn endusershell
 closes it.
 closes it.
-.SH FILES
-/etc/shells
-.SH "SEE ALSO"
-shells(5)
-.SH DIAGNOSTICS
+.Sh FILES
+.Bl -tag -width /etc/shells -compact
+.It Pa /etc/shells
+.El
+.Sh DIAGNOSTICS
 The routine
 The routine
-.I getusershell
-returns a null pointer (0) on EOF.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.
+.Fn getusershell
+returns a null pointer (0) on
+.Dv EOF .
+.Sh SEE ALSO
+.Xr shells 5
+.Sh HISTORY
+The
+.Fn getusershell
+function appeared in 
+.Bx 4.3 .
+.Sh BUGS
+The
+.Fn getusershell
+function leaves its result in an internal static object and returns
+a pointer to that object. Subsequent calls to
+.Fn getusershell
+will modify the same object.
index de9c3f8..663497a 100644 (file)
@@ -1,40 +1,38 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Guido van Rossum.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Guido van Rossum.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)glob.3      5.3 (Berkeley) %G%
+.\"     @(#)glob.3     5.4 (Berkeley) %G%
 .\"
 .\"
-.TH GLOB 3 ""
-.UC 7
-.SH NAME
-glob, globfree \- generate pathnames matching a pattern
-.SH SYNOPSIS
-.nf
-#include <glob.h>
-
-glob(const char *pattern, int flags,
-       const int (*errfunc)(char *, int), glob_t *pglob);
-
-void globfree(glob_t *pglob);
-.fi
-.SH DESCRIPTION
-.I Glob
+.Dd 
+.Dt GLOB 3
+.Os
+.Sh NAME
+.Nm glob ,
+.Nm globfree
+.Nd generate pathnames matching a pattern
+.Sh SYNOPSIS
+.Fd #include <glob.h>
+.Ft int
+.Fn glob "const char *pattern" "int flags" "const int (*errfunc)(char *, int)" "glob_t *pglob"
+.Ft void 
+.Fn globfree "glob_t *pglob"
+.Sh DESCRIPTION
+The
+.Fn glob
+function
 is a pathname generator that implements the rules for file name pattern
 matching used by the shell.
 is a pathname generator that implements the rules for file name pattern
 matching used by the shell.
-.PP
+.Pp
 The include file
 The include file
-.I glob.h
+.Pa glob.h
 defines the structure type
 defines the structure type
-.IR glob_t ,
+.Fa glob_t ,
 which contains at least the following fields:
 which contains at least the following fields:
-.sp
-.RS
-.nf
-.ta .5i +\w'char **gl_pathv;\0\0\0'u
+.Bd -literal -offset indent
 typedef struct {
        int gl_pathc;           /* count of total paths so far */
        int gl_matchc;          /* count of paths matching pattern */
 typedef struct {
        int gl_pathc;           /* count of total paths so far */
        int gl_matchc;          /* count of paths matching pattern */
@@ -42,244 +40,289 @@ typedef struct {
        int gl_flags;           /* returned flags */
        char **gl_pathv;        /* list of paths matching pattern */
 } glob_t;
        int gl_flags;           /* returned flags */
        char **gl_pathv;        /* list of paths matching pattern */
 } glob_t;
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The argument
 The argument
-.I pattern
+.Fa pattern
 is a pointer to a pathname pattern to be expanded.
 is a pointer to a pathname pattern to be expanded.
-.I Glob
+The
+.Fn glob
+argument
 matches all accessible pathnames against the pattern and creates
 a list of the pathnames that match.
 In order to have access to a pathname,
 matches all accessible pathnames against the pattern and creates
 a list of the pathnames that match.
 In order to have access to a pathname,
-.I glob
+.Fn glob
 requires search permission on every component of a path except the last
 and read permission on each directory of any filename component of
 requires search permission on every component of a path except the last
 and read permission on each directory of any filename component of
-.I pattern
-that contains any of the special characters ``*'', ``?'' or ``[''.
-.PP
-.I Glob
+.Fa pattern
+that contains any of the special characters
+.Ql * ,
+.Ql ?
+or
+.Ql [ .
+.Pp
+The
+.Fn glob
+argument
 stores the number of matched pathnames into the
 stores the number of matched pathnames into the
-.I gl_pathc
+.Fa gl_pathc
 field, and a pointer to a list of pointers to pathnames into the
 field, and a pointer to a list of pointers to pathnames into the
-.I gl_pathv
+.Fa gl_pathv
 field.
 field.
-The first pointer after the last pathname is NULL.
+The first pointer after the last pathname is
+.Dv NULL . 
 If the pattern does not match any pathnames, the returned number of
 matched paths is set to zero.
 If the pattern does not match any pathnames, the returned number of
 matched paths is set to zero.
-.PP
+.Pp
 It is the caller's responsibility to create the structure pointed to by
 It is the caller's responsibility to create the structure pointed to by
-.IR pglob .
+.Fa pglob .
 The
 The
-.I glob
+.Fn glob
 function allocates other space as needed, including the memory pointed
 to by
 function allocates other space as needed, including the memory pointed
 to by
-.IR gl_pathv .
-.PP
+.Fa gl_pathv .
+.Pp
 The argument
 The argument
-.I flags
+.Fa flags
 is used to modify the behavior of
 is used to modify the behavior of
-.IR glob .
+.Fn glob .
 The value of
 The value of
-.I flags
-is the bitwise inclusive OR of any of the following
+.Fa flags
+is the bitwise inclusive
+.Tn OR
+of any of the following
 values defined in
 values defined in
-.IR glob.h :
-.TP
-GLOB_APPEND
+.Pa glob.h :
+.Bl -tag -width GLOB_NOCHECK
+.It Dv GLOB_APPEND
 Append pathnames generated to the ones from a previous call (or calls)
 to
 Append pathnames generated to the ones from a previous call (or calls)
 to
-.IR glob .
+.Fn glob .
 The value of
 The value of
-.I gl_pathc
+.Fa gl_pathc
 will be the total matches found by this call and the previous call(s).
 The pathnames are appended to, not merged with the pathnames returned by
 the previous call(s).
 Between calls, the caller must not change the setting of the
 will be the total matches found by this call and the previous call(s).
 The pathnames are appended to, not merged with the pathnames returned by
 the previous call(s).
 Between calls, the caller must not change the setting of the
-GLOB_DOOFFS flag, nor change the value of
-.I gl_offs
+.Dv GLOB_DOOFFS
+flag, nor change the value of
+.Fa gl_offs
 when
 when
-GLOB_DOOFFS is set, nor (obviously) call
-.I globfree
+.Dv GLOB_DOOFFS
+is set, nor (obviously) call
+.Fn globfree
 for
 for
-.I pglob.
-.TP
-GLOB_DOOFFS
+.Fa pglob .
+.It Dv GLOB_DOOFFS
 Make use of the
 Make use of the
-.I gl_offs
+.Fa gl_offs
 field.
 If this flag is set,
 field.
 If this flag is set,
-.I gl_offs
-is used to specify how many NULL pointers to prepend to the beginning
+.Fa gl_offs
+is used to specify how many
+.Dv NULL
+pointers to prepend to the beginning
 of the
 of the
-.I gl_pathv
+.Fa gl_pathv
 field.
 In other words,
 field.
 In other words,
-.I gl_pathv
+.Fa gl_pathv
 will point to
 will point to
-.I gl_offs
-NULL pointers,
+.Fa gl_offs
+.Dv NULL
+pointers,
 followed by
 followed by
-.I gl_pathc
-pathname pointers, followed by a NULL pointer.
-.TP
-GLOB_ERR
+.Fa gl_pathc
+pathname pointers, followed by a
+.Dv NULL
+pointer.
+.It Dv GLOB_ERR
 Causes
 Causes
-.I glob
+.Fn glob
 to return when it encounters a directory that it cannot open or read.
 Ordinarily,
 to return when it encounters a directory that it cannot open or read.
 Ordinarily,
-.I glob
+.Fn glob
 continues to find matches.
 continues to find matches.
-.TP
-GLOB_MARK
+.It Dv GLOB_MARK
 Each pathname that is a directory that matches
 Each pathname that is a directory that matches
-.I pattern
+.Fa pattern
 has a slash
 appended.
 has a slash
 appended.
-.TP
-GLOB_NOSORT
-By default, the pathnames are sorted in ascending ASCII order;
+.It Dv GLOB_NOSORT
+By default, the pathnames are sorted in ascending
+.Tn ASCII
+order;
 this flag prevents that sorting (speeding up
 this flag prevents that sorting (speeding up
-.IR glob ).
-.TP
-GLOB_NOCHECK
+.Fn glob ) .
+.It Dv GLOB_NOCHECK
 If
 If
-.I pattern
+.Fa pattern
 does not match any pathname, then
 does not match any pathname, then
-.I glob
+.Fn glob
 returns a list
 consisting of only
 returns a list
 consisting of only
-.IR pattern ,
+.Fa pattern ,
 with the number of total pathnames is set to 1, and the number of matched
 pathnames set to 0.
 If
 with the number of total pathnames is set to 1, and the number of matched
 pathnames set to 0.
 If
-.I GLOB_QUOTE
+.Dv GLOB_QUOTE
 is set, its effect is present in the pattern returned.
 is set, its effect is present in the pattern returned.
-.TP
-GLOB_QUOTE
-Use the backslash (``\e'') character for quoting: every occurrence of
+.It Dv GLOB_QUOTE
+Use the backslash
+.Pq Ql \e
+character for quoting: every occurrence of
 a backslash followed by a character in the pattern is replaced by that
 character, avoiding any special interpretation of the character.
 a backslash followed by a character in the pattern is replaced by that
 character, avoiding any special interpretation of the character.
-.PP
+.El
+.Pp
 If, during the search, a directory is encountered that cannot be opened
 or read and
 If, during the search, a directory is encountered that cannot be opened
 or read and
-.I errfunc
-is non-NULL,
-.I glob
-calls (*\fIerrfunc\fP)(\fIpath\fP, \fIerrno\fP).
-This may be unintuitive: a pattern like ``*/Makefile'' will try to
-.IR stat (2)
-``foo/Makefile'' even if ``foo'' is not a directory, resulting in a
+.Fa errfunc
+is
+.Pf non- Dv NULL , 
+.Fn glob
+calls
+.Fa (*errfunc)(path,errno) .
+This may be unintuitive: a pattern like
+.Ql */Makefile
+will try to
+.Xr stat 2
+.Ql foo/Makefile
+even if
+.Ql foo
+is not a directory, resulting in a
 call to
 call to
-.IR errfunc .
-The error routine can suppress this action by testing for ENOENT and
-ENOTDIR; however, the GLOB_ERR flag will still cause an immediate
+.Fa errfunc .
+The error routine can suppress this action by testing for
+.Dv ENOENT
+and
+.Dv ENOTDIR ; 
+however, the
+.Dv GLOB_ERR
+flag will still cause an immediate
 return when this happens.
 return when this happens.
-.PP
+.Pp
 If
 If
-.I errfunc
+.Fa errfunc
 returns non-zero,
 returns non-zero,
-.I glob
+.Fn glob
 stops the scan and returns
 stops the scan and returns
-.I GLOB_ABEND
+.Dv GLOB_ABEND
 after setting
 after setting
-.I gl_pathc
+.Fa gl_pathc
 and
 and
-.I gl_pathv
+.Fa gl_pathv
 to reflect any paths already matched.
 This also happens if an error is encountered and
 to reflect any paths already matched.
 This also happens if an error is encountered and
-.I GLOB_ERR
+.Dv GLOB_ERR
 is set in
 is set in
-.IR flags ,
+.Fa flags ,
 regardless of the return value of
 regardless of the return value of
-.IR errfunc ,
+.Fa errfunc ,
 if called.
 If
 if called.
 If
-.I GLOB_ERR
+.Dv GLOB_ERR
 is not set and either
 is not set and either
-.I errfunc
-is NULL or
-.I errfunc
+.Fa errfunc
+is
+.Dv NULL
+or
+.Fa errfunc
 returns zero, the error is ignored.
 returns zero, the error is ignored.
-.PP
+.Pp
 The
 The
-.I globfree
+.Fn globfree
 function frees any space associated with
 function frees any space associated with
-.I pglob
+.Fa pglob
 from a previous call(s) to
 from a previous call(s) to
-.IR glob .
-.SH RETURNS
+.Fn glob .
+.Sh RETURN VALUES
 On successful completion,
 On successful completion,
-.I glob
+.Fn glob
 returns zero.
 In addition the fields of
 returns zero.
 In addition the fields of
-.I pglob
+.Fa pglob
 contain the values described below:
 contain the values described below:
-.TP
-.I gl_pathc
+.Bl -tag -width GLOB_NOCHECK
+.It Fa gl_pathc
 contains the total number of matched pathnames so far.
 This includes other matches from previous invocations of 
 contains the total number of matched pathnames so far.
 This includes other matches from previous invocations of 
-.I glob 
+.Fn glob
 if 
 if 
-.I GLOB_APPEND 
+.Dv GLOB_APPEND
 was specified.
 was specified.
-.TP
-.I gl_matchc
+.It Fa gl_matchc
 contains the number of matched pathnames in the current invocation of
 contains the number of matched pathnames in the current invocation of
-.I glob.
-.TP
-.I gl_flags
+.Fn glob .
+.It Fa gl_flags
 contains a copy of the 
 contains a copy of the 
-.I flags 
-parameter with the bit GLOB_MAGCHAR set if
-.I pattern
+.Fa flags
+parameter with the bit
+.Dv GLOB_MAGCHAR
+set if
+.Fa pattern
 contained any of the special characters ``*'', ``?'' or ``['', cleared
 if not.
 contained any of the special characters ``*'', ``?'' or ``['', cleared
 if not.
-.TP
-.I gl_pathv
-contains a pointer to a NULL-terminated list of matched pathnames.
+.It Fa gl_pathv
+contains a pointer to a
+.Dv NULL Ns -terminated 
+list of matched pathnames.
 However, if
 However, if
-.I gl_pathc
+.Fa gl_pathc
 is zero, the contents of
 is zero, the contents of
-.I gl_pathv
+.Fa gl_pathv
 are undefined.
 are undefined.
-.PP
+.El
+.Pp
 If
 If
-.I glob
+.Fn glob
 terminates due to an error, it sets errno and returns one of the
 following non-zero constants, which are defined in the include
 terminates due to an error, it sets errno and returns one of the
 following non-zero constants, which are defined in the include
-file <glob.h>:
-.TP
-GLOB_NOSPACE
+file
+.Aq Pa glob.h :
+.Bl -tag -width GLOB_NOCHECK
+.It Dv GLOB_NOSPACE
 An attempt to allocate memory failed.
 An attempt to allocate memory failed.
-.TP
-GLOB_ABEND
+.It Dv GLOB_ABEND
 The scan was stopped because an error was encountered and either
 The scan was stopped because an error was encountered and either
-GLOB_ERR was set or (*\fIerrfunc\fR)() returned non-zero.
-.PP
+.Dv GLOB_ERR
+was set or
+.Fa (*errfunc)()
+returned non-zero.
+.El
+.Pp
 The arguments
 The arguments
-.I pglob->gl_pathc
+.Fa pglob\->gl_pathc
 and
 and
-.I pglob->gl_pathv
+.Fa pglob\->gl_pathv
 are still set as specified above.
 are still set as specified above.
-.SH STANDARDS
+.Sh SEE ALSO
+.Xr sh 1 ,
+.Xr fnmatch 3 ,
+.Xr wordexp 3 ,
+.Xr regexp 3
+.Sh STANDARDS
 The
 The
-.I glob
-function is expected to be POSIX 1003.2 compatible with the exception
+.Fn glob
+function is expected to be
+.St -p1003.2
+compatible with the exception
 that the flag 
 that the flag 
-.I GLOB_QUOTE 
+.Dv GLOB_QUOTE
 and the fields 
 and the fields 
-.I gl_matchc 
+.Fa gl_matchc
 and 
 and 
-.I gl_flags 
-should not be used by applications striving for strict POSIX conformance.
-.SH EXAMPLE
-A rough equivalent of ``ls -l *.c *.h'' can be obtained with the
+.Fa gl_flags
+should not be used by applications striving for strict
+.Tn POSIX
+conformance.
+.Sh EXAMPLE
+A rough equivalent of
+.Ql "ls -l *.c *.h"
+can be obtained with the
 following code:
 following code:
-.sp
-.nf
-.RS
-glob_t g;
+.Bd -literal -offset indent
+GLOB_t g;
 
 g.gl_offs = 2;
 glob("*.c", GLOB_DOOFFS, NULL, &g);
 
 g.gl_offs = 2;
 glob("*.c", GLOB_DOOFFS, NULL, &g);
@@ -287,21 +330,28 @@ glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g);
 g.gl_pathv[0] = "ls";
 g.gl_pathv[1] = "-l";
 execvp("ls", g.gl_pathv);
 g.gl_pathv[0] = "ls";
 g.gl_pathv[1] = "-l";
 execvp("ls", g.gl_pathv);
-.RE
-.fi
-.SH SEE ALSO
-sh(1), fnmatch(3), wordexp(3), regexp(3)
-.SH BUGS
-Patterns longer than MAXPATHLEN may cause unchecked errors.
-.PP
-.I Glob
+.Ed
+.Sh HISTORY
+The
+.Fn glob
+and
+.Fn globfree
+functions are
+.Ud .
+.Sh BUGS
+Patterns longer than
+.Dv MAXPATHLEN
+may cause unchecked errors.
+.Pp
+The
+.Fn glob
+argument
 may fail and set errno for any of the errors specified for the
 library routines
 may fail and set errno for any of the errors specified for the
 library routines
-.I stat (2),
-.I closedir (3),
-.I opendir (3),
-.I readdir (3),
-.I malloc (3),
+.Xr stat 2 ,
+.Xr closedir 3 ,
+.Xr opendir 3 ,
+.Xr readdir 3 ,
+.Xr malloc 3 ,
 and
 and
-.I free (3).
-
+.Xr free 3 .
index fa45a03..0fef91e 100644 (file)
@@ -1,44 +1,58 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)initgroups.3        6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH INITGROUPS 3 ""
-.UC 5
-.SH NAME
-initgroups \- initialize group access list
-.SH SYNOPSIS
-.B initgroups(name, basegid)
-.br
-.B char *name;
-.br
-.B int basegid;
-.SH DESCRIPTION
-.I Initgroups
+.\"     @(#)initgroups.3       6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt INITGROUPS 3
+.Os BSD 4.2
+.Sh NAME
+.Nm initgroups
+.Nd initialize group access list
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn initgroups "const char *name" "int basegid"
+.Sh DESCRIPTION
+The
+.Fn initgroups
+function
 reads through the group file and sets up,
 using the
 reads through the group file and sets up,
 using the
-.IR setgroups (2)
+.Xr setgroups 2
 call, the group access list for the user
 specified in
 call, the group access list for the user
 specified in
-.IR name .
+.Fa name .
 The
 The
-.I basegid
+.Fa basegid
 is automatically included in the groups list.
 Typically this value is given as
 the group number from the password file.
 is automatically included in the groups list.
 Typically this value is given as
 the group number from the password file.
-.SH FILES
-/etc/group
-.SH SEE ALSO
-setgroups(2)
-.SH DIAGNOSTICS
-.I Initgroups
+.Sh RETURN VALUES
+The
+.Fn initgroups
+function
 returns \-1 if it was not invoked by the super-user.
 returns \-1 if it was not invoked by the super-user.
-.SH BUGS
-.I Initgroups
+.Sh FILES
+.Bl -tag -width /etc/group -compact
+.It Pa /etc/group
+.El
+.Sh SEE ALSO
+.Xr setgroups 2 ,
+.Sh HISTORY
+The
+.Nm
+function appeared in 
+.Bx 4.2 .
+.Sh BUGS
+The
+.Fn initgroups
+function
 uses the routines based on
 uses the routines based on
-.IR getgrent (3).
+.Xr getgrent 3 .
 If the invoking program uses any of these routines,
 the group structure will
 be overwritten in the call to
 If the invoking program uses any of these routines,
 the group structure will
 be overwritten in the call to
-.IR initgroups .
+.Fn initgroups .
index 6e3554b..0cfb71c 100644 (file)
@@ -1,44 +1,41 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)nice.3      6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH NICE 3C ""
-.UC 4
-.SH NAME
-nice \- set program priority
-.SH SYNOPSIS
-.B nice(incr)
-.SH DESCRIPTION
-.ft B
+.\"     @(#)nice.3     6.2 (Berkeley) %G%
+.\"
+.Dd 
+.Dt NICE 3
+.Os BSD 4
+.Sh NAME
+.Nm nice
+.Nd set program scheduling priority
+.Sh SYNOPSIS
+.Fn nice "int incr"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is obsoleted by setpriority(2).
 This interface is obsoleted by setpriority(2).
-.ft R
-.PP
-The scheduling
-priority of the process is augmented by
-.IR incr .
-Positive priorities get less
-service than normal.
-Priority 10 is recommended to users
-who wish to execute long-running programs
-without flak from the administration.
-.PP
-Negative increments are ignored except on behalf of 
-the super-user.
-The priority is limited to the range
-\-20 (most urgent) to 20 (least).
-.PP
-The priority of a process is
-passed to a child process by
-.IR fork (2).
-For a privileged process to return to normal priority
-from an unknown state,
-.I nice
-should be called successively with arguments
-\-40 (goes to priority \-20 because of truncation),
-20 (to get to 0),
-then 0 (to maintain compatibility with previous versions
-of this call).
-.SH "SEE ALSO"
-nice(1), setpriority(2), fork(2), renice(8)
+.Ef
+.Pp
+The
+.Fn nice
+function obtains the scheduling priority of the process
+from the system and sets it to the priority value specified in
+.Fa incr .
+The priority is a value in the range -20 to 20.
+The default priority is 0; lower priorities cause more favorable scheduling.
+Only the super-user may lower priorities.
+.Pp
+Children inherit the priority of their parent processes via
+.Xr fork 2 .
+.Sh SEE ALSO
+.Xr nice 1 ,
+.Xr setpriority 2 ,
+.Xr fork 2 ,
+.Xr renice 8
+.Sh HISTORY
+A
+.Fn nice
+syscall appeared in 
+.At v6 .
index 144c9b0..d4a01d5 100644 (file)
@@ -1,43 +1,52 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)nlist.3     6.1 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH NLIST 3  ""
-.UC 4
-.SH NAME
-nlist \- get entries from name list
-.SH SYNOPSIS
-.nf
-.B #include <nlist.h>
-.PP
-.B nlist(filename, nl)
-.B char *filename;
-.B struct nlist nl[];
-.fi
-.SH DESCRIPTION
-.I Nlist
-examines the name list in the given executable output file
-and selectively extracts a list of values.
-The name list consists of an array of structures containing names,
-types and values.
-The list is terminated with a null name.
-Each name is looked up in the name list of the file.
-If the name is found, the type and value of the
-name are inserted in the next two fields.
-If the name is not found, both entries are set to 0.
-See
-.IR a.out (5)
-for the structure declaration.
-.PP
-This subroutine is useful for examining the system name list kept in the file
-.BR /vmunix .
-In this way programs can obtain system addresses that are up to date.
-.SH "SEE ALSO"
-a.out(5)
-.SH DIAGNOSTICS
-If the file cannot be found or if it is not a valid namelist \-1 is returned;
-otherwise, the number of unfound namelist entries is returned.
-.PP
-The type entry is set to 0 if the symbol is not found.
+.\"     @(#)nlist.3    6.2 (Berkeley) %G%
+.\"
+.Dd 
+.Dt NLIST 3
+.Os BSD 4
+.Sh NAME
+.Nm nlist
+.Nd retrieve symbol table name list from an executable file
+.Sh SYNOPSIS
+.Fd #include <nlist.h>
+.Ft int
+.Fn nlist "const char *filename" "struct nlist *nl"
+.Sh DESCRIPTION
+The
+.Fn nlist
+function
+retrieves name list entries from the symbol table of an
+exectutable file. (See
+.Xr a.out 5 . )
+The argument
+.Fa \&nl
+is set to reference the
+beginning of the list.
+The list is preened of binary and invalid data;
+if an entry in the
+name list is valid, the
+.Fa n_type
+and
+.Fa n_value
+for the entry are copied into the list
+referenced by
+.Fa \&nl .
+No other data is copied.
+The last entry in the list is always
+.Dv NULL .
+.Sh RETURN VALUES
+The number of invalid entries is returned if successful; otherwise,
+if the file
+.Fa filename
+does not exist or is not exectuable, the returned value is \-1.
+.Sh SEE ALSO
+.Xr a.out 5
+.Sh HISTORY
+A
+.Fn nlist
+function appeared in
+.At v6 .
index 71fbbeb..43aaf96 100644 (file)
@@ -1,39 +1,58 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)pause.3     6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH PAUSE 3 ""
-.UC 4
-.SH NAME
-pause \- stop until signal
-.SH SYNOPSIS
-.B pause()
-.SH DESCRIPTION
-.ft B
+.\"     @(#)pause.3    6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt PAUSE 3
+.Os BSD 4
+.Sh NAME
+.Nm pause
+.Nd stop until signal
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn pause void
+.Sh DESCRIPTION
+.Bf -symbolic
 Pause is made obsolete by sigpause(3).
 Pause is made obsolete by sigpause(3).
-.ft R
-.PP
-.I Pause
-never returns normally.
-It is used to give up control while waiting for
-a signal from
-.IR kill (2)
-or an interval timer, see
-.IR setitimer (2).
+.Ef
+.Pp
+The
+.Fn pause
+function
+forces a process to pause until
+a signal is received from either the
+.Xr kill 2
+function
+or an interval timer.
+(See
+.Xr setitimer 2 . )
 Upon termination of a signal handler started during a
 Upon termination of a signal handler started during a
-.I pause,
+.Fn pause ,
 the
 the
-.I pause
+.Fn pause
 call will return.
 call will return.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Always returns \-1.
 Always returns \-1.
-.SH ERRORS
-.I Pause
+.Sh ERRORS
+The
+.Fn pause
+function
 always returns:
 always returns:
-.TP 15
-[EINTR]
+.Bl -tag -width [EINTR]
+.It Bq Er EINTR
 The call was interrupted.
 The call was interrupted.
-.SH "SEE ALSO
-kill(2), select(2), sigpause(2)
+.El
+.Sh SEE ALSO
+.Xr kill 2 ,
+.Xr select 2 ,
+.Xr sigpause 2
+.Sh HISTORY
+A
+.Fn pause
+syscall
+appeared in 
+.At v6 .
index 67da31a..fcf574c 100644 (file)
@@ -1,49 +1,54 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)psignal.3   6.1 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH PSIGNAL 3 ""
-.UC 5
-.SH NAME
-psignal, sys_siglist \- system signal messages
-.SH SYNOPSIS
-.nf
-.B psignal(sig, s)
-.B unsigned sig;
-.B char *s;
-.PP
-.B char *sys_siglist[];
-.fi
-.SH DESCRIPTION
-.I Psignal
-produces a short message
-on the standard error file
-describing the indicated signal.
-First the argument string
-.I s
-is printed, then a colon, then the name of the signal
-and a new-line.
-Most usefully, the argument string is the name
-of the program which incurred the signal.
-The signal number should be from among those found
-in
-.IR <signal.h> .
-.PP
-To simplify variant formatting
-of signal names, the vector of message strings
-.I sys_siglist
-is provided;
-the signal number
-can be used as an index in this table to get the
-signal name without the newline.
-The define NSIG defined in
-.RI < signal.h >
-is the number of messages provided for in the table;
-it should be checked because new
-signals may be added to the system before
-they are added to the table.
-.SH "SEE ALSO"
-sigvec(2),
-perror(3)
+.\"     @(#)psignal.3  6.2 (Berkeley) %G%
+.\"
+.Dd 
+.Dt PSIGNAL 3
+.Os BSD 4.2
+.Sh NAME
+.Nm psignal ,
+.Nm sys_siglist
+.Nd system signal messages
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft void
+.Fn psignal "unsigned sig" "const char *s"
+.Vt extern char *sys_siglist[];
+.Sh DESCRIPTION
+The
+.Fn psignal
+function locates the descriptive message
+string for the given signal
+.Fa sig
+number
+and writes it to the
+.Em stderr .
+.Pp
+If the argument
+.Fa s
+is
+.Pf non- Dv NULL
+it is written to the
+.Em stderr
+prior to the message string.
+The signal number should be from among those found in
+.Aq Pa signal.h .
+.Pp
+The message strings can be accessed directly
+using the external character array
+.Va sys_siglist .
+The defined variable
+.Dv NSIG
+contains a count of the messages in
+.Va sys_siglist .
+.Sh SEE ALSO
+.Xr sigaction 2 ,
+.Xr perror 3
+.Sh HISTORY
+The
+.Fn psignal
+function appeared in 
+.Bx 4.2 .
index 0d450e6..d0469ac 100644 (file)
@@ -1,53 +1,74 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)pwcache.3   5.3 (Berkeley) %G%
+.\"     @(#)pwcache.3  5.4 (Berkeley) %G%
 .\"
 .\"
-.TH PWCACHE 3 ""
-.UC 7
-.SH NAME
-pwcache \- cache password and group entries
-.SH SYNOPSIS
-.ft B
-.nf
-user_from_uid(uid, nouser)
-uid_t uid;
-int nouser;
-
-group_from_gid(gid, nogroup)
-gid_t gid;
-int nogroup;
-.fi
-.ft R
-.SH DESCRIPTION
-.ft B
+.Dd 
+.Dt PWCACHE 3
+.Os
+.Sh NAME
+.Nm pwcache
+.Nd cache password and group entries
+.Sh SYNOPSIS
+.Fn user_from_uid "uid_t uid" "int nouser"
+.Fn group_from_gid "gid_t gid" "int nogroup"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is not part of the C library.
 It has been placed in the Berkeley utility library, libutil, as it is
 used by several standard utilities.
 This interface is not part of the C library.
 It has been placed in the Berkeley utility library, libutil, as it is
 used by several standard utilities.
-.ft R
-.PP
+.Ef
+.Pp
 The
 The
-.I user_from_uid
-function returns the user name associated with the argument uid.
-The user name is cached so that multiple calls with the same uid 
+.Fn user_from_uid
+function returns the user name associated with the argument
+.Fa uid .
+The user name is cached so that multiple calls with the same
+.Fa uid 
 do not require additional calls to
 do not require additional calls to
-.IR getpwuid (3).
-If there is no user associated with the uid, a pointer is returned
-to an ASCII representation of the uid, unless the argument
-.I nouser
-is non-zero, in which case a NULL pointer is returned.
-.PP
+.Xr getpwuid 3 .
+If there is no user associated with the
+.Fa uid ,
+a pointer is returned
+to an
+.Tn ASCII
+representation of the
+.Fa uid ,
+unless the argument
+.Fa nouser
+is non-zero, in which case a
+.Dv NULL
+pointer is returned.
+.Pp
 The
 The
-.I group_from_gid
-function returns the group name associated with the argument gid.
-The group name is cached so that multiple calls with the same gid
+.Fn group_from_gid
+function returns the group name associated with the argument
+.Fa gid .
+The group name is cached so that multiple calls with the same
+.Fa gid
 do not require additional calls to
 do not require additional calls to
-.IR getgrgid (3).
-If there is no group associated with the gid, a pointer is returned
-to an ASCII representation of the gid, unless the argument
-.I nogroup
-is non-zero, in which case a NULL pointer is returned.
-.SH SEE ALSO
-getgrgid(3), getpwuid(3)
+.Xr getgrgid 3 .
+If there is no group associated with the
+.Fa gid ,
+a pointer is returned
+to an
+.Tn ASCII
+representation of the
+.Fa gid ,
+unless the argument
+.Fa nogroup
+is non-zero, in which case a
+.Dv NULL
+pointer is returned.
+.Sh SEE ALSO
+.Xr getgrgid 3 ,
+.Xr getpwuid 3
+.Sh HISTORY
+The
+.Fn user_from_id
+and
+.Fn group_from_id
+functions are
+.Ud .
index 557e530..c352805 100644 (file)
@@ -1,37 +1,47 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)raise.3     5.1 (Berkeley) %G%
+.\"     @(#)raise.3    5.2 (Berkeley) %G%
 .\"
 .\"
-.TH RAISE 3 ""
-.UC 7
-.SH NAME
-raise \- send a signal to the current process
-.SH SYNOPSIS
-int raise(int sig);
-.SH DESCRIPTION
+.Dd 
+.Dt RAISE 3
+.Os
+.Sh NAME
+.Nm raise
+.Nd send a signal to the current process
+.Sh SYNOPSIS
+.Fd #include <signal.h>
+.Ft int
+.Fn raise "int sig"
+.Sh DESCRIPTION
 The
 The
-.I raise
+.Fn raise
 function sends the signal
 function sends the signal
-.I sig
+.Fa sig
 to the current process.
 to the current process.
-.SH RETURNS
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of -1 is returned and
-.I errno
+Otherwise, a value of \-1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Raise
+.Sh ERRORS
+The
+.Fn raise
+function
 may fail and set
 may fail and set
-.I errno
-for any of the errors specified for the library function
-.IR getpid(2)
+.Va errno
+for any of the errors specified for the
+library functions
+.Xr getpid 2
 and
 and
-.IR kill(2).
-.SH SEE ALSO
-kill(2)
-.SH STANDARDS
-.I Raise
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Xr kill 2 .
+.Sh SEE ALSO
+.Xr kill 2
+.Sh STANDARDS
+The
+.Fn raise
+function
+conforms to
+.St -ansiC .
index 3c1a54a..c6f5f69 100644 (file)
@@ -1,72 +1,80 @@
-.\" Copyright (c) 1983 Regents of the University of California.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)scandir.3   6.7 (Berkeley) %G%
+.\"     @(#)scandir.3  6.8 (Berkeley) %G%
 .\"
 .\"
-.TH SCANDIR 3  ""
-.UC 5
-.SH NAME
-scandir, alphasort \- scan a directory
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <dirent.h>
-
-scandir(dirname, namelist, select, compar)
-char *dirname;
-struct dirent ***namelist;
-int (*select)();
-int (*compar)();
-
-alphasort(d1, d2)
-void *d1, *d2;
-.ft R
-.fi
-.SH DESCRIPTION
-.I Scandir
+.Dd 
+.Dt SCANDIR 3
+.Os BSD 4.2
+.Sh NAME
+.Nm scandir ,
+.Nm alphasort
+.Nd scan a directory
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <dirent.h>
+.Ft int
+.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpstruct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst void *, const void *\\*(rp"
+.Ft int
+.Fn alphasort "const void *d1" "const void *d2"
+.Sh DESCRIPTION
+The
+.Fn scandir
+function
 reads the directory
 reads the directory
-.I dirname
+.Fa dirname
 and builds an array of pointers to directory
 entries using
 and builds an array of pointers to directory
 entries using
-.IR malloc (3).
+.Xr malloc 3 .
 It returns the number of entries in the array.
 A pointer to the array of directory entries is stored in the location
 referenced by
 It returns the number of entries in the array.
 A pointer to the array of directory entries is stored in the location
 referenced by
-.IR namelist .
-.PP
+.Fa namelist .
+.Pp
 The
 The
-.I select
+.Fa select
 parameter is a pointer to a user supplied subroutine which is called by
 parameter is a pointer to a user supplied subroutine which is called by
-.I scandir
+.Fn scandir
 to select which entries are to be included in the array.
 The select routine is passed a
 pointer to a directory entry and should return a non-zero
 value if the directory entry is to be included in the array.
 If
 to select which entries are to be included in the array.
 The select routine is passed a
 pointer to a directory entry and should return a non-zero
 value if the directory entry is to be included in the array.
 If
-.I select
+.Fa select
 is null, then all the directory entries will be included.
 is null, then all the directory entries will be included.
-.PP
+.Pp
 The
 The
-.I compar
+.Fa compar
 parameter is a pointer to a user supplied subroutine which is passed to
 parameter is a pointer to a user supplied subroutine which is passed to
-.IR qsort (3)
+.Xr qsort 3
 to sort the completed array.
 If this pointer is null, the array is not sorted.
 to sort the completed array.
 If this pointer is null, the array is not sorted.
-.PP
-.I Alphasort
+.Pp
+The
+.Fn alphasort
+function
 is a routine which can be used for the
 is a routine which can be used for the
-.I compar
+.Fa compar
 parameter to sort the array alphabetically.
 parameter to sort the array alphabetically.
-.PP
+.Pp
 The memory allocated for the array can be deallocated with
 The memory allocated for the array can be deallocated with
-.IR free (3),
+.Xr free 3 ,
 by freeing each pointer in the array and then the array itself.
 by freeing each pointer in the array and then the array itself.
-.SH "SEE ALSO"
-directory(3), malloc(3), qsort(3), dir(5)
-.SH DIAGNOSTICS
+.Sh DIAGNOSTICS
 Returns \-1 if the directory cannot be opened for reading or if
 Returns \-1 if the directory cannot be opened for reading or if
-.IR malloc (3)
+.Xr malloc 3
 cannot allocate enough memory to hold all the data structures.
 cannot allocate enough memory to hold all the data structures.
+.Sh SEE ALSO
+.Xr directory 3 ,
+.Xr malloc 3 ,
+.Xr qsort 3 ,
+.Xr dir 5
+.Sh HISTORY
+The
+.Fn scandir
+and
+.Fn alphasort
+functions appeared in 
+.Bx 4.2 .
index e018995..193a22b 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)setjmp.3    6.4 (Berkeley) %G%
+.\"     @(#)setjmp.3   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH SETJMP 3 ""
-.UC 4
-.SH NAME
-sigsetjmp, siglongjmp, setjmp, longjmp, _setjmp, _longjmp longjmperror \-
-non-local jumps
-.SH SYNOPSIS
-.nf
-.ft B
-#include <setjmp.h>
-
-sigsetjmp(sigjmp_buf env, int savemask);
-
-void
-siglongjmp(sigjmp_buf env, int val);
-
-setjmp(jmp_buf env);
-
-void
-longjmp(jmp_buf env, int val);
-
-_setjmp(jmp_buf env);
-
-void
-_longjmp(jmp_buf env, int val);
-
-void
-longjmperror();
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt SETJMP 3
+.Os BSD 4
+.Sh NAME
+.Nm sigsetjmp ,
+.Nm siglongjmp ,
+.Nm setjmp ,
+.Nm longjmp ,
+.Nm _setjmp ,
+.Nm _longjmp longjmperror
+.Nd non-local jumps
+.Sh SYNOPSIS
+.Fd #include <setjmp.h>
+.Ft int
+.Fn sigsetjmp "sigjmp_buf env" "int savemask"
+.Ft void
+.Fn siglongjmp "sigjmp_buf env" "int val"
+.Ft int
+.Fn setjmp "jmp_buf env"
+.Ft void
+.Fn longjmp "jmp_buf env" "int val"
+.Ft int
+.Fn _setjmp "jmp_buf env"
+.Ft void
+.Fn _longjmp "jmp_buf env" "int val"
+.Ft void
+.Fn longjmperror void
+.Sh DESCRIPTION
 The
 The
-.IR sigsetjmp ,
-.IR setjmp ,
+.Fn sigsetjmp ,
+.Fn setjmp ,
 and
 and
-.IR _setjmp
+.Fn _setjmp
 functions save their calling environment in
 functions save their calling environment in
-.IR env . 
+.Fa env .
 Each of these functions returns 0.
 Each of these functions returns 0.
-.PP
+.Pp
 The corresponding 
 The corresponding 
-.I longjmp
-functions restore the environment saved by their respective versions
+.Fn longjmp
+functions restore the environment saved by their most recent respective
+invocations
 of the
 of the
-.I setjmp
+.Fn setjmp
 function.
 function.
-They then return so that program execution continues as if the
-.I setjmp
-call had returned 
-.IR val ,
+They then return so that program execution continues as if the corresponding
+invocation of the
+.Fn setjmp
+call had just returned  the value specified by
+.Fa val ,
 instead of 0.
 instead of 0.
-.PP
+.Pp
 Pairs of calls may be intermixed, i.e. both 
 Pairs of calls may be intermixed, i.e. both 
-.I sigsetjmp
+.Fn sigsetjmp
 and
 and
-.I siglongjmp
+.Fn siglongjmp
 and
 and
-.I setjmp
+.Fn setjmp
 and
 and
-.I longjmp
+.Fn longjmp
 combinations may be used in the same program, however, individual
 calls may not, i.e. the 
 combinations may be used in the same program, however, individual
 calls may not, i.e. the 
-.I env
+.Fa env
 argument to 
 argument to 
-.I sigsetjmp
+.Fn sigsetjmp
 may not be passed to
 may not be passed to
-.IR longjmp .
-.PP
+.Fn longjmp .
+.Pp
 The
 The
-.I longjmp
+.Fn longjmp
 routines may not be called after the routine which called the
 routines may not be called after the routine which called the
-.I setjmp
+.Fn setjmp
 routines returns.
 routines returns.
-.PP
-All accessible data have values as of the time the
-.I longjmp
-routine was called.
-.PP
-.I Setjmp/longjmp
-pairs save and restore the signal mask (see 
-.IR sigmask (2)),
-while
-.I _setjmp/_longjmp
+.Pp
+All accessible objects have values as of the time
+.Fn longjmp
+routine was called, except that the values of objects of automatic storage
+invocation duration that do not have the
+.Em volatile
+type and have been changed between the
+.Fn setjmp
+invocation and
+.Fn longjmp
+call are indeterminate.
+.Pp
+The
+.Pa setjmp/longjmp
+pairs save and restore the signal mask while
+.Pa _setjmp/_longjmp
 pairs save and restore only the register set and the stack.
 pairs save and restore only the register set and the stack.
-.PP
-.I Sigsetjmp/siglongjmp
+(See 
+.Fn sigmask 2 . )
+.Pp
+The
+.Pa sigsetjmp/siglongjmp
+function
 pairs save and restore the signal mask if the argument
 pairs save and restore the signal mask if the argument
-.I savemask
+.Fa savemask
 is non-zero, otherwise only the register set and the stack are saved.
 is non-zero, otherwise only the register set and the stack are saved.
-.SH ERRORS
+.Sh ERRORS
 If the contents of the
 If the contents of the
-.I env
+.Fa env
 are corrupted, or correspond to an environment that has already returned,
 the 
 are corrupted, or correspond to an environment that has already returned,
 the 
-.I longjmp
+.Fn longjmp
 routine calls the routine
 routine calls the routine
-.IR longjmperror (3).
+.Fn longjmperror 3 .
 If
 If
-.I longjmperror
-returns the program is aborted (see abort(2)).
+.Fn longjmperror
+returns the program is aborted (see
+.Xr abort 2 ) .
 The default version of 
 The default version of 
-.I longjmperror
-prints the message ``longjmp botch'' to standard error and returns.
+.Fn longjmperror
+prints the message
+.Dq Li longjmp botch
+to standard error and returns.
 User programs wishing to exit more gracefully should write their own
 versions of 
 User programs wishing to exit more gracefully should write their own
 versions of 
-.IR longjmperror .
-.SH "SEE ALSO"
-sigvec(2), sigstack(2), signal(3)
+.Fn longjmperror .
+.Sh SEE ALSO
+.Xr sigaction 2 ,
+.Xr sigstack 2 ,
+.Xr signal 3
+.\" .Sh HISTORY
+.\ The
+.\ .Nm
+.\ function appeared in Version 7 AT&T UNIX.
index be4c70f..4003bc7 100644 (file)
@@ -1,65 +1,79 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)setmode.3   5.3 (Berkeley) %G%
+.\"     @(#)setmode.3  5.4 (Berkeley) %G%
 .\"
 .\"
-.TH SETMODE 3 ""
-.UC 7
-.SH NAME
-getmode, setmode \- modify mode bits
-.SH SYNOPSIS
-.nf
-.ft B
-getmode(set, mode)
-mode_t *set, mode;
-
-set = setmode(mode_str)
-mode_t *set;
-char *mode_str;
-.ft R
-.fi
-.SH DESCRIPTION
-.I Getmode
+.Dd 
+.Dt SETMODE 3
+.Os
+.Sh NAME
+.Nm getmode ,
+.Nm setmode
+.Nd modify mode bits
+.Sh SYNOPSIS
+.Ft mode_t
+.Fn getmode "const void *set" "mode_t mode"
+.Ft void
+.Fn setmode "const char *mode_str"
+.Sh DESCRIPTION
+The
+.Fn getmode
+function
 returns a copy of the file permission bits
 returns a copy of the file permission bits
-.I mode
+.Fa mode
 as altered by the values pointed to by
 as altered by the values pointed to by
-.IR set .
+.Fa set .
 While only the mode bits are altered, other parts of the file mode
 may be examined.
 While only the mode bits are altered, other parts of the file mode
 may be examined.
-.PP
-.I Setmode
+.Pp
+The
+.Fn setmode
+function
 takes an absolute (octal) or symbolic value, as described in
 takes an absolute (octal) or symbolic value, as described in
-.IR chmod (1),
+.Xr chmod 1 ,
 as an argument
 and returns a pointer to mode values to be supplied to
 as an argument
 and returns a pointer to mode values to be supplied to
-.IR getmode .
+.Fn getmode .
 Because some of the symbolic values are relative to the file
 creation mask,
 Because some of the symbolic values are relative to the file
 creation mask,
-.I setmode
+.Fn setmode
 may call
 may call
-.IR umask (2).
+.Xr umask 2 .
 If this occurs, the file creation mask will be restored before
 If this occurs, the file creation mask will be restored before
-.I setmode
+.Fn setmode
 returns.
 If the calling program changes the value of its file creation mask
 after calling
 returns.
 If the calling program changes the value of its file creation mask
 after calling
-.IR setmode ,
-.I setmode
+.Fn setmode ,
+.Fn setmode
 must be called again if
 must be called again if
-.I getmode
+.Fn getmode
 is to modify future file modes correctly.
 is to modify future file modes correctly.
-.PP
+.Pp
 If the mode passed to
 If the mode passed to
-.I setmode
+.Fn setmode
 is invalid,
 is invalid,
-.I setmode
-returns NULL.
-.SH ERRORS
-.I Setmode
+.Fn setmode
+returns
+.Dv NULL . 
+.Sh ERRORS
+The
+.Fn setmode
+function
 may fail and set errno for any of the errors specified for the library
 routine
 may fail and set errno for any of the errors specified for the library
 routine
-.IR malloc (3).
-.SH SEE ALSO
-chmod(1), stat(2), umask(2), malloc(3)
+.Xr malloc 3 .
+.Sh SEE ALSO
+.Xr chmod 1 ,
+.Xr stat 2 ,
+.Xr umask 2 ,
+.Xr malloc 3
+.Sh HISTORY
+The
+.Fn getmode
+and
+.Fn setmode
+functions are
+.Ud .
index 8da3cf6..0754d38 100644 (file)
@@ -1,56 +1,80 @@
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)siginterrupt.3      6.1 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SIGINTERRUPT 3 ""
-.UC 6
-.SH NAME
-siginterrupt \- allow signals to interrupt system calls
-.SH SYNOPSIS
-.nf
-.B siginterrupt(sig, flag);
-.B int sig, flag;
-.SH DESCRIPTION
-.I Siginterrupt
+.\"     @(#)siginterrupt.3     6.2 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SIGINTERRUPT 3
+.Os BSD 4.3
+.Sh NAME
+.Nm siginterrupt
+.Nd allow signals to interrupt system calls
+.Sh SYNOPSIS
+.Fd #include <signal.h>
+.Ft int
+.Fn siginterrupt "int sig" "int flag"
+.Sh DESCRIPTION
+The
+.Fn siginterrupt
+function
 is used to change the system call restart
 behavior when a system call is interrupted by the specified signal.
 If the flag is false (0), then system calls will be restarted if
 they are interrupted by the specified signal
 and no data has been transferred yet.
 is used to change the system call restart
 behavior when a system call is interrupted by the specified signal.
 If the flag is false (0), then system calls will be restarted if
 they are interrupted by the specified signal
 and no data has been transferred yet.
-System call restart is the default behavior on 4.2 BSD.
-.PP
-If the flag is true (1), then restarting of system calls is disabled.
+System call restart is the default behavior on
+.Bx 4.2 .
+.Pp
+If the flag is true (1),
+then restarting of system calls is disabled.
 If a system call is interrupted by the specified signal
 and no data has been transferred,
 If a system call is interrupted by the specified signal
 and no data has been transferred,
-the system call will return -1 with errno set to EINTR.
+the system call will return \-1 with the global variable
+.Va errno
+set to
+.Dv EINTR . 
 Interrupted system calls that have started transferring
 data will return the amount of data actually transferred.
 Interrupted system calls that have started transferring
 data will return the amount of data actually transferred.
-System call interrupt is the signal behavior found on 4.1 BSD
-and AT&T System V UNIX systems.
-.PP
-Note that the new 4.2 BSD signal handling semantics are not
+System call interrupt is the signal behavior found on
+.Bx 4.1
+and
+.At V
+systems.
+.Pp
+Note that the new
+.Bx 4.2
+signal handling semantics are not
 altered in any other way.
 Most notably, signal handlers always remain installed until
 explicitly changed by a subsequent
 altered in any other way.
 Most notably, signal handlers always remain installed until
 explicitly changed by a subsequent
-.IR sigvec (2)
+.Xr sigaction 2
 call, and the signal mask operates as documented in
 call, and the signal mask operates as documented in
-.IR sigvec (2).
+.Xr sigaction 2 .
 Programs may switch between restartable and interruptible
 system call operation as often as desired in the execution of a program.
 Programs may switch between restartable and interruptible
 system call operation as often as desired in the execution of a program.
-.PP
+.Pp
 Issuing a
 Issuing a
-.IR siginterrupt (3)
+.Fn siginterrupt 3
 call during the execution of a signal handler will cause
 the new action to take place on the next signal to be caught.
 call during the execution of a signal handler will cause
 the new action to take place on the next signal to be caught.
-.SH NOTES
+.Sh NOTES
 This library routine uses an extension of the
 This library routine uses an extension of the
-.IR sigvec (2)
-system call that is not available in 4.2BSD,
+.Xr sigaction 2
+system call that is not available in
+.Bx 4.2 ,
 hence it should not be used if backward compatibility is needed.
 hence it should not be used if backward compatibility is needed.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 A 0 value indicates that the call succeeded.
 A 0 value indicates that the call succeeded.
-A -1 value indicates that an invalid signal number has been supplied.
-.SH "SEE ALSO"
-sigvec(2), sigblock(2), sigpause(2), sigsetmask(2).
+A \-1 value indicates that an invalid signal number has been supplied.
+.Sh SEE ALSO
+.Xr sigaction 2 ,
+.Xr sigblock 2 ,
+.Xr sigpause 2 ,
+.Xr sigsetmask 2 .
+.Sh HISTORY
+The
+.Fn siginterrupt
+function appeared in 
+.Bx 4.3 .
index f238c7b..506e642 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)signal.3    6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SIGNAL 3C ""
-.UC 4
-.ie t .ds d \(dg
-.el .ds d \z'|+'
-.ie t .ds b \(bu
-.el .ds b @
-.SH NAME
-signal \- simplified software signal facilities
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-.PP
-.B void (*signal(sig, func))()
-.B void (*func)();
-.fi
-.SH DESCRIPTION
-.I Signal
+.\"     @(#)signal.3   6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SIGNAL 3
+.Os BSD 4
+.Sh NAME
+.Nm signal
+.Nd simplified software signal facilities
+.Sh SYNOPSIS
+.Fd #include <signal.h>
+.Ft void
+.\" can not do this with .Fn yet
+\*(fN*signal\*(lp\*(fAsig\fR, \*(fAfunc\*(rp\|\*(lp\|\*(rp\fR
+.br
+.Ft void
+\*(fN*func\*(rp\*(lp\|\*(rp\fR
+.Sh DESCRIPTION
+This
+.Fn signal
+facility
 is a simplified interface to the more general
 is a simplified interface to the more general
-.IR sigaction (2)
+.Xr sigaction 2
 facility.
 facility.
-.PP
-A signal
-is generated by some abnormal event,
-initiated by a user at a terminal (quit, interrupt, stop),
-by a program error (bus error, etc.),
-by request of another program (kill),
-or when a process is stopped because it wishes to access
+.Pp
+Signals allow the manipulation of a process from outside its
+domain as well as allowing the process to manipulate itself or
+copies of itself (children). There are two general types of signals:
+those that cause termination of a process and those that do not.
+Signals which cause termination of a program might result from
+an irrecoverable error or might be the result of a user at a terminal
+typing the `interrupt' character.
+Signals are used when a process is stopped because it wishes to access
 its control terminal while in the background (see
 its control terminal while in the background (see
-.IR tty (4)).
+.Xr tty 4 ) .
 Signals are optionally generated
 when a process resumes after being stopped,
 when the status of child processes changes,
 or when input is ready at the control terminal.
 Signals are optionally generated
 when a process resumes after being stopped,
 when the status of child processes changes,
 or when input is ready at the control terminal.
-Most signals cause termination of the receiving process if no action
+Most signals result in the termination of the process receiving them
+if no action
 is taken; some signals instead cause the process receiving them
 to be stopped, or are simply discarded if the process has not
 requested otherwise.
 is taken; some signals instead cause the process receiving them
 to be stopped, or are simply discarded if the process has not
 requested otherwise.
-Except for the SIGKILL and SIGSTOP
+Except for the
+.Dv SIGKILL
+and
+.Dv SIGSTOP
 signals, the
 signals, the
-.I signal
-call allows signals either to be ignored
-or to cause an interrupt to a specified location.
-The following is a list of all signals with
-names as in the include file
-.RI < signal.h >:
-.LP
-.nf
-.ta \w'SIGVTALRM 'u +\w'15*  'u
-SIGHUP 1       hangup
-SIGINT 2       interrupt
-SIGQUIT        3*      quit
-SIGILL 4*      illegal instruction
-SIGTRAP        5*      trace trap
-SIGABRT        6*      \fIabort\fP() call (formerly SIGIOT)
-SIGEMT 7*      EMT instruction
-SIGFPE 8*      floating point exception
-SIGKILL        9       kill (cannot be caught or ignored)
-SIGBUS 10*     bus error
-SIGSEGV        11*     segmentation violation
-SIGSYS 12*     bad argument to system call
-SIGPIPE        13      write on a pipe with no one to read it
-SIGALRM        14      alarm clock
-SIGTERM        15      software termination signal
-SIGURG 16\*b   urgent condition present on socket
-SIGSTOP        17\*d   stop (cannot be caught or ignored)
-SIGTSTP        18\*d   stop signal generated from keyboard
-SIGCONT        19\*b   continue after stop
-SIGCHLD        20\*b   child status has changed
-SIGTTIN        21\*d   background read attempted from control terminal
-SIGTTOU        22\*d   background write attempted to control terminal
-SIGIO  23\*b   i/o is possible on a descriptor (see \fIfcntl\fP(2))
-SIGXCPU        24      cpu time limit exceeded (see \fIsetrlimit\fP(2))
-SIGXFSZ        25      file size limit exceeded (see \fIsetrlimit\fP(2))
-SIGVTALRM      26      virtual time alarm (see \fIsetitimer\fP(2))
-SIGPROF        27      profiling timer alarm (see \fIsetitimer\fP(2))
-SIGWINCH       28\*b   Window size change
-SIGINFO        29\*b   status request from keyboard
-SIGUSR1        30      User defined signal 1
-SIGUSR2        31      User defined signal 2
-.fi
-.PP
-The starred signals in the list above cause a core image
-if not caught or ignored.
-.PP
-If
-.I func
-is SIG_DFL, the default action
-for signal
-.I sig
-is reinstated; this default is termination
-(with a core image for starred signals)
-except for signals marked with \*b or \*d.
-Signals marked with \*b are discarded if the action
-is SIG_DFL; signals marked
-with \*d cause the process to stop.
-If
-.I func
-is SIG_IGN the signal is subsequently ignored
-and pending instances of the signal are discarded.
-Otherwise, when the signal occurs
+.Fn signal
+function allows for a signal to be caught, to be ignored, or to generate
+an interupt.
+These signals are defined in the file
+.Aq Pa signal.h :
+.Bl -column SIGVTALARMXX "create core imagexxx"
+.It Sy "  NAME  " "      Default Action  " "                 Description"
+.It Dv SIGHUP No "     terminate process" "    terminal line hangup"
+.It Dv SIGINT No "     terminate process" "    interrupt program"
+.It Dv SIGQUIT No "    create core image" "    quit program"
+.It Dv SIGILL No "     create core image" "    illegal instruction"
+.It Dv SIGTRAP No "    create core image" "    trace trap"
+.It Dv SIGABRT No "    create core image" Xr   abort 2
+call (formerly
+.Dv SIGIOT )
+.It Dv SIGEMT No "     create core image" "    emulate instruction executed"
+.It Dv SIGFPE No "     create core image" "    floating-point exception"
+.It Dv SIGKILL No "    terminate process" "    kill program"
+.It Dv SIGBUS No "     create core image" "    bus error"
+.It Dv SIGSEGV No "    create core image" "    segmentation violation"
+.It Dv SIGSYS No "     create core image" "    system call given invalid argument"
+.It Dv SIGPIPE No "    terminate process" "    write on a pipe with no reader"
+.It Dv SIGALRM No "    terminate process" "    real-time timer expired"
+.It Dv SIGTERM No "    terminate process" "    software termination signal"
+.It Dv SIGURG No "     discard signal" "       urgent condition present on socket"
+.It Dv SIGSTOP No "    stop process" " stop (cannot be caught or ignored)"
+.It Dv SIGTSTP No "    stop process" " stop signal generated from keyboard"
+.It Dv SIGCONT No "    discard signal" "       continue after stop"
+.It Dv SIGCHLD No "    discard signal" "       child status has changed"
+.It Dv SIGTTIN No "    stop process" " background read attempted from control terminal"
+.It Dv SIGTTOU No "    stop process" " background write attempted to control terminal"
+.It Dv SIGIO No "      discard signal" Tn "    I/O"
+is possible on a descriptor (see
+.Xr fcntl 2 )
+.It Dv SIGXCPU No "    terminate process" "    cpu time limit exceeded (see"
+.Xr setrlimit 2 )
+.It Dv SIGXFSZ No "    terminate process" "    file size limit exceeded (see"
+.Xr setrlimit 2 )
+.It Dv SIGVTALRM No "  terminate process" "    virtual time alarm (see"
+.Xr setitimer 2 )
+.It Dv SIGPROF No "    terminate process" "    profiling timer alarm (see"
+.Xr setitimer 2 )
+.It Dv SIGWINCH No "   discard signal" "       Window size change"
+.It Dv SIGINFO No "    discard signal" "       status request from keyboard"
+.It Dv SIGUSR1 No "    terminate process" "    User defined signal 1"
+.It Dv SIGUSR2 No "    terminate process" "    User defined signal 2"
+.El
+.Pp
+The
+.Fa func
+procedure allows a user to choose the action upon receipt of a signal.
+To set the default action of the signal to occur as listed above,
+.Fa func
+should be
+.Dv SIG_DFL .
+A
+.Dv SIG_DFL
+resets the default action.
+To ignore the signal
+.Fa func
+should be
+.Dv SIG_IGN .
+This will cause subsequent instances of the signal to be ignored
+and pending instances to be discarded. If
+.Dv SIG_IGN
+is not used,
 further occurrences of the signal are
 automatically blocked and
 further occurrences of the signal are
 automatically blocked and
-.I func
+.Fa func
 is called.
 is called.
-.PP
-A return from the function unblocks
-the handled signal and
-continues the process at the point it was interrupted.
-\fBUnlike previous signal facilities, the handler \fIfunc\fP
-remains installed after a signal has been delivered.\fP
-.PP
-If a caught signal occurs
-during certain system calls, causing
-the call to terminate prematurely, the call
-is automatically restarted
-(the handler is installed using the SA_RESTART flag with
-.IR sigaction (2)).
+.Pp
+The handled signal is unblocked with the
+function returns and
+the process continues from where it left off when the signal occured.
+.Bf -symbolic
+Unlike previous signal facilities, the handler
+func() remains installed after a signal has been delivered.
+.Ef
+.Pp
+For some system calls, if a signal is caught while the call is
+executing and the call is permaturely terminated,
+the call is automatically restarted.
+(The handler is installed using the
+.Dv SA_RESTART
+flag with
+.Xr sigaction 2 . )
 The affected system calls include
 The affected system calls include
-.IR read (2),
-.IR write (2),
-.IR sendto (2),
-.IR recvfrom (2),
-.IR sendmsg (2)
+.Xr read 2 ,
+.Xr write 2 ,
+.Xr sendto 2 ,
+.Xr recvfrom 2 ,
+.Xr sendmsg 2
 and
 and
-.IR recvmsg (2)
-on a communications channel or a slow device (such as a terminal,
-but not a regular file)
+.Xr recvmsg 2
+on a communications channel or a low speed device
 and during a
 and during a
-.IR wait (2)
+.Xr ioctl 2
 or
 or
-.IR ioctl (2).
+.Xr wait 2 .
 However, calls that have already committed are not restarted,
 but instead return a partial success (for example, a short read count).
 However, calls that have already committed are not restarted,
 but instead return a partial success (for example, a short read count).
-.PP
-The value of
-.I signal
-is the previous (or initial)
-value of
-.I func
-for the particular signal.
-.PP
-After a
-.IR fork (2)
-or
-.IR vfork (2)
-the child inherits
-all signals.
-.IR  Execve (2)
-resets all caught signals to the default action;
+.Pp
+When a process which has installed signal handlers forks,
+the child process inherits the signals.
+All caught signals may be reset to their default action by a call
+to the
+.Xr execve 2
+function;
 ignored signals remain ignored.
 ignored signals remain ignored.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 The previous action is returned on a successful call.
 The previous action is returned on a successful call.
-Otherwise, \-1 is returned and 
-.I errno
+Otherwise, \-1 is returned and  the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Signal
+.Sh ERRORS
+.Xr Signal
 will fail and no action will take place if one of the
 following occur:
 will fail and no action will take place if one of the
 following occur:
-.TP 15
-[EINVAL]
-.I Sig
+.Bl -tag -width [EINVAL]
+.It Bq Er EINVAL
+.Em Sig
 is not a valid signal number.
 is not a valid signal number.
-.TP 15
-[EINVAL]
-An attempt is made to ignore or supply a handler for SIGKILL
-or SIGSTOP.
-.SH "SEE ALSO"
-kill(1), ptrace(2), kill(2),
-sigaction(2), sigprocmask(2), sigsuspend(2),
-sigstack(2), setjmp(3), tty(4)
-.SH "NOTES  (VAX-11)"
-The handler routine can be declared:
-.PP
-    void handler(sig, code, scp)
-.PP
-Here
-.I sig
-is the signal number, into which the hardware faults and traps are
-mapped as defined below.  Code is a parameter which is either a constant
-as given below or, for compatibility mode faults, the code provided by
-the hardware. 
-.I Scp
-is a pointer to the
-.I "struct sigcontext"
-used by the system to restore the process context from before
-the signal.
-Compatibility mode faults are distinguished from the
-other SIGILL traps by having PSL_CM set in the psl.
-.PP
-The following defines the mapping of hardware traps to signals
-and codes.  All of these symbols are defined in
-.RI < signal.h >:
-.LP
-.ta \w'     Floating/decimal divide by zero   'u +\w'15*  'u +8n
-.nf
-   Hardware condition  Signal  Code
-
-Arithmetic traps:
-   Integer overflow    SIGFPE  FPE_INTOVF_TRAP
-   Integer division by zero    SIGFPE  FPE_INTDIV_TRAP
-   Floating overflow trap      SIGFPE  FPE_FLTOVF_TRAP
-   Floating/decimal division by zero   SIGFPE  FPE_FLTDIV_TRAP
-   Floating underflow trap     SIGFPE  FPE_FLTUND_TRAP
-   Decimal overflow trap       SIGFPE  FPE_DECOVF_TRAP
-   Subscript-range     SIGFPE  FPE_SUBRNG_TRAP
-   Floating overflow fault     SIGFPE  FPE_FLTOVF_FAULT
-   Floating divide by zero fault       SIGFPE  FPE_FLTDIV_FAULT
-   Floating underflow fault    SIGFPE  FPE_FLTUND_FAULT
-Length access control  SIGSEGV
-Protection violation   SIGBUS
-Reserved instruction   SIGILL  ILL_RESAD_FAULT
-Customer-reserved instr.       SIGEMT
-Reserved operand       SIGILL  ILL_PRIVIN_FAULT
-Reserved addressing    SIGILL  ILL_RESOP_FAULT
-Trace pending  SIGTRAP
-Bpt instruction        SIGTRAP
-Compatibility-mode     SIGILL  hardware supplied code
-Chme   SIGSEGV
-Chms   SIGSEGV
-Chmu   SIGSEGV
-.fi
+.It Bq Er EINVAL
+An attempt is made to ignore or supply a handler for
+.Dv SIGKILL
+or
+.Ev SIGSTOP .
+.Sh SEE ALSO
+.Xr kill 1 ,
+.Xr ptrace 2 ,
+.Xr kill 2 ,
+.Xr sigaction 2 ,
+.Xr sigprocmask 2 ,
+.Xr sigsuspend 2 ,
+.Xr sigstack 2 ,
+.Xr setjmp 3 ,
+.Xr tty 4
+.Sh HISTORY
+This
+.Nm signal
+facility appeared in 
+.Bx 4.0 .
index 428627b..9837835 100644 (file)
@@ -1,87 +1,88 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigsetops.3 6.1 (Berkeley) %G%
+.\"     @(#)sigsetops.3        6.2 (Berkeley) %G%
 .\"
 .\"
-.TH SIGSETOPS 3 ""
-.UC 7
-.SH NAME
-sigsetops, sigemptyset, sigfillset, sigaddset, sigdelset, sigismember \- manipulate signal masks
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-
-.B sigemptyset(set);
-.B sigset_t *set;
-
-.B sigfillset(set);
-.B sigset_t *set;
-
-.B sigaddset(set, signo);
-.B sigset_t *set;
-.B int signo;
-
-.B sigdelset(set, signo);
-.B sigset_t *set;
-.B int signo;
-
-.B sigismember(set, signo);
-.B sigset_t *set;
-.B int signo;
-
-.SH DESCRIPTION
+.Dd 
+.Dt SIGSETOPS 3
+.Os
+.Sh NAME
+.Nm sigsetops ,
+.Nm sigemptyset ,
+.Nm sigfillset ,
+.Nm sigaddset ,
+.Nm sigdelset ,
+.Nm sigismember
+.Nd manipulate signal masks
+.Sh SYNOPSIS
+.Fd #include <signal.h>
+.Fn sigemptyset "sigset_t *set"
+.Fn sigfillset "sigset_t *set"
+.Fn sigaddset "sigset_t *set" "int signo"
+.Fn sigdelset "sigset_t *set" "int signo"
+.Fn sigismember "sigset_t *set" "int signo"
+.Sh DESCRIPTION
 These functions manipulate signal mask stored in a
 These functions manipulate signal mask stored in a
-.IR sigset_t .
+.Fa sigset_t .
 They are provided as macros, but actual functions are available
 if their names are undefined (with #undef
 They are provided as macros, but actual functions are available
 if their names are undefined (with #undef
-.IR name ).
-.PP
+.Em name ) .
+.Pp
 The
 The
-.I sigemptyset
+.Fn sigemptyset
 function initializes a signal set to be empty.
 The
 function initializes a signal set to be empty.
 The
-.I sigfillset
+.Fn sigfillset
 function initializes a signal set to contain all of the known signals.
 One of these routines must be used to initialize a signal set
 before its use by the other functions.
 function initializes a signal set to contain all of the known signals.
 One of these routines must be used to initialize a signal set
 before its use by the other functions.
-.PP
+.Pp
 The
 The
-.I sigaddset
+.Fn sigaddset
 function adds a specified signal
 function adds a specified signal
-.I signo
+.Fa signo
 to a signal set.
 The
 to a signal set.
 The
-.I sigdelset
+.Fn sigdelset
 function deletes a specified signal
 function deletes a specified signal
-.I signo
+.Fa signo
 from a signal set.
 from a signal set.
-.PP
+.Pp
 The
 The
-.I sigismember
+.Fn sigismember
 function tests whether a specified signal
 function tests whether a specified signal
-.I signo
+.Fa signo
 is contained in a signal set.
 is contained in a signal set.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 The
 The
-.I sigismember
+.Fn sigismember
 function returnes 1
 if the signal is a member of the set,
 a 0 otherwise.
 The other functions return 0 upon success.
 A \-1 return value
 function returnes 1
 if the signal is a member of the set,
 a 0 otherwise.
 The other functions return 0 upon success.
 A \-1 return value
-indicates an error occurred and
-.I errno
+indicates an error occurred and the global variable
+.Va errno
 is set to indicated the reason.
 The current implementation does not detect any errors.
 is set to indicated the reason.
 The current implementation does not detect any errors.
-.SH ERRORS
+.Sh ERRORS
 These functions could fail if one of the following occurs:
 These functions could fail if one of the following occurs:
-.TP 15
-[EINVAL]
-.I signo
+.Bl -tag -width [EINVAL]
+.It Bq Er EINVAL
+.Fa signo
 has an invalid value.
 has an invalid value.
-.SH STANDARDS
-These functions are defined by POSIX.1.
-.SH "SEE ALSO"
-kill(2), sigaction(2), sigsetops(2), sigsuspend(2)
+.El
+.Sh SEE ALSO
+.Xr kill 2 ,
+.Xr sigaction 2 ,
+.Xr sigsetops 2 ,
+.Xr sigsuspend 2
+.Sh STANDARDS
+The
+These functions are defined by
+.St -p1003.1-88 .
+.Sh HISTORY
+These functions are
+.Ud .
index 14fb1f2..b1da98a 100644 (file)
@@ -1,32 +1,57 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1986, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)sleep.3     6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SLEEP 3  ""
-.UC 4
-.SH NAME
-sleep \- suspend execution for interval
-.SH SYNOPSIS
-.nf
-.B sleep(seconds)
-.B unsigned seconds;
-.fi
-.SH DESCRIPTION
-The current process is suspended from execution for the number
-of seconds specified by the argument.
-The actual suspension time may be up to 1 second less than
-that requested, because scheduled wakeups occur at fixed 1-second intervals,
-and an arbitrary amount longer because of other activity
-in the system.
-.PP
-The routine is implemented by setting an interval timer
-and pausing until it occurs.
-The previous state of this timer is saved and restored.
-If the sleep time exceeds the time to the expiration of the
-previous timer,
-the process sleeps only until the signal would have occurred, and the
-signal is sent 1 second later.
-.SH "SEE ALSO"
-setitimer(2), sigpause(2), usleep(3)
+.\"     @(#)sleep.3    6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SLEEP 3
+.Os
+.Sh NAME
+.Nm sleep
+.Nd suspend process execution for interval of seconds
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn sleep "u_int seconds"
+.Sh DESCRIPTION
+The
+.Fn sleep
+function
+suspends execution of the calling process
+for
+.Fa seconds
+of time.
+System activity or time spent in processing the
+call may lengthen the sleep by a second.
+.Pp
+If a timer is already running on the process its state is saved.
+If the value
+.Fa seconds
+is more than or equal to the remaining clock time for the saved timer,
+the sleep time is set to
+the remaining clock time.
+The state of the previous timer
+is restored after
+.Fa seconds
+has passed.
+.Pp
+This function is implemented using
+.Xr setitimer 2 ;
+it requires eight system calls each time it is invoked.
+A similar but less compatible function can be obtained with a single
+.Xr select 2 ;
+such a function would not restart after signals, but would not interfere
+with other uses of
+.Xr setitimer .
+.Sh RETURN VALUES
+.Sh SEE ALSO
+.Xr setitimer 2 ,
+.Xr sigpause 2 ,
+.Xr usleep 3
+.Sh HISTORY
+A
+.Fn sleep
+function appeared in
+.At v7 .
index 116e4c2..0d1f43c 100644 (file)
-.\" Copyright (c) 1985 The Regents of the University of California.
+.\" Copyright (c) 1985, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)syslog.3    6.16 (Berkeley) %G%
+.\"     @(#)syslog.3   6.17 (Berkeley) %G%
 .\"
 .\"
-.TH SYSLOG 3 ""
-.UC 5
-.SH NAME
-syslog, vsyslog, openlog, closelog, setlogmask \- control system log
-.SH SYNOPSIS
-.nf
-.ft B
-#include <syslog.h>
-void
-syslog(int priority, char *message, [, arg ] ... );
-
-#include <varargs.h>
-void
-vsyslog(int priority, char *message, va_list args);
-
-void
-openlog(char *ident, int logopt, int facility);
-
-void
-closelog(void);
-
-setlogmask(int maskpri);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Syslog
+.Dd 
+.Dt SYSLOG 3
+.Os BSD 4.2
+.Sh NAME
+.Nm syslog ,
+.Nm vsyslog ,
+.Nm openlog ,
+.Nm closelog ,
+.Nm setlogmask
+.Nd control system log
+.Sh SYNOPSIS
+.Fd #include <syslog.h>
+.Fd #include <varargs.h>
+.Ft void
+.Fn syslog "int priority" "const char *message" "..."
+.Ft void
+.Fn vsyslog "int priority" "const char *message" "va_list args"
+.Ft void
+.Fn openlog "const char *ident" "int logopt" "int facility"
+.Ft void
+.Fn closelog void
+.Ft int
+.Fn setlogmask "int maskpri"
+.Sh DESCRIPTION
+The
+.Fn syslog
+function
 writes
 writes
-.I message
+.Fa message
 to the system message logger.
 to the system message logger.
-The message will then be written to the system console, log files,
-logged-in users, or forwarded to other machines as appropriate (see
-.IR syslogd (8)).
-.PP
+The message is then written to the system console, log files,
+logged-in users, or forwarded to other machines as appropriate. (See
+.Xr syslogd 8 . )
+.Pp
 The message is identical to a
 The message is identical to a
-.IR printf (3)
-format string, except that ``%m'' is replaced by the current error
-message (as denoted by
-.IR errno ;
+.Xr printf 3
+format string, except that
+.Ql %m
+is replaced by the current error
+message. (As denoted by the global variable
+.Va errno ;
 see
 see
-.IR strerror (3)).
+.Xr strerror 3 . )
 A trailing newline is added if none is present.
 A trailing newline is added if none is present.
-.PP
-.I Vsyslog
+.Pp
+The
+.Fn vsyslog
+function
 is an alternate form in which the arguments have already been captured
 using the variable-length argument facilities of
 is an alternate form in which the arguments have already been captured
 using the variable-length argument facilities of
-.IR varargs (3).
-.PP
+.Xr varargs 3 .
+.Pp
 The message is tagged with
 The message is tagged with
-.IR priority .
+.Fa priority .
 Priorities are encoded as a
 Priorities are encoded as a
-.I facility
+.Fa facility
 and a
 and a
-.IR level .
+.Em level .
 The facility describes the part of the system
 generating the message.
 The level is selected from the following
 The facility describes the part of the system
 generating the message.
 The level is selected from the following
-.B ordered
+.Em ordered
 (high to low) list:
 (high to low) list:
-.TP
-LOG_EMERG
+.Bl -tag -width LOG_AUTHPRIV
+.It Dv LOG_EMERG
 A panic condition.
 This is normally broadcast to all users.
 A panic condition.
 This is normally broadcast to all users.
-.TP
-LOG_ALERT
+.It Dv LOG_ALERT
 A condition that should be corrected immediately, such as a corrupted
 system database.
 A condition that should be corrected immediately, such as a corrupted
 system database.
-.TP
-LOG_CRIT
+.It Dv LOG_CRIT
 Critical conditions, e.g., hard device errors.
 Critical conditions, e.g., hard device errors.
-.TP
-LOG_ERR
+.It Dv LOG_ERR
 Errors.
 Errors.
-.TP
-LOG_WARNING
+.It Dv LOG_WARNING
 Warning messages.
 Warning messages.
-.TP
-LOG_NOTICE
+.It Dv LOG_NOTICE
 Conditions that are not error conditions,
 but should possibly be handled specially.
 Conditions that are not error conditions,
 but should possibly be handled specially.
-.TP
-LOG_INFO
+.It Dv LOG_INFO
 Informational messages.
 Informational messages.
-.TP
-LOG_DEBUG
+.It Dv LOG_DEBUG
 Messages that contain information
 normally of use only when debugging a program.
 Messages that contain information
 normally of use only when debugging a program.
-.PP
-.I Openlog
+.El
+.Pp
+The
+.Fn openlog
+function
 provides for more specialized processing of the messages sent
 by
 provides for more specialized processing of the messages sent
 by
-.I syslog
+.Fn syslog
 and
 and
-.IR vsyslog .
+.Fn vsyslog .
 The parameter
 The parameter
-.I ident
+.Fa ident
 is a string that will be prepended to every message.
 is a string that will be prepended to every message.
-.I Logopt
+The
+.Fa logopt
+argument
 is a bit field specifying logging options, which is formed by
 is a bit field specifying logging options, which is formed by
-.IR OR 'ing
+.Tn OR Ns 'ing
 one or more of the following values:
 one or more of the following values:
-.TP
-LOG_CONS
+.Bl -tag -width LOG_AUTHPRIV
+.It Dv LOG_CONS
 If
 If
-.I syslog
+.Fn syslog
 cannot pass the message to
 cannot pass the message to
-.I syslogd
-it will attempt to write the message to the console (``/dev/console'').
-.TP
-LOG_NDELAY 
+.Xr syslogd
+it will attempt to write the message to the console
+.Pq Dq Pa /dev/console.
+.It Dv LOG_NDELAY 
 Open the connection to
 Open the connection to
-.I syslogd
+.Xr syslogd
 immediately.
 Normally the open is delayed until the first message is logged.
 Useful for programs that need to manage the order in which file
 descriptors are allocated.
 immediately.
 Normally the open is delayed until the first message is logged.
 Useful for programs that need to manage the order in which file
 descriptors are allocated.
-.TP
-LOG_PERROR
+.It Dv LOG_PERROR
 Write the message to standard error output as well to the system log.
 Write the message to standard error output as well to the system log.
-.TP
-LOG_PID
+.It Dv LOG_PID
 Log the process id with each message: useful for identifying
 instantiations of daemons.
 Log the process id with each message: useful for identifying
 instantiations of daemons.
-.PP
+.El
+.Pp
 The
 The
-.I facility
+.Fa facility
 parameter encodes a default facility to be assigned to all messages
 that do not have an explicit facility encoded:
 parameter encodes a default facility to be assigned to all messages
 that do not have an explicit facility encoded:
-.TP
-LOG_AUTH
+.Bl -tag -width LOG_AUTHPRIV
+.It Dv LOG_AUTH
 The authorization system:
 The authorization system:
-.IR login (1),
-.IR su (1),
-.IR getty (8),
+.Xr login 1 ,
+.Xr su 1 ,
+.Xr getty 8 ,
 etc.
 etc.
-.TP
-LOG_AUTHPRIV
-The same as LOG_AUTH, but logged to a file readable only by
+.It Dv LOG_AUTHPRIV
+The same as
+.Dv LOG_AUTH ,
+but logged to a file readable only by
 selected individuals.
 selected individuals.
-.TP
-LOG_CRON
+.It Dv LOG_CRON
 The clock daemon.
 The clock daemon.
-.TP
-LOG_DAEMON
+.It Dv LOG_DAEMON
 System daemons, such as
 System daemons, such as
-.IR ftpd (8),
-.IR routed (8),
+.Xr ftpd 8 ,
+.Xr routed 8 ,
 etc., that are not provided for explicitly by other facilities.
 etc., that are not provided for explicitly by other facilities.
-.TP
-LOG_KERN
+.It Dv LOG_KERN
 Messages generated by the kernel.
 These cannot be generated by any user processes.
 Messages generated by the kernel.
 These cannot be generated by any user processes.
-.TP
-LOG_LPR
+.It Dv LOG_LPR
 The line printer spooling system:
 The line printer spooling system:
-.IR lpr (1),
-.IR lpc (8),
-.IR lpd (8),
+.Xr lpr 1 ,
+.Xr lpc 8 ,
+.Xr lpd 8 ,
 etc.
 etc.
-.TP
-LOG_MAIL
+.It Dv LOG_MAIL
 The mail system.
 The mail system.
-.TP
-LOG_NEWS
+.It Dv LOG_NEWS
 The network news system.
 The network news system.
-.TP
-LOG_SYSLOG
+.It Dv LOG_SYSLOG
 Messages generated internally by
 Messages generated internally by
-.IR syslogd (8).
-.TP
-LOG_USER
+.Xr syslogd 8 .
+.It Dv LOG_USER
 Messages generated by random user processes.
 This is the default facility identifier if none is specified.
 Messages generated by random user processes.
 This is the default facility identifier if none is specified.
-.TP
-LOG_UUCP
+.It Dv LOG_UUCP
 The uucp system.
 The uucp system.
-.TP
-LOG_LOCAL0
+.It Dv LOG_LOCAL0
 Reserved for local use.
 Reserved for local use.
-Similarly for LOG_LOCAL1 through LOG_LOCAL7.
-.PP
-.I Closelog
+Similarly for
+.Dv LOG_LOCAL1
+through
+.Dv LOG_LOCAL7 .
+.El 
+.Pp
+The
+.Fn closelog
+function
 can be used to close the log file.
 can be used to close the log file.
-.PP
-.I Setlogmask
+.Pp
+The
+.Fn setlogmask
+function
 sets the log priority mask to
 sets the log priority mask to
-.I maskpri
+.Fa maskpri
 and returns the previous mask.
 Calls to
 and returns the previous mask.
 Calls to
-.I syslog
+.Fn syslog
 with a priority not set in
 with a priority not set in
-.I maskpri
+.Fa maskpri
 are rejected.
 The mask for an individual priority
 are rejected.
 The mask for an individual priority
-.I pri
-is calculated by the macro ``LOG_MASK(pri);''
+.Fa pri
+is calculated by the macro
+.Fn LOG_MASK pri ;
 the mask for all priorities up to and including
 the mask for all priorities up to and including
-.I toppri
-is given by the macro ``LOG_UPTO(toppri);''.
+.Fa toppri
+is given by the macro
+.Fn LOG_UPTO toppri ; .
 The default allows all priorities to be logged.
 The default allows all priorities to be logged.
-.SH EXAMPLES
-.nf
-.RS
+.Sh RETURN VALUES
+The routines
+.Fn closelog ,
+.Fn openlog ,
+.Fn syslog
+and
+.Fn vsyslog
+return no value.
+.Pp
+The routine
+.Fn setlogmask
+always returns the previous log mask level.
+.Sh EXAMPLES
+.Bd -literal -offset indent -compact
 syslog(LOG_ALERT, "who: internal error 23");
 
 openlog("ftpd", LOG_PID, LOG_DAEMON);
 syslog(LOG_ALERT, "who: internal error 23");
 
 openlog("ftpd", LOG_PID, LOG_DAEMON);
@@ -214,19 +228,11 @@ setlogmask(LOG_UPTO(LOG_ERR));
 syslog(LOG_INFO, "Connection from host %d", CallingHost);
 
 syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
 syslog(LOG_INFO, "Connection from host %d", CallingHost);
 
 syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
-.RE
-.fi
-.SH RETURNS
-The routines
-.IR closelog ,
-.IR openlog ,
-.IR syslog
-and
-.I vsyslog
-return no value.
-.PP
-The routine
-.I setlogmask
-always returns the previous log mask level.
-.SH "SEE ALSO"
-logger(1), syslogd(8)
+.Ed
+.Sh SEE ALSO
+.Xr logger 1 ,
+.Xr syslogd 8
+.Sh HISTORY
+These
+functions appeared in 
+.Bx 4.2 .
index 6c13e8e..a240cf1 100644 (file)
@@ -1,46 +1,55 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)time.3      5.2 (Berkeley) %G%
+.\"     @(#)time.3     5.3 (Berkeley) %G%
 .\"
 .\"
-.TH TIME 3 ""
-.UC 4
-.SH NAME
-time \- get time of day
-.SH SYNOPSIS
-.nf
-.B #include <sys/types.h>
-
-.B time_t time(tloc)
-.B time_t *tloc;
-.fi
-.SH DESCRIPTION
-.PP
-.I Time
+.Dd 
+.Dt TIME 3
+.Os BSD 4
+.Sh NAME
+.Nm time
+.Nd get time of day
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft time_t
+.Fn time "time_t *tloc"
+.Sh DESCRIPTION
+The
+.Fn time
+function
 returns the value of time in seconds since 0 hours, 0 minutes,
 0 seconds, January 1, 1970, Coordinated Universal Time.
 returns the value of time in seconds since 0 hours, 0 minutes,
 0 seconds, January 1, 1970, Coordinated Universal Time.
-.PP
-The argument
-.I tloc
-points to an area where the return value is also stored.
+.Pp
+A copy of the time value may be saved to the area indicated by the
+pointer
+.Fa tloc .
 If
 If
-.I tloc
+.Fa tloc
 is a NULL pointer, no value is stored.
 is a NULL pointer, no value is stored.
-.PP
+.Pp
 Upon successful completion,
 Upon successful completion,
-.IR time ()
+.Fn time
 returns the value of time.
 returns the value of time.
-Otherwise a value of ((\fItime_t\fR) -1)
-is returned and
-.I errno
+Otherwise a value of
+.Po
+.Po Fa time_t Pc \-1
+.Pc
+is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
+.SERRORS
 The following error codes may be set in
 The following error codes may be set in
-.IR errno :
-.TP 15
-[EFAULT]
+.Va errno :
+.Bl -tag -width [EFAULT]
+.It Bq Er EFAULT
 An argument address referenced invalid memory.
 An argument address referenced invalid memory.
-.SH "SEE ALSO"
-gettimeofday(2), ctime(3)
+.Sh SEE ALSO
+.Xr gettimeofday 2 ,
+.Xr ctime 3
+.Sh HISTORY
+A
+.Fn time
+function appeared in
+.At v6 .
index 0662b11..1f37425 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)times.3     6.3 (Berkeley) %G%
+.\"     @(#)times.3    6.4 (Berkeley) %G%
 .\"
 .\"
-.TH TIMES 3 ""
-.UC 4
-.SH NAME
-times \- process times
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/times.h>
-
-clock_t times(struct tms *tp);
-.ft R
-.fi
-.SH DESCRIPTION
-.ft B
-This interface is obsoleted by getrusage(2) and gettimeofday(3).
-.ft R
-.PP
+.Dd 
+.Dt TIMES 3
+.Os BSD 4
+.Sh NAME
+.Nm times
+.Nd process times
+.Sh SYNOPSIS
+.Fd #include <sys/times.h>
+.Ft clock_t 
+.Fn times "struct tms *tp"
+.Sh DESCRIPTION
+.Bf -symbolic
+This interface is obsoleted by getrusage(2)
+and gettimeofday(3).
+.Ef
+.Pp
 The
 The
-.I times
-function returns the value of time in CLK_TCK's of a second since
+.Fn times
+function returns the value of time in
+.Dv CLK_TCK Ns 's
+of a second since
 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal
 Time.
 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal
 Time.
-.PP
+.Pp
 It also fills in the structure pointed to by
 It also fills in the structure pointed to by
-.I tp
+.Fa tp
 with time-accounting information.
 with time-accounting information.
-.PP
+.Pp
 The
 The
-.I tms
+.Fa tms
 structure is defined as follows:
 structure is defined as follows:
-.sp
+.Bd -literal -offset indent
 typedef struct {
 typedef struct {
-.RS
-clock_t tms_utime;
-.br
-clock_t tms_stime;
-.br
-clock_t tms_cutime;
-.br
-clock_t tms_cstime;
-.br
-.RE
+       clock_t tms_utime;
+       clock_t tms_stime;
+       clock_t tms_cutime;
+       clock_t tms_cstime;
 }
 }
-.PP
+.Ed
+.Pp
 The elements of this structure are defined as follows:
 The elements of this structure are defined as follows:
-.TP
-tms_utime
-The CPU time charged for the execution of user instructions.
-.TP
-tms_stime
-The CPU time charged for execution by the system on behalf of
+.Bl -tag -width tms_cutime
+.It Fa tms_utime
+The
+.Tn CPU
+time charged for the execution of user instructions.
+.It Fa tms_stime
+The
+.Tn CPU
+time charged for execution by the system on behalf of
 the process.
 the process.
-.TP
-tms_cutime
+.It Fa tms_cutime
 The sum of the
 The sum of the
-.IR tms_utime s
+.Fa tms_utime  s
 and
 and
-.IR tms_cutime s
+.Fa tms_cutime  s
 of the child processes.
 of the child processes.
-.TP
-tms_cstime
+.It Fa tms_cstime
 The sum of the
 The sum of the
-.IR tms_stime s
+.Fa tms_stime Ns s
 and
 and
-.IR tms_cstime s
+.Fa tms_cstime Ns s
 of the child processes.
 of the child processes.
-.PP
-All times are in CLK_TCK's of a second.
-.PP
+.El
+.Pp
+All times are in
+.Dv CLK_TCK Ns 's
+of a second.
+.Pp
 The times of a terminated child process are included in the
 The times of a terminated child process are included in the
-.I tms_cutime
+.Fa tms_cutime
 and
 and
-.I tms_cstime
+.Fa tms_cstime
 elements of the parent when one of the
 elements of the parent when one of the
-.IR wait ()
-functions returns the process ID of the terminated child to the parent
-(see
-.IR wait (2)).
+.Xr wait 2
+functions returns the process ID of the terminated child to the parent.
 If an error occurs,
 If an error occurs,
-.I times
-returns ((clock_t)-1), and sets errno to indicate the error.
-.SH ERRORS
-.I Times
-may fail and set errno for any of the errors specified for the library
+.Fn times
+returns the value
+.Pq (clock_t)\-1 ,
+and sets errno to indicate the error.
+.Sh ERRORS
+The
+.Fn times
+function
+may fail and set the global variable
+.Va errno
+for any of the errors specified for the library
 routines
 routines
-.IR getrusage (2)
+.Xr getrusage 2
 and
 and
-.IR gettimeofday (2).
-.SH "SEE ALSO"
-time(1), getrusage(2), gettimeofday(2), wait(2)
-.SH STANDARDS
-.B Times
-conforms to POSIX Std 1003.1-1988.
+.Xr gettimeofday 2 .
+.Sh SEE ALSO
+.Xr time 1 ,
+.Xr getrusage 2 ,
+.Xr gettimeofday 2 ,
+.Xr wait 2
+.Sh STANDARDS
+The
+.Fn times
+function
+conforms to
+.St -p1003.1-88 .
index b71fd25..d7f4004 100644 (file)
-.\"    @(#)ttyname.3   6.1 (Berkeley) %G%
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH TTYNAME 3  ""
-.AT 3
-.SH NAME
-ttyname, isatty, ttyslot \- find name of a terminal
-.SH SYNOPSIS
-.B char *ttyname(filedes)
-.PP
-.B isatty(filedes)
-.PP
-.B ttyslot()
-.SH DESCRIPTION
-.I Ttyname
-returns a pointer to the null-terminated path name
-of the terminal device associated with file descriptor
-.I filedes
-(this is a system file descriptor and has nothing to do with the
-standard I/O FILE typedef).
-.PP
-.I Isatty
-returns 1 if
-.I filedes
-is associated with a terminal device, 0 otherwise.
-.PP
-.I Ttyslot
-returns the number of the entry in the
-.IR ttys (5)
-file for the control terminal of the current process.
-.SH FILES
-/dev/\(**
-.br
-/etc/ttys
-.SH SEE ALSO
-ioctl(2), ttys(5)
-.SH DIAGNOSTICS
-.I Ttyname
-returns a null pointer (0) if
-.I filedes
-does not describe a terminal device in directory `/dev'.
-.PP
-.I Ttyslot
-returns 0 if `/etc/ttys' is inaccessible or if
-it cannot determine the control terminal.
-.SH BUGS
-The return value points to static data
-whose content is overwritten by each call.
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)ttyname.3  6.2 (Berkeley) %G%
+.\"
+.Dd 
+.Dt TTYNAME 3
+.Os
+.Sh NAME
+.Nm ttyname ,
+.Nm isatty ,
+.Nm ttyslot
+.Nd get name of associated terminal (tty) from file descriptor
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft char *
+.Fn ttyname "int fd"
+.Ft int
+.Fn isatty "int fd"
+.Ft int
+.Fn ttyslot 
+.Sh DESCRIPTION
+These functions operate on the system file descriptors for terminal
+type devices. These descriptors are not related to the standard
+.Tn I/O
+.Dv FILE
+typedef, but refer to the special device files found in
+.Pa /dev
+and named
+.Pa /dev/tty Ns Em xx
+and for which an entry exists
+in the initialization file
+.Pa /etc/ttys.
+(See
+.Xr ttys 5 . )
+.Pp
+The
+.Fn isatty
+function
+determines if the file descriptor
+.Fa fd
+refers to a valid
+terminal type device.
+.Pp
+The
+.Fn ttyname
+function
+gets the related device name of
+a file descriptor for which
+.Fn isatty
+is true
+.Pp
+The
+.Fn ttyslot
+function
+fetches the current process' control terminal number from the
+.Xr ttys 5
+file entry.
+.Sh RETURN VALUES
+The
+.Fn ttyname
+function
+returns the null terminated name if the device is found and
+.Fn isatty
+is true; otherwise 
+a
+.Dv NULL
+pointer is returned.
+.Pp
+The
+.Fn ttyslot
+function
+returns the unit number of the device file if found; otherwise
+the value zero is returned.
+.Sh FILES
+.Bl -tag -width /etc/ttys -compact
+.It Pa /dev/\(**
+.It Pa /etc/ttys
+.El
+.Sh SEE ALSO
+.Xr ioctl 2 ,
+.Xr ttys 5
+.Sh HISTORY
+A
+.Fn isatty ,
+.Fn ttyname ,
+and
+.Fn ttyslot
+function
+appeared in
+.At v7 .
+.Sh BUGS
+The
+.Fn ttyname
+function leaves its result in an internal static object and returns
+a pointer to that object. Subsequent calls to
+.Fn ttyname
+will modify the same object.
index 3a575d2..0bf8133 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Arthur Olson.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Arthur Olson.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)tzset.3     5.1 (Berkeley) %G%
+.\"     @(#)tzset.3    5.2 (Berkeley) %G%
 .\"
 .\"
-.TH TZSET 3 ""
-.SH NAME
-tzset, tzsetwall \- initialize time conversion information
-.SH SYNOPSIS
-.nf
-.ft B
-void tzset()
-
-void tzsetwall()
-.ft R
-.fi
-.SH DESCRIPTION
-.I Tzset
+.Dd 
+.Dt TZSET 3
+.Sh NAME
+.Nm tzset ,
+.Nm tzsetwall
+.Nd initialize time conversion information
+.Sh SYNOPSIS
+.Fd #include <time.h>
+.Ft void
+.Fn tzset void
+.Ft void
+.Fn tzsetwall void
+.Sh DESCRIPTION
+The
+.Fn tzset
+function
 initializes time conversion information used by the library routine
 initializes time conversion information used by the library routine
-.IR localtime .
+.Xr localtime 3 .
 The environment variable
 The environment variable
-.B TZ
+.Ev TZ
 specifies how this is done.
 specifies how this is done.
-.PP
+.Pp
 If
 If
-.B TZ
+.Ev TZ
 does not appear in the environment, the best available approximation to
 local wall clock time, as specified by the
 does not appear in the environment, the best available approximation to
 local wall clock time, as specified by the
-.IR tzfile (5)-format
-file ``/etc/localtime'' is used.
-.PP
+.Xr tzfile 5 Ns -format
+file
+.Pa /etc/localtime
+is used.
+.Pp
 If
 If
-.B TZ
+.Ev TZ
 appears in the environment but its value is a null string, Coordinated
 appears in the environment but its value is a null string, Coordinated
-Universal Time (UTC) is used (without leap second correction).
-.PP
+Universal Time
+.Pq Tn UTC
+is used (without leap second correction).
+.Pp
 If
 If
-.B TZ
-appears in the environment and its value begins with a colon (``:''),
-the rest of its value is used as a pathname of a 
-.IR tzfile (5)-format
+.Ev TZ
+appears in the environment and its value begins with a colon
+.Pq Ql : ,
+the rest of its value is used as a pathname of a
+.Xr tzfile 5 Ns -format
 file from which to read the time conversion information.
 file from which to read the time conversion information.
-If the first character of the pathname is a slash (``/'') it is used as
+If the first character of the pathname is a slash
+.Pq Ql /
+it is used as
 an absolute pathname; otherwise, it is used as a pathname relative to
 the system time conversion information directory.
 an absolute pathname; otherwise, it is used as a pathname relative to
 the system time conversion information directory.
-.PP
+.Pp
 If its value does not begin with a colon, it is first used as the pathname
 of a file (as described above) from which to read the time conversion
 information.
 If that file cannot be read, the value is then interpreted as a direct
 specification (the format is described below) of the time conversion
 information.
 If its value does not begin with a colon, it is first used as the pathname
 of a file (as described above) from which to read the time conversion
 information.
 If that file cannot be read, the value is then interpreted as a direct
 specification (the format is described below) of the time conversion
 information.
-.PP
+.Pp
 If the
 If the
-.B TZ
+.Ev TZ
 environment variable does not specify a
 environment variable does not specify a
-.IR tzfile (5)-format
+.Xr tzfile 5 Ns -format
 file and cannot be interpreted as a direct specification,
 file and cannot be interpreted as a direct specification,
-UTC is used.
-.PP
-.I Tzsetwall
+.Tn UTC
+is used.
+.Pp
+The
+.Fn tzsetwall
+function
 sets things up so that
 sets things up so that
-.I localtime
+.Xr localtime
 returns the best available approximation of local wall clock time.
 returns the best available approximation of local wall clock time.
-.SH "SPECIFICATION FORMAT"
+.Sh SPECIFICATION FORMAT
 When
 When
-.B TZ
+.Ev TZ
 is used directly as a specification of the time conversion information,
 it must have the following syntax (spaces inserted for clarity):
 is used directly as a specification of the time conversion information,
 it must have the following syntax (spaces inserted for clarity):
-.IP
-\fIstd\|offset\fR[\fIdst\fR[\fIoffset\fR][\fB,\fIrule\fR]]
-.PP
+.Bd -filled -offset indent
+.Em std offset Bo
+.Em dst Bo
+.Em offset
+.Bc
+.Bo
+.No , Em rule
+.Bc
+.Bc
+.Ed
+.Pp
 Where:
 Where:
-.RS
-.TP 15
-.IR std " and " dst
+.Bl -tag -width std_and_dst -offset indent
+.It Em std No and Em dst
 Three or more bytes that are the designation for the standard
 Three or more bytes that are the designation for the standard
-.RI ( std )
+.Pq Em std
 or summer
 or summer
-.RI ( dst )
+.Pq Em dst
 time zone.  Only
 time zone.  Only
-.I std
+.Em std
 is required; if
 is required; if
-.I dst
+.Em dst
 is missing, then summer time does not apply in this locale.
 is missing, then summer time does not apply in this locale.
-Upper- and lowercase letters are explicitly allowed.  Any characters
+Upper and lowercase letters are explicitly allowed.  Any characters
 except a leading colon
 except a leading colon
-.RB ( : ),
+.Pq Ql : ,
 digits, comma
 digits, comma
-.RB ( , ),
+.Pq Ql \&, ,
 minus
 minus
-.RB ( \(mi ),
+.Pq Ql \- ,
 plus
 plus
-.RB ( \(pl ),
-and ASCII NUL are allowed.
-.TP
-.I offset
+.Pq Ql + ,
+and
+.Tn ASCII
+.Dv NUL
+are allowed.
+.It Em offset
 Indicates the value one must add to the local time to arrive at
 Coordinated Universal Time.  The
 Indicates the value one must add to the local time to arrive at
 Coordinated Universal Time.  The
-.I offset
+.Em offset
 has the form:
 has the form:
-.RS
-.IP
-\fIhh\fR[\fB:\fImm\fR[\fB:\fIss\fR]]
-.RE
-.IP
+.Bd -unfilled -offset indent
+.Em hh Bo
+.Pf \&: Em mm
+.Bo
+.Pf \&: Em ss
+.Bc
+.Bc
+.Ed
+.Pp
 The minutes
 The minutes
-.RI ( mm )
+.Pq Em mm
 and seconds
 and seconds
-.RI ( ss )
+.Pq Em ss
 are optional.  The hour
 are optional.  The hour
-.RI ( hh )
+.Pq Em hh
 is required and may be a single digit.  The
 is required and may be a single digit.  The
-.I offset
+.Em offset
 following
 following
-.I std
+.Em std
 is required.  If no
 is required.  If no
-.I offset
+.Em offset
 follows
 follows
-.IR dst ,
+.Em dst ,
 summer time is assumed to be one hour ahead of standard time.  One or
 more digits may be used; the value is always interpreted as a decimal
 number.  The hour must be between zero and 24, and the minutes (and
 seconds) \(em if present \(em between zero and 59.  If preceded by a
 summer time is assumed to be one hour ahead of standard time.  One or
 more digits may be used; the value is always interpreted as a decimal
 number.  The hour must be between zero and 24, and the minutes (and
 seconds) \(em if present \(em between zero and 59.  If preceded by a
-.RB `` \(mi '',
+.Pq Ql \-
 the time zone shall be east of the Prime Meridian; otherwise it shall be
 west (which may be indicated by an optional preceding
 the time zone shall be east of the Prime Meridian; otherwise it shall be
 west (which may be indicated by an optional preceding
-.RB `` \(pl '').
-.TP
-.I rule
+.Pq Ql + ) .
+.It Em rule
 Indicates when to change to and back from summer time.  The
 Indicates when to change to and back from summer time.  The
-.I rule
+.Em rule
 has the form:
 has the form:
-.RS
-.IP
-\fIdate\fB/\fItime\fB,\fIdate\fB/\fItime\fR
-.RE
-.IP
+.Bd -filled -offset indent
+.Em date/time,date/time
+.Ed
+.Pp
 where the first
 where the first
-.I date
+.Em date
 describes when the change from standard to summer time occurs and the
 second
 describes when the change from standard to summer time occurs and the
 second
-.I date
+.Em date
 describes when the change back happens.  Each
 describes when the change back happens.  Each
-.I time
+.Em time
 field describes when, in current local time, the change to the other
 time is made.
 field describes when, in current local time, the change to the other
 time is made.
-.IP
+.Pp
 The format of
 The format of
-.I date
+.Em date
 is one of the following:
 is one of the following:
-.RS
-.TP 10
-.BI J n
+.Bl -tag -width "M.m.n.d"
+.It Sy J Em n
 The Julian day
 The Julian day
-.I n
-.RI "(1\ \(<=" "\ n\ " "\(<=\ 365).
+.Em n
+(1 \*(Le
+.Em n
+\*(Le 365).
 Leap days are not counted; that is, in all years \(em including leap
 years \(em February 28 is day 59 and March 1 is day 60.  It is
 impossible to explicitly refer to the occasional February 29.
 Leap days are not counted; that is, in all years \(em including leap
 years \(em February 28 is day 59 and March 1 is day 60.  It is
 impossible to explicitly refer to the occasional February 29.
-.TP
-.I n
+.It Em n
 The zero-based Julian day
 The zero-based Julian day
-.RI "(0\ \(<=" "\ n\ " "\(<=\ 365).
+(0 \*(Le
+.Em n
+\*(Le 365 ) .
 Leap days are counted, and it is possible to refer to February 29.
 Leap days are counted, and it is possible to refer to February 29.
-.TP
-.BI M m . n . d
+.It Sy M  Em m.n.d
 The
 The
-.IR d' th
-day
-.RI "(0\ \(<=" "\ d\ " "\(<=\ 6)
+.Em d Ns 'th
+day (0 \*(Le
+.Em d
+\*(Le 6 )
 of week
 of week
-.I n
+.Em n
 of month
 of month
-.I m
+.Em m
 of the year
 of the year
-.RI "(1\ \(<=" "\ n\ " "\(<=\ 5,
-.RI "1\ \(<=" "\ m\ " "\(<=\ 12,
-where week 5 means ``the last
-.I d
+(1 \*(Le
+.Em n
+\*(Le 5),
+(1 \*(Le
+.Em m
+\*(Le 12),
+where week 5 means
+.Do
+the last
+.Em d
 day in month
 day in month
-.IR m ''
+.Em m
+.Dc
 which may occur in either the fourth or the fifth week).  Week 1 is the
 first week in which the
 which may occur in either the fourth or the fifth week).  Week 1 is the
 first week in which the
-.IR d' th
+.Em d Ns 'th
 day occurs.  Day zero is Sunday.
 day occurs.  Day zero is Sunday.
-.RE
-.IP "" 15
+.Pp
 The
 The
-.I time
+.Em time
 has the same format as
 has the same format as
-.I offset
+.Em offset
 except that no leading sign
 except that no leading sign
-.RB (`` \(mi ''
+.Pq Ql \-
 or
 or
-.RB `` \(pl '')
+.Pq Ql +
 is allowed.  The default, if
 is allowed.  The default, if
-.I time
+.Em time
 is not given, is
 is not given, is
-.BR 02:00:00 .
-.RE
-.LP
+.Sy 02:00:00 .
+.El
+.Pp
 If no
 If no
-.I rule
-is present in the 
-.BR TZ 
+.Em rule
+is present in the
+.Ev TZ
 specification, the rules specified
 by the
 specification, the rules specified
 by the
-.IR tzfile (5)-format
+.Xr tzfile 5 Ns -format
 file
 file
-.B posixrules
+.Em posixrules
 in the system time conversion information directory are used, with the
 in the system time conversion information directory are used, with the
-standard and summer time offsets from UTC replaced by those specified by
+standard and summer time offsets from
+.Tn UTC
+replaced by those specified by
 the
 the
-.I offset
+.Em offset
 values in
 values in
-.BR TZ .
-.PP
+.Ev TZ .
+.El
+.Pp
 For compatibility with System V Release 3.1, a semicolon
 For compatibility with System V Release 3.1, a semicolon
-.RB ( ; )
+.Pq Ql ;
 may be used to separate the
 may be used to separate the
-.I rule
+.Em rule
 from the rest of the specification.
 from the rest of the specification.
-.SH FILES
-.ta \w'/usr/share/zoneinfo/posixrules\0\0'u
-/etc/localtime local time zone file
-.br
-/usr/share/zoneinfo    time zone directory
-.br
-/usr/share/zoneinfo/posixrules rules for POSIX-style TZ's
-.br
-/usr/share/zoneinfo/GMT        for UTC leap seconds
-.sp
-If
-.I /usr/share/zoneinfo/GMT
-is absent, UTC leap seconds are loaded from
-.IR /usr/share/zoneinfo/posixrules .
-.SH SEE ALSO
-date(1), gettimeofday(2), ctime(3), getenv(3), time(3), tzfile(5)
+.Sh FILES
+.Bl -tag -width /usr/share/zoneinfo/posixrules -compact
+.It Pa /etc/localtime
+local time zone file
+.It Pa /usr/share/zoneinfo
+time zone directory
+.It Pa /usr/share/zoneinfo/posixrules
+rules for
+.Tn POSIX Ns -style
+.Tn TZ Ns 's
+.It Pa /usr/share/zoneinfo/GMT for
+.Tn UTC
+leap seconds
+.El
+.Pp
+If the file
+.Pa /usr/share/zoneinfo/GMT
+does not exist,
+.Tn UTC
+leap seconds are loaded from
+.Pa /usr/share/zoneinfo/posixrules .
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr gettimeofday 2 ,
+.Xr ctime 3 ,
+.Xr getenv 3 ,
+.Xr time 3 ,
+.Xr tzfile 5
+.Sh HISTORY
+The
+.Fn tzset
+and
+.Fn tzsetwall
+functions are
+.Ud .
index 2dea28c..40f0241 100644 (file)
@@ -1,48 +1,64 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1986, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)@(#)ualarm.3        6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH UALARM 3  ""
-.UC 6
-.SH NAME
-ualarm \- schedule signal after specified time
-.SH SYNOPSIS
-.nf
-.B unsigned ualarm(value, interval)
-.B unsigned value;
-.B unsigned interval;
-.fi
-.SH DESCRIPTION
-.ft B
+.\"     @(#)ualarm.3   6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt UALARM 3
+.Os BSD 4.3
+.Sh NAME
+.Nm ualarm
+.Nd schedule signal after specified time
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft u_int 
+.Fn ualarm "u_int microseconds" "u_int interval"
+.Sh DESCRIPTION
+.Bf -symbolic
 This is a simplified interface to setitimer(2).
 This is a simplified interface to setitimer(2).
-.ft R
-.PP
-.I Ualarm
-causes signal SIGALRM, see
-.IR signal (3C),
-to be sent to the invoking process
-in a number of microseconds given by the
-.I value
-argument.
-Unless caught or ignored, the signal terminates the process.
-.PP
+.Ef
+.Pp
+The
+.Fn ualarm
+function
+waits a count of
+.Ar microseconds
+before asserting the terminating signal
+.Dv SIGALRM .
+System activity or time used in processing the call may cause a slight
+delay.
+.Pp
 If the
 If the
-.I interval
-argument is non-zero, the SIGALRM signal will be sent
+.Fa interval
+argument is non-zero, the
+.Dv SIGALRM
+signal will be sent
 to the process every
 to the process every
-.I interval
+.Fa interval
 microseconds after the timer expires (e.g. after
 microseconds after the timer expires (e.g. after
-.I value
+.Fa value
 microseconds have passed).
 microseconds have passed).
-.PP
-Because of scheduling delays,
-resumption of execution of when the signal is
-caught may be delayed an arbitrary amount.
-The longest specifiable delay time (on the vax) is 2147483647 microseconds.
-.PP
-The return value is the amount of time previously remaining in the alarm clock.
-.SH "SEE ALSO"
-getitimer(2), setitimer(2), sigpause(2), sigvec(2), signal(3C), sleep(3),
-alarm(3), usleep(3)
+.Sh RETURN VALUES
+When the signal has successfully been caught,
+.Fn alarm
+returns the amount of time left on the clock.
+The maximum mumber of
+.Ar microseconds
+allowed
+is 2147483647.
+.Sh SEE ALSO
+.Xr getitimer 2 ,
+.Xr setitimer 2 ,
+.Xr sigpause 2 ,
+.Xr sigvec 2 ,
+.Xr signal 3 ,
+.Xr sleep 3 ,
+.Xr alarm 3 ,
+.Xr usleep 3
+.Sh HISTORY
+The
+.Fn ualarm
+function appeared in 
+.Bx 4.3 .
index 490fd1f..4f9ceb7 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)unvis.3     1.2 (Berkeley) %G%
+.\"     @(#)unvis.3    1.3 (Berkeley) %G%
 .\"
 .\"
-.TH UNVIS 3 ""
-.UC 7
-.SH NAME
-unvis, strunvis - decode a visual representation of characters
-.SH SYNOPSIS
-.nf
-.ft B
-#include <vis.h>
-
-int unvis(cp, c, astate, flag)
-u_char *cp, c;
-int *astate, flag;
-
-int strunvis(dst, src)
-char *dst, *src;
-
-.ft R
-.fi
-.SH DESCRIPTION
-.I Unvis
+.Dd 
+.Dt UNVIS 3
+.Os
+.Sh NAME
+.Nm unvis ,
+.Nm strunvis
+.Nd decode a visual representation of characters
+.Sh SYNOPSIS
+.Fd #include <vis.h>
+.Ft int 
+.Fn unvis "u_char *cp" "u_char c" "int *astate" "int flag"
+.Ft int 
+.Fn strunvis "char *dst" "char *src"
+.Sh DESCRIPTION
+The
+.Fn unvis
 and
 and
-.I strunvis
+.Fn strunvis
+functions
 are used to decode a visual representation of characters, as produced
 are used to decode a visual representation of characters, as produced
-by the vis(3) function, back into
-its original form.  Unvis is called with successive characters in c 
+by the
+.Xr vis 3
+function, back into
+the original form.  Unvis is called with successive characters in
+.Ar c 
 until a valid
 sequence is recognized, at which time the decoded character is
 until a valid
 sequence is recognized, at which time the decoded character is
-available at the character pointed to by cp.  Strunvis decodes the
-characters pointed to by src into the buffer pointed to by dst.
-.LP
-.I Strunvis
-simply copies src to dst, decoding any escape sequences along the way,
-and returns the number of characters placed into dst, or -1 if an
-invalid escape sequence was detected.  The size of dst should be
-equal to the size of src (that is, no expansion takes place during
+available at the character pointed to by
+.Ar cp .
+Strunvis decodes the
+characters pointed to by
+.Ar src
+into the buffer pointed to by
+.Ar dst .
+.Pp
+The
+.Fn strunvis
+function
+simply copies
+.Ar src
+to
+.Ar dst ,
+decoding any escape sequences along the way,
+and returns the number of characters placed into
+.Ar dst ,
+or \-1 if an
+invalid escape sequence was detected.  The size of
+.Ar dst
+should be
+equal to the size of
+.Ar src
+(that is, no expansion takes place during
 decoding).
 decoding).
-.LP
-.I Unvis
+.Pp
+The
+.Fn unvis
+function
 implements a state machine that can be used to decode an arbitrary
 stream of bytes.  All state associated with the bytes being decoded
 is stored outside the
 implements a state machine that can be used to decode an arbitrary
 stream of bytes.  All state associated with the bytes being decoded
 is stored outside the
-.I unvis
+.Fn unvis
 function (that is, a pointer to the state is passed in), so
 calls decoding different streams can be freely intermixed.  To
 start decoding a stream of bytes, first initialize an integer
 function (that is, a pointer to the state is passed in), so
 calls decoding different streams can be freely intermixed.  To
 start decoding a stream of bytes, first initialize an integer
-to zero.  Call unvis with each successive byte, along with a pointer
+to zero.  Call
+.Fn unvis
+with each successive byte, along with a pointer
 to this integer, and a pointer to an destination character.
 to this integer, and a pointer to an destination character.
-.I Vis
+The
+.Xr unvis
+function
 has several return codes that must be handled properly.  They are:
 has several return codes that must be handled properly.  They are:
-.TP 
-0 (zero)
+.Bl -tag -width UNVIS_VALIDPUSH
+.It Li \&0 (zero)
 Another character is necessary; nothing has been recognized yet.
 Another character is necessary; nothing has been recognized yet.
-.TP
-UNVIS_VALID    
+.It Dv  UNVIS_VALID    
 A valid character has been recognized and is available at the location
 pointed to by cp.
 A valid character has been recognized and is available at the location
 pointed to by cp.
-.TP
-UNVIS_VALIDPUSH
+.It Dv  UNVIS_VALIDPUSH
 A valid character has been recognized and is available at the location
 pointed to by cp; however, the character currently passed in should
 be passed in again.
 A valid character has been recognized and is available at the location
 pointed to by cp; however, the character currently passed in should
 be passed in again.
-.TP
-UNVIS_NOCHAR
+.It Dv  UNVIS_NOCHAR
 A valid sequence was detected, but no character was produced.  This
 return code is necessary to indicate a logical break between characters.
 A valid sequence was detected, but no character was produced.  This
 return code is necessary to indicate a logical break between characters.
-.TP
-UNVIS_SYNBAD
+.It Dv  UNVIS_SYNBAD
 An invalid esacpe sequence was detected, or the decoder is in an
 unknown state.  The decoder is placed into the starting state.
 An invalid esacpe sequence was detected, or the decoder is in an
 unknown state.  The decoder is placed into the starting state.
-.LP
+.El
+.Pp
 When all bytes in the stream have been processed, call
 When all bytes in the stream have been processed, call
-.I unvis
+.Fn unvis
 one more time with flag set to
 one more time with flag set to
-.B UNVIS_END
+.Dv UNVIS_END
 to extract any remaining character (the character passed in is ignored).
 to extract any remaining character (the character passed in is ignored).
-.LP
+.Pp
 The following code fragment illustrates a proper use of
 The following code fragment illustrates a proper use of
-.IR unvis .
-.PP
-.nf
+.Fn unvis .
+.Bd -literal -offset indent
 int state = 0;
 char out;
 
 int state = 0;
 char out;
 
@@ -102,11 +121,16 @@ again:
                goto again;
        case UNVIS_SYNBAD:
                (void)fprintf(stderr, "bad sequence!\n");
                goto again;
        case UNVIS_SYNBAD:
                (void)fprintf(stderr, "bad sequence!\n");
-               exit(1);
+       exit(1);
        }
 }
 if (unvis(&out, (char)0, &state, UNVIS_END) == UNVIS_VALID)
        (void) putchar(out);
        }
 }
 if (unvis(&out, (char)0, &state, UNVIS_END) == UNVIS_VALID)
        (void) putchar(out);
-.fi
-.SH "SEE ALSO"
-vis(1)
+.Ed
+.Sh SEE ALSO
+.Xr vis 1
+.Sh HISTORY
+The
+.Fn unvis
+function is
+.Ud .
index e04128e..bebbc0b 100644 (file)
@@ -1,40 +1,59 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1986, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)@(#)usleep.3        6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH USLEEP 3  ""
-.UC 6
-.SH NAME
-usleep \- suspend execution for interval
-.SH SYNOPSIS
-.nf
-.B usleep(useconds)
-.B unsigned useconds;
-.fi
-.SH DESCRIPTION
-The current process is suspended from execution for the number
-of microseconds specified by the argument.
-The actual suspension time may be an arbitrary amount longer
-because of other activity in the system
-or because of the time spent in processing the call.
-.PP
-The routine is implemented by setting an interval timer
-and pausing until it occurs.
-The previous state of this timer is saved and restored.
-If the sleep time exceeds the time to the expiration of the
-previous timer,
-the process sleeps only until the signal would have occurred, and the
-signal is sent a short time later.
-.PP
+.\"     @(#)usleep.3   6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt USLEEP 3
+.Os BSD 4.3
+.Sh NAME
+.Nm usleep
+.Nd suspend execution for interval of microseconds
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft void
+.Fn usleep "u_int microseconds"
+.Sh DESCRIPTION
+The
+.Fn sleep
+function
+suspends execution of the calling process
+for
+.Fa microseconds
+of time.
+System activity or time spent in processing the
+call may lengthen the sleep slightly.
+.Pp
+If a timer is already running on the process its state is saved.
+If the value
+.Fa microseconds
+is more than or equal to the remaining clock time for the saved timer,
+the sleep time is set to
+the remaining clock time.
+The state of the previous timer
+is restored after
+.Fa microseconds
+has passed.
+.Pp
 This routine is implemented using 
 This routine is implemented using 
-.IR setitimer (2);
+.Xr setitimer 2 ;
 it requires eight system calls each time it is invoked.
 A similar but less compatible function can be obtained with a single
 it requires eight system calls each time it is invoked.
 A similar but less compatible function can be obtained with a single
-.IR select (2);
-it would not restart after signals, but would not interfere
+.Xr select 2 ;
+such a function would not restart after signals, but would not interfere
 with other uses of
 with other uses of
-.IR setitimer . 
-.SH "SEE ALSO"
-setitimer(2), getitimer(2), sigpause(2), ualarm(3), sleep(3), alarm(3)
+.Xr setitimer .
+.Sh SEE ALSO
+.Xr setitimer 2 ,
+.Xr getitimer 2 ,
+.Xr sigpause 2 ,
+.Xr ualarm 3 ,
+.Xr sleep 3 ,
+.Xr alarm 3
+.Sh HISTORY
+The
+.Fn usleep
+function appeared in 
+.Bx 4.3 .
index a56001c..249bc29 100644 (file)
@@ -1,40 +1,40 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)utime.3     6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH UTIME 3C ""
-.UC 4
-.SH NAME
-utime \- set file times
-.SH SYNOPSIS
-.nf
-.B #include <sys/types.h>
-.PP
-.B utime(file, timep)
-.B char *file;
-.B time_t timep[2];
-.fi
-.SH DESCRIPTION
-.ft B
-This interface is obsoleted by utimes(2).
-.br
+.\"     @(#)utime.3    6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt UTIME 3
+.Os BSD 4
+.Sh NAME
+.Nm utime
+.Nd set file times
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft int
+.Fn utime "const char *file" "const struct utimbuf *timep"
+.Sh DESCRIPTION
+.Bf -symbolic
+This interface is obsoleted by utimes(2) .
 It is available from the compatibility library, libcompat.
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
+.Ef
+.Pp
+.Sh DESCRIPTION
 The
 The
-.I utime
-call
-uses the
-`accessed' and `updated' times in that order
-from the
-.I timep
-vector
-to set the corresponding recorded times for
-.IR file .
-.PP
-The caller must be the owner of the file or the super-user.
-The `inode-changed' time of the file is set to the current time.
-.SH SEE ALSO
-utimes(2), stat(2)
+.Fn utime
+function sets the access and modification times of the named file from
+the structures in the argument array
+.Fa timep .
+.Pp
+The calling process's effective user ID must match the owner of the
+file or must be the super-user.
+.Sh SEE ALSO
+.Xr utimes 2 ,
+.Xr stat 2
+.Sh HISTORY
+A
+.Fn utime
+function appeared in 
+.At v7 .
index 9fc9ea2..cab2d2e 100644 (file)
@@ -1,37 +1,49 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)valloc.3    6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH VALLOC 3C ""
-.UC 3
-.SH NAME
-valloc \- aligned memory allocator
-.SH SYNOPSIS
-.nf
-.B char *valloc(size)
-.B unsigned size;
-.fi
-.SH DESCRIPTION
-.ft B
-Valloc is obsoleted by the current version of malloc,
+.\"     @(#)valloc.3   6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt VALLOC 3
+.Os BSD 3
+.Sh NAME
+.Nm valloc
+.Nd aligned memory allocation function
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft char *
+.Fn valloc "unsigned size"
+.Sh DESCRIPTION
+.Bf -symbolic
+Valloc is obsoleted by the current version of malloc(3),
 which aligns page-sized and larger allocations.
 which aligns page-sized and larger allocations.
-.ft R
-.PP
-.I Valloc
+.Ef
+.Pp
+The
+.Fn valloc
+function
 allocates
 allocates
-.I size
+.Fa size
 bytes aligned on a page boundary.
 It is implemented by calling
 bytes aligned on a page boundary.
 It is implemented by calling
-.IR malloc (3)
+.Xr malloc 3
 with a slightly larger request, saving the true beginning of the block
 allocated, and returning a properly aligned pointer.
 with a slightly larger request, saving the true beginning of the block
 allocated, and returning a properly aligned pointer.
-.SH DIAGNOSTICS
-.I Valloc
-returns a null pointer (0) if there is no available memory
-or if the arena has been detectably corrupted by storing outside the bounds
-of a block.
-.SH BUGS
-.I Vfree
-isn't implemented.
+.Sh RETURN VALUES
+The
+.Fn valloc
+function returns
+a pointer to the allocated space if successful; otherwise
+a null pointer is returned
+.Sh HISTORY
+The
+.Fn valloc
+function appeared in 
+.Bx 3.0 .
+.Sh BUGS
+A
+.Em vfree
+function
+has not been implemented.
index 3d22680..f9b6a3d 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)vis.3       5.6 (Berkeley) %G%
+.\"     @(#)vis.3      5.7 (Berkeley) %G%
 .\"
 .\"
-.TH VIS 3 ""
-.UC 7
-.SH NAME
-vis \- visually encode characters
-.SH SYNOPSIS
-.nf
-.ft B
-#include <vis.h>
-
-char *vis(dst, c, flag, nextc)
-char *dst, c, nextc;
-int flag;
-
-int strvis(dst, src, flag)
-char *dst, *src;
-int flag;
-
-int strvisx(dst, src, len, flag)
-char *dst, *src;
-int len, flag;
-
-.ft R
-.fi
-.SH DESCRIPTION
-.I Vis
-copies into dst a string which represents the character c.  If
-c needs no encoding, it is copied in unaltered.  The string is
+.Dd 
+.Dt VIS 3
+.Os
+.Sh NAME
+.Nm vis
+.Nd visually encode characters
+.Sh SYNOPSIS
+.Fd #include <vis.h>
+.Ft char *
+.Fn vis "char *dst" "char c" "int flag" "char nextc"
+.Ft int 
+.Fn strvis "char *dst" "char *src" "int flag"
+.Ft int 
+.Fn strvisx "char *dst" "char *src" "int len" "int flag"
+.Sh DESCRIPTION
+The
+.Fn vis
+function
+copies into
+.Fa dst
+a string which represents the character
+.Fa c .
+If
+.Fa c
+needs no encoding, it is copied in unaltered.  The string is
 null terminated, and a pointer to the end of the string is
 returned.  The maximum length of any encoding is four
 null terminated, and a pointer to the end of the string is
 returned.  The maximum length of any encoding is four
-characters (not including the trailing NULL); thus, when
+characters (not including the trailing
+.Dv NULL ) ; 
+thus, when
 encoding a set of characters into a buffer, the size of the buffer should
 encoding a set of characters into a buffer, the size of the buffer should
-be four times the number of characters encoded, plus one for the trailing NULL.
+be four times the number of characters encoded, plus one for the trailing
+.Dv NULL . 
 The flag parameter is used for altering the default range of
 characters considered for encoding and for altering the visual
 representation.
 The flag parameter is used for altering the default range of
 characters considered for encoding and for altering the visual
 representation.
-The additional character, nextc, is only used when selecting the
-VIS_CSTYLE encoding format (explained below).
-.PP
-Strvis and strvisx copy into dst a visual representation of
-the string src.  Strvis encodes characters from src up to the
-first NULL.  Strvisx encodes exactly len characters from src (this
-is useful for encoding a block of data that may contain NULL's).
-Both forms NULL terminate dst.  Dst must be four times the number
-of characters encoded from src (plus one for the NULL).  Both
+The additional character,
+.Fa nextc ,
+is only used when selecting the
+.Dv VIS_CSTYLE
+encoding format (explained below).
+.Pp
+The
+.Fn strvis
+and
+.Fn strvisx
+functions copy into
+.Fa dst
+a visual representation of
+the string
+.Fa src .
+The
+.Fn strvis
+function encodes characters from
+.Fa src
+up to the
+first
+.Dv NULL . 
+The
+.Fn strvisx
+function encodes exactly
+.Fa len
+characters from
+.Fa src
+(this
+is useful for encoding a block of data that may contain
+.Dv NULL Ns 's).
+Both forms
+.Dv NULL
+terminate
+.Fa dst .
+The size of
+.Fa dst
+must be four times the number
+of characters encoded from
+.Fa src
+(plus one for the
+.Dv NULL ) . 
+Both
 forms return the number of characters in dst (not including
 forms return the number of characters in dst (not including
-the trailing NULL).
-.PP
+the trailing
+.Dv NULL ) . 
+.Pp
 The encoding is a unique, invertible representation comprised entirely of
 graphic characters; it can be decoded back into the original form using 
 The encoding is a unique, invertible representation comprised entirely of
 graphic characters; it can be decoded back into the original form using 
-the unvis(3) or strunvis(3) functions.
-.PP
+the
+.Xr unvis 3
+or
+.Xr strunvis 3
+functions.
+.Pp
 There are two parameters that can be controlled: the range of
 characters that are encoded, and the type
 of representation used.  
 There are two parameters that can be controlled: the range of
 characters that are encoded, and the type
 of representation used.  
-By default, all non-graphic characters (see isgraph(3))
-except space, tab, and newline are encoded.  The following flags
+By default, all non-graphic characters.
+except space, tab, and newline are encoded.
+(See
+.Xr isgraph 3 . )
+The following flags
 alter this:
 alter this:
-.TP
-VIS_SP
+.Bl -tag -width VIS_WHITEX
+.It Dv VIS_SP
 Also encode space.
 Also encode space.
-.TP
-VIS_TAB                
+.It Dv VIS_TAB         
 Also encode tab.
 Also encode tab.
-.TP
-VIS_NL
+.It Dv VIS_NL
 Also encode newline.
 Also encode newline.
-.TP
-VIS_WHITE      
-Synonym for VIS_SP | VIS_TAB | VIS_NL.
-.TP
-VIS_SAFE       
+.It Dv VIS_WHITE       
+Synonym for
+.Dv VIS_SP
+\&|
+.Dv VIS_TAB
+\&|
+.Dv VIS_NL .
+.It Dv VIS_SAFE        
 Only encode "unsafe" characters.  Unsafe means control
 characters which may cause common terminals to perform
 unexpected functions.  Currently this form allows space,
 tab, newline, backspace, bell, and return - in addition
 to all graphic characters - unencoded. 
 Only encode "unsafe" characters.  Unsafe means control
 characters which may cause common terminals to perform
 unexpected functions.  Currently this form allows space,
 tab, newline, backspace, bell, and return - in addition
 to all graphic characters - unencoded. 
-.PP
+.El
+.Pp
 There are three forms of encoding.
 There are three forms of encoding.
-All forms use the backslash character (``\e'') to introduce a special
+All forms use the backslash character
+.Ql \e
+to introduce a special
 sequence; two backslashes are used to represent a real backslash.
 These are the visual formats:
 sequence; two backslashes are used to represent a real backslash.
 These are the visual formats:
-.TP
-(default)
-Use an ``M'' to represent meta characters (characters with the 8th
-bit set), and use carat (``^'') to represent control characters see
-(\fIiscntrl\fP(3)).
+.Bl -tag -width VIS_CSTYLE
+.It (default)
+Use an
+.Ql M
+to represent meta characters (characters with the 8th
+bit set), and use carat
+.Ql ^
+to represent control characters see
+.Pf ( Xr iscntrl 3 ) .
 The following formats are used:
 The following formats are used:
-.RS
-.TP
-\e^C
-Represents the control character ``C''.
-Spans characters \e000 through \e037, and \e177 (as \e^?).
-.TP
-\eM-C
-Represents character ``C'' with the 8th bit set.
-Spans characters \e241 through \e376.
-.TP
-\eM^C
-Represents control character ``C'' with the 8th bit set.
-Spans characters \e200 through \e237, and \e377 (as \eM^?).
-.TP
-\e040
-Represents ACSII space.
-.TP
-\e240
+.Bl -tag -width xxxxx
+.It Dv \e^C
+Represents the control character
+.Ql C .
+Spans characters
+.Ql \e000
+through
+.Ql \e037 ,
+and
+.Ql \e177
+(as
+.Ql \e^? ) .
+.It Dv \eM-C
+Represents character
+.Ql C
+with the 8th bit set.
+Spans characters
+.Ql \e241
+through
+.Ql \e376 .
+.It Dv \eM^C
+Represents control character
+.Ql C
+with the 8th bit set.
+Spans characters
+.Ql \e200
+through
+.Ql \e237 ,
+and
+.Ql \e377
+(as
+.Ql \eM^? ) .
+.It Dv \e040
+Represents
+.Tn ASCII
+space.
+.It Dv \e240
 Represents Meta-space.
 Represents Meta-space.
-.sp
-.RE
-.TP
-VIS_CSTYLE
+.El
+.Pp
+.It Dv VIS_CSTYLE
 Use C-style backslash sequences to represent standard non-printable
 characters.
 The following sequences are used to represent the indicated characters:
 Use C-style backslash sequences to represent standard non-printable
 characters.
 The following sequences are used to represent the indicated characters:
-.sp
-.nf
-\ea   - BEL (007)
-\eb   - BS  (010)
-\ef   - NP  (014)
-\en   - NL  (012)
-\er   - CR  (015)
-\et   - HT  (011)
-\ev   - VT  (013)
-\e0   - NUL (000)
-.fi
-.sp
+.Bd -unfilled -offset indent
+.Li \ea Tn  - BEL No (007)
+.Li \eb Tn  - BS No (010)
+.Li \ef Tn  - NP No (014)
+.Li \en Tn  - NL No (012)
+.Li \er Tn  - CR No (015)
+.Li \et Tn  - HT No (011)
+.Li \ev Tn  - VT No (013)
+.Li \e0 Tn  - NUL No (000)
+.Ed
+.Pp
 When using this format, the nextc parameter is looked at to determine
 When using this format, the nextc parameter is looked at to determine
-if a NULL character can be encoded as ``\e0'' instead of ``\e000''.
-If nextc is an octal digit, the latter representation is used to
+if a
+.Dv NULL
+character can be encoded as
+.Ql \e0
+instead of
+.Ql \e000 .
+If
+.Fa nextc
+is an octal digit, the latter representation is used to
 avoid ambiguity.
 avoid ambiguity.
-.TP
-VIS_OCTAL
-Use a three digit octal sequence.  The form is ``\eddd'' where
-d represents an octal digit.
-.PP
-There is one additional flag, VIS_NOSLASH, which inhibits the
+.It Dv VIS_OCTAL
+Use a three digit octal sequence.  The form is
+.Ql \eddd
+where
+.Em d
+represents an octal digit.
+.El
+.Pp
+There is one additional flag,
+.Dv VIS_NOSLASH ,
+which inhibits the
 doubling of backslashes and the backslash before the default
 doubling of backslashes and the backslash before the default
-format (that is, control characters are represented by ^C and
-meta characters as M-C).  With this flag set, the encoding is
+format (that is, control characters are represented by
+.Ql ^C
+and
+meta characters as
+.Ql M-C ) .
+With this flag set, the encoding is
 ambiguous and non-invertible.
 ambiguous and non-invertible.
-.SH "SEE ALSO"
-vis(1), unvis(1), unvis(3)
+.Sh SEE ALSO
+.Xr unvis 1 ,
+.Xr unvis 3
+.Xr strunvis 3
+.Sh HISTORY
+These
+functions are
+.Ud .
index 7185fde..62633cf 100644 (file)
@@ -1,93 +1,77 @@
-.\"    @(#)ctype.3     6.4 (Berkeley) %G%
+.\" Copyright (c) 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH CTYPE 3  ""
-.AT 3
-.SH NAME
-isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, toupper, tolower, toascii \- character classification macros
-.SH SYNOPSIS
-.B #include <ctype.h>
-.PP
-.B isalpha(c)
-.PP
-.B . . .
-.SH DESCRIPTION
-These macros classify ASCII-coded integer values
-by table lookup.
-Each is a predicate returning nonzero for true,
-zero for false.
-.I Isascii
+.\"
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)ctype.3    6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt CTYPE 3
+.Os
+.Sh NAME
+.Nm isalpha ,
+.Nm isupper ,
+.Nm islower ,
+.Nm isdigit ,
+.Nm isxdigit ,
+.Nm isalnum ,
+.Nm isspace ,
+.Nm ispunct ,
+.Nm isprint ,
+.Nm isgraph ,
+.Nm iscntrl ,
+.Nm isascii ,
+.Nm toupper ,
+.Nm tolower ,
+.Nm toascii
+.Nd character classification macros
+.Sh SYNOPSIS
+.Fd #include <ctype.h>
+.Fa int c
+.br
+.Fn isalpha c
+.Fn isupper c
+.Fn islower c
+.Fn isdigit c
+.Fn isxdigit c
+.Fn isalnum c
+.Fn isspace c
+.Fn ispunct c
+.Fn isprint c
+.Fn isgraph c
+.Fn iscntrl c
+.Fn isascii c
+.Fn toupper c
+.Fn tolower c
+.Fn toascii c
+.Sh DESCRIPTION
+The above macros perform character tests and conversions on the integer
+.Ar c .
+.Pp
+See the specific manual pages for more information.
+.Sh SEE ALSO
+.Xr isalpha 3 ,
+.Xr isupper 3 ,
+.Xr islower 3 ,
+.Xr isdigit 3 ,
+.Xr isxdigit 3 ,
+.Xr isalnum 3 ,
+.Xr isspace 3 ,
+.Xr ispunct 3 ,
+.Xr isprint 3 ,
+.Xr isgraph 3 ,
+.Xr iscntrl 3 ,
+.Xr isascii 3 ,
+.Xr toupper 3 ,
+.Xr tolower 3 ,
+.Xr toascii 3 ,
+.Xr ascii 7
+.Sh STANDARDS
+These functions, except for
+.Fn toupper ,
+.Fn tolower
 and
 and
-.I toascii
-are defined on all integer values; the rest
-are defined only where 
-.I isascii
-is true and on the single non-ASCII value
-EOF (see
-.IR stdio (3S)).
-.TP 15n
-.I isalpha
-.I c
-is a letter
-.TP
-.I isupper
-.I c
-is an upper case letter
-.TP
-.I islower 
-.I c
-is a lower case letter
-.TP
-.I isdigit
-.I c
-is a digit
-.TP
-.I isxdigit
-.I c
-is a hex digit
-.TP
-.I isalnum
-.I c
-is an alphanumeric character
-.TP
-.I isspace
-.I c
-is a space, tab, carriage return, newline, vertical tab, or formfeed
-.TP
-.I ispunct
-.I c
-is a punctuation character (neither control nor alphanumeric)
-.TP
-.I isprint
-.I c
-is a printing character, code 040(8) (space) through 0176 (tilde)
-.TP
-.I isgraph
-.I c
-is a printing character, similar to
-.I isprint
-except false for space.
-.TP
-.I iscntrl
-.I c
-is a delete character (0177) or ordinary control character
-(less than 040).
-.TP
-.I isascii
-.I c
-is an ASCII character, code less than 0200
-.TP
-.I tolower
-.I c
-is converted to lower case.  Return value is undefined if not 
-.I isupper(c).
-.TP
-.I toupper
-.I c
-is converted to upper case.  Return value is undefined if not 
-.I islower(c).
-.TP
-.I toascii
-.I c
-is converted to be a valid ascii character.
-.SH "SEE ALSO"
-ascii(7)
+.Fn toascii ,
+conform to
+.St -ansiC .
index e521206..9d68be6 100644 (file)
@@ -1,43 +1,50 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)byteorder.3 6.6 (Berkeley) %G%
+.\"     @(#)byteorder.3        6.7 (Berkeley) %G%
 .\"
 .\"
-.TH BYTEORDER 3 ""
-.UC 5
-.SH NAME
-htonl, htons, ntohl, ntohs \- convert values between host and network byte order
-.SH SYNOPSIS
-.nf
-.B #include <sys/param.h>
-.PP
-.B netlong = htonl(hostlong);
-.B u_long netlong, hostlong;
-.PP
-.B netshort = htons(hostshort);
-.B u_short netshort, hostshort;
-.PP
-.B hostlong = ntohl(netlong);
-.B u_long hostlong, netlong;
-.PP
-.B hostshort = ntohs(netshort);
-.B u_short hostshort, netshort;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt BYTEORDER 3
+.Os BSD 4.2
+.Sh NAME
+.Nm htonl ,
+.Nm htons ,
+.Nm ntohl ,
+.Nm ntohs
+.Nd convert values between host and network byte order
+.Sh SYNOPSIS
+.Fd #include <sys/param.h>
+.Ft u_long
+.Fn htonl "u_long hostlong"
+.Ft u_short
+.Fn htons "u_short hostshort"
+.Ft u_long
+.Fn ntohl "u_long netlong"
+.Ft u_short
+.Fn ntohs "u_short netshort"
+.Sh DESCRIPTION
 These routines convert 16 and 32 bit quantities between network
 byte order and host byte order.
 On machines which have a byte order which is the same as the network
 order, routines are defined as null macros.
 These routines convert 16 and 32 bit quantities between network
 byte order and host byte order.
 On machines which have a byte order which is the same as the network
 order, routines are defined as null macros.
-.PP
+.Pp
 These routines are most often used in conjunction with Internet
 addresses and ports as returned by
 These routines are most often used in conjunction with Internet
 addresses and ports as returned by
-.IR gethostbyname (3)
+.Xr gethostbyname 3
 and
 and
-.IR getservent (3).
-.SH "SEE ALSO"
-gethostbyname(3), getservent(3)
-.SH BUGS
-The VAX handles bytes backwards from most everyone else in
+.Xr getservent 3 .
+.Sh SEE ALSO
+.Xr gethostbyname 3 ,
+.Xr getservent 3
+.Sh HISTORY
+The
+.Nm byteorder
+functions appeared in 
+.Bx 4.2 .
+.Sh BUGS
+On the
+.Tn VAX
+bytes are handled backwards from most everyone else in
 the world.  This is not expected to be fixed in the near future.
 the world.  This is not expected to be fixed in the near future.
index aefdf29..6773f4a 100644 (file)
@@ -1,55 +1,49 @@
-.\" Copyright (c) 1983, 1987 The Regents of the University of California.
+.\" Copyright (c) 1983, 1987, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)gethostbyname.3     6.12 (Berkeley) %G%
+.\"     @(#)gethostbyname.3    6.13 (Berkeley) %G%
 .\"
 .\"
-.TH GETHOSTBYNAME 3 ""
-.UC 5
-.SH NAME
-gethostbyname, gethostbyaddr, gethostent, sethostent, endhostent, herror \- get network host entry
-.SH SYNOPSIS
-.B "#include <netdb.h>
-.PP
-.B "extern int h_errno;
-.PP
-.B "struct hostent *gethostbyname(name)
-.br
-.B "char *name;
-.PP
-.B "struct hostent *gethostbyaddr(addr, len, type)
-.br
-.B "char *addr; int len, type;
-.PP
-.B "struct hostent *gethostent()
-.PP
-.B "sethostent(stayopen)
-.br
-.B "int stayopen;
-.PP
-.B "endhostent()
-.PP
-.B "herror(string)
-.br
-.B "char *string;
-.PP
-.SH DESCRIPTION
-.I Gethostbyname
+.Dd 
+.Dt GETHOSTBYNAME 3
+.Os BSD 4.2
+.Sh NAME
+.Nm gethostbyname ,
+.Nm gethostbyaddr ,
+.Nm gethostent ,
+.Nm sethostent ,
+.Nm endhostent ,
+.Nm herror
+.Nd get network host entry
+.Sh SYNOPSIS
+.Fd #include <netdb.h>
+.Fd extern struct h_errno;
+.Ft struct hostent *
+.Fn gethostbyname "char *name"
+.Ft struct hostent *
+.Fn gethostbyaddr "char *addr" "int len" "int type"
+.Ft struct hostent *
+.Fn gethostent void
+.Fn sethostent "int stayopen"
+.Fn endhostent void
+.Fn herror "char *string"
+.Sh DESCRIPTION
+The
+.Fn gethostbyname
 and
 and
-.I gethostbyaddr
+.Fn gethostbyaddr
+functions
 each return a pointer to an object with the
 following structure describing an internet host
 referenced by name or by address, respectively.
 This structure contains either the information obtained from the name server,
 each return a pointer to an object with the
 following structure describing an internet host
 referenced by name or by address, respectively.
 This structure contains either the information obtained from the name server,
-.IR named (8),
+.Xr named 8 ,
 or broken-out fields from a line in 
 or broken-out fields from a line in 
-.IR /etc/hosts .
+.Pa /etc/hosts .
 If the local name server is not running these routines do a lookup in
 If the local name server is not running these routines do a lookup in
-.IR /etc/hosts .
-.RS
-.PP
-.nf
+.Pa /etc/hosts .
+.Bd -literal -offset indent
 struct hostent {
        char    *h_name;        /* official name of host */
        char    **h_aliases;    /* alias list */
 struct hostent {
        char    *h_name;        /* official name of host */
        char    **h_aliases;    /* alias list */
@@ -58,90 +52,103 @@ struct     hostent {
        char    **h_addr_list;  /* list of addresses from name server */
 };
 #define        h_addr  h_addr_list[0]  /* address, for backward compatibility */
        char    **h_addr_list;  /* list of addresses from name server */
 };
 #define        h_addr  h_addr_list[0]  /* address, for backward compatibility */
-.ft R
-.ad
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The members of this structure are:
 The members of this structure are:
-.TP \w'h_addr_list'u+2n
-h_name
+.Bl -tag -width h_addr_list
+.It Fa h_name
 Official name of the host.
 Official name of the host.
-.TP \w'h_addr_list'u+2n
-h_aliases
+.It Fa h_aliases
 A zero terminated array of alternate names for the host.
 A zero terminated array of alternate names for the host.
-.TP \w'h_addr_list'u+2n
-h_addrtype
-The type of address being returned; currently always AF_INET.
-.TP \w'h_addr_list'u+2n
-h_length
+.It Fa h_addrtype
+The type of address being returned; currently always
+.Dv AF_INET .
+.It Fa h_length
 The length, in bytes, of the address.
 The length, in bytes, of the address.
-.TP \w'h_addr_list'u+2n
-h_addr_list
+.It Fa h_addr_list
 A zero terminated array of network addresses for the host.
 Host addresses are returned in network byte order.
 A zero terminated array of network addresses for the host.
 Host addresses are returned in network byte order.
-.TP \w'h_addr_list'u+2n
-h_addr
-The first address in h_addr_list; this is for backward compatiblity.
-.PP
+.It Fa h_addr
+The first address in
+.Fa h_addr_list ;
+this is for backward compatiblity.
+.Pp
 When using the nameserver,
 When using the nameserver,
-.I gethostbyname
+.Fn gethostbyname
 will search for the named host in the current domain and its parents
 unless the name ends in a dot.
 will search for the named host in the current domain and its parents
 unless the name ends in a dot.
-If the name contains no dot, and if the environment variable ``HOSTALAIASES''
+If the name contains no dot, and if the environment variable
+.Dq Ev HOSTALIASES
 contains the name of an alias file, the alias file will first be searched
 for an alias matching the input name.
 See
 contains the name of an alias file, the alias file will first be searched
 for an alias matching the input name.
 See
-.IR hostname (7)
+.Xr hostname 7
 for the domain search procedure and the alias file format.
 for the domain search procedure and the alias file format.
-.PP
-.I Sethostent
-may be used to request the use of a connected TCP socket for queries.
+.Pp
+The
+.Fn sethostent
+function
+may be used to request the use of a connected
+.Tn TCP
+socket for queries.
 If the
 If the
-.I stayopen
+.Fa stayopen
 flag is non-zero,
 flag is non-zero,
-this sets the option to send all queries to the name server using TCP
+this sets the option to send all queries to the name server using
+.Tn TCP
 and to retain the connection after each call to 
 and to retain the connection after each call to 
-.I gethostbyname
+.Fn gethostbyname
 or
 or
-.IR gethostbyaddr .
-Otherwise, queries are performed using UDP datagrams.
-.PP
-.I Endhostent
-closes the TCP connection.
-.SH DIAGNOSTICS
-.PP
+.Fn gethostbyaddr .
+Otherwise, queries are performed using
+.Tn UDP
+datagrams.
+.Pp
+The
+.Fn endhostent
+function
+closes the
+.Tn TCP
+connection.
+.Sh FILES
+.Bl -tag -width /etc/hosts -compact
+.It Pa /etc/hosts
+.El
+.Sh DIAGNOSTICS
 Error return status from 
 Error return status from 
-.I gethostbyname
+.Fn gethostbyname
 and
 and
-.I gethostbyaddr
+.Fn gethostbyaddr
 is indicated by return of a null pointer.
 The external integer
 is indicated by return of a null pointer.
 The external integer
-.IR h_errno
+.Va h_errno
 may then be checked to see whether this is a temporary failure
 or an invalid or unknown host.
 The routine
 may then be checked to see whether this is a temporary failure
 or an invalid or unknown host.
 The routine
-.I herror
+.Fn herror
 can be used to print an error message describing the failure.
 If its argument
 can be used to print an error message describing the failure.
 If its argument
-.I string
-is non-NULL, it is printed, followed by a colon and a space.
+.Fa string
+is
+.Pf non Dv -NULL ,
+it is printed, followed by a colon and a space.
 The error message is printed with a trailing newline.
 The error message is printed with a trailing newline.
-.PP
-.IR h_errno
+.Pp
+The variable
+.Va h_errno
 can have the following values:
 can have the following values:
-.RS
-.IP HOST_NOT_FOUND \w'HOST_NOT_FOUND'u+2n
+.Bl -tag -width HOST_NOT_FOUND
+.It Dv HOST_NOT_FOUND
 No such host is known.
 No such host is known.
-.IP TRY_AGAIN \w'HOST_NOT_FOUND'u+2n
+.It Dv TRY_AGAIN
 This is usually a temporary error
 and means that the local server did not receive
 a response from an authoritative server.
 A retry at some later time may succeed.
 This is usually a temporary error
 and means that the local server did not receive
 a response from an authoritative server.
 A retry at some later time may succeed.
-.IP NO_RECOVERY \w'HOST_NOT_FOUND'u+2n
+.It Dv NO_RECOVERY
 Some unexpected server failure was encountered.
 This is a non-recoverable error.
 Some unexpected server failure was encountered.
 This is a non-recoverable error.
-.IP NO_DATA \w'HOST_NOT_FOUND'u+2n
+.It Dv NO_DATA
 The requested name is valid but does not have an IP address; 
 this is not a temporary error.  
 This means that the name is known to the name server but there is no address
 The requested name is valid but does not have an IP address; 
 this is not a temporary error.  
 This means that the name is known to the name server but there is no address
@@ -149,43 +156,65 @@ associated with this name.
 Another type of request to the name server using this domain name
 will result in an answer;
 for example, a mail-forwarder may be registered for this domain.
 Another type of request to the name server using this domain name
 will result in an answer;
 for example, a mail-forwarder may be registered for this domain.
-.RE
-.SH FILES
-/etc/hosts
-.SH "SEE ALSO"
-resolver(3), hosts(5), hostname(7), named(8)
-.SH CAVEAT
-.PP
-.I Gethostent
+.El
+.Sh SEE ALSO
+.Xr resolver 3 ,
+.Xr hosts 5 ,
+.Xr hostname 7 ,
+.Xr named 8
+.Sh CAVEAT
+The
+.Fn gethostent
+function
 is defined, and
 is defined, and
-.I sethostent
+.Fn sethostent
 and
 and
-.I endhostent
+.Fn endhostent
 are redefined,
 when
 are redefined,
 when
-.IR libc
+.Xr libc 3
 is built to use only the routines to lookup in
 is built to use only the routines to lookup in
-.IR /etc/hosts 
+.Pa /etc/hosts
 and not the name server.
 and not the name server.
-.PP
-.I Gethostent
+.Pp
+The
+.Fn gethostent
+function
 reads the next line of
 reads the next line of
-.IR /etc/hosts ,
+.Pa /etc/hosts ,
 opening the file if necessary.
 opening the file if necessary.
-.PP
-.I Sethostent 
+.Pp
+The
+.Fn sethostent
+function
 is redefined to open and rewind the file.  If the
 is redefined to open and rewind the file.  If the
-.I stayopen
+.Fa stayopen
 argument is non-zero,
 the hosts data base will not be closed after each call to
 argument is non-zero,
 the hosts data base will not be closed after each call to
-.I gethostbyname
+.Fn gethostbyname
 or
 or
-.IR gethostbyaddr .
-.I Endhostent
+.Fn gethostbyaddr .
+The
+.Fn endhostent
+function
 is redefined to close the file.
 is redefined to close the file.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.  Only the Internet
+.Sh HISTORY
+The
+.Fn herror
+function appeared in 
+.Bx 4.3 .
+The
+.Fn endhostent ,
+.Fn gethostbyaddr ,
+.Fn gethostbyname ,
+.Fn gethostent ,
+and
+.Fn sethostent
+functions appeared in
+.Bx 4.2 .
+.Sh BUGS
+These functions use static data storage;
+if the data is needed for future use, it should be
+copied before any subsequent calls overwrite it.
+Only the Internet
 address format is currently understood.
 address format is currently understood.
index ebbcc8f..f50fe94 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getnetent.3 6.5 (Berkeley) %G%
+.\"     @(#)getnetent.3        6.6 (Berkeley) %G%
 .\"
 .\"
-.TH GETNETENT 3 ""
-.UC 5
-.SH NAME
-getnetent, getnetbyaddr, getnetbyname, setnetent, endnetent \- get network entry
-.SH SYNOPSIS
-.nf
-.ft B
-#include <netdb.h>
-.PP
-.ft B
-struct netent *getnetent()
-.PP
-.ft B
-struct netent *getnetbyname(name)
-char *name;
-.PP
-.ft B
-struct netent *getnetbyaddr(net, type)
-long net;
-int type;
-.PP
-.ft B
-setnetent(stayopen)
-int stayopen;
-.PP
-.ft B
-endnetent()
-.fi
-.SH DESCRIPTION
-.IR Getnetent ,
-.IR getnetbyname ,
+.Dd 
+.Dt GETNETENT 3
+.Os BSD 4.2
+.Sh NAME
+.Nm getnetent ,
+.Nm getnetbyaddr ,
+.Nm getnetbyname ,
+.Nm setnetent ,
+.Nm endnetent
+.Nd get network entry
+.Sh SYNOPSIS
+.Fd #include <netdb.h>
+.Ft struct netent *
+.Fn getnetent 
+.Ft struct netent *
+.Fn getnetbyname "char *name"
+.Ft struct netent *
+.Fn getnetbyaddr "long net" "int type"
+.Fn setnetent "int stayopen"
+.Fn endnetent 
+.Sh DESCRIPTION
+The
+.Fn getnetent ,
+.Fn getnetbyname ,
 and
 and
-.I getnetbyaddr
+.Fn getnetbyaddr
+functions
 each return a pointer to an object with the
 following structure
 containing the broken-out
 fields of a line in the network data base,
 each return a pointer to an object with the
 following structure
 containing the broken-out
 fields of a line in the network data base,
-.IR /etc/networks .
-.RS
-.PP
-.nf
+.Pa /etc/networks .
+.Bd -literal -offset indent
 struct netent {
        char            *n_name;        /* official name of net */
        char            **n_aliases;    /* alias list */
        int             n_addrtype;     /* net number type */
        unsigned long   n_net;          /* net number */
 };
 struct netent {
        char            *n_name;        /* official name of net */
        char            **n_aliases;    /* alias list */
        int             n_addrtype;     /* net number type */
        unsigned long   n_net;          /* net number */
 };
-.ft R
-.ad
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The members of this structure are:
 The members of this structure are:
-.TP \w'n_addrtype'u+2n
-n_name
+.Bl -tag -width n_addrtype
+.It Fa n_name
 The official name of the network.
 The official name of the network.
-.TP \w'n_addrtype'u+2n
-n_aliases
+.It Fa n_aliases
 A zero terminated list of alternate names for the network.
 A zero terminated list of alternate names for the network.
-.TP \w'n_addrtype'u+2n
-n_addrtype
+.It Fa n_addrtype
 The type of the network number returned; currently only AF_INET.
 The type of the network number returned; currently only AF_INET.
-.TP \w'n_addrtype'u+2n
-n_net
+.It Fa n_net
 The network number.  Network numbers are returned in machine byte
 order.
 The network number.  Network numbers are returned in machine byte
 order.
-.PP
-.I Getnetent
+.El
+.Pp
+The
+.Fn getnetent
+function
 reads the next line of the file, opening the file if necessary.
 reads the next line of the file, opening the file if necessary.
-.PP
-.I Setnetent
+.Pp
+The
+.Fn setnetent
+function
 opens and rewinds the file.  If the
 opens and rewinds the file.  If the
-.I stayopen
+.Fa stayopen
 flag is non-zero,
 the net data base will not be closed after each call to 
 flag is non-zero,
 the net data base will not be closed after each call to 
-.I getnetbyname
+.Fn getnetbyname
 or
 or
-.IR getnetbyaddr .
-.PP
-.I Endnetent
+.Fn getnetbyaddr .
+.Pp
+The
+.Fn endnetent
+function
 closes the file.
 closes the file.
-.PP
-.I Getnetbyname
+.Pp
+The
+.Fn getnetbyname
+function
 and
 and
-.I getnetbyaddr
+.Fn getnetbyaddr
 sequentially search from the beginning
 of the file until a matching
 net name or
 net address and type is found,
 sequentially search from the beginning
 of the file until a matching
 net name or
 net address and type is found,
-or until EOF is encountered.
+or until
+.Dv EOF
+is encountered.
 Network numbers are supplied in host order.
 Network numbers are supplied in host order.
-.SH FILES
-/etc/networks
-.SH "SEE ALSO"
-networks(5)
-.SH DIAGNOSTICS
+.Sh FILES
+.Bl -tag -width /etc/networks -compact
+.It Pa /etc/networks
+.El
+.Sh DIAGNOSTICS
 Null pointer
 Null pointer
-(0) returned on EOF or error.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.  Only Internet network
+(0) returned on
+.Dv EOF
+or error.
+.Sh SEE ALSO
+.Xr networks 5
+.Sh HISTORY
+The
+.Fn getnetent ,
+.Fn getnetbyaddr ,
+.Fn getnetbyname ,
+.Fn setnetent ,
+and
+.Fn endnetent
+functions appeared in 
+.Bx 4.2 .
+.Sh BUGS
+The data space used by
+these functions is static; if future use requires the data, it should be
+copied before any subsequent calls to these functions overwrite it.
+Only Internet network
 numbers are currently understood.
 Expecting network numbers to fit
 in no more than 32 bits is probably
 numbers are currently understood.
 Expecting network numbers to fit
 in no more than 32 bits is probably
index af7c1d4..fcd38fa 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getprotoent.3       6.5 (Berkeley) %G%
+.\"     @(#)getprotoent.3      6.6 (Berkeley) %G%
 .\"
 .\"
-.TH GETPROTOENT 3 ""
-.UC 5
-.SH NAME
-getprotoent, getprotobynumber, getprotobyname, setprotoent,
-endprotoent \- get protocol entry
-.SH SYNOPSIS
-.nf
-.ft B
-.B #include <netdb.h>
-.PP
-.ft B
-struct protoent *getprotoent()
-.PP
-.ft B
-struct protoent *getprotobyname(name)
-char *name;
-.PP
-.ft B
-struct protoent *getprotobynumber(proto)
-int proto;
-.PP
-.ft B
-setprotoent(stayopen)
-int stayopen
-.PP
-.ft B
-endprotoent()
-.fi
-.SH DESCRIPTION
-.IR Getprotoent ,
-.IR getprotobyname ,
+.Dd 
+.Dt GETPROTOENT 3
+.Os BSD 4.2
+.Sh NAME
+.Nm getprotoent ,
+.Nm getprotobynumber ,
+.Nm getprotobyname ,
+.Nm setprotoent ,
+.Nm endprotoent
+.Nd get protocol entry
+.Sh SYNOPSIS
+.Fd #include <netdb.h>
+.Ft struct protoent *
+.Fn getprotoent 
+.Ft struct protoent *
+.Fn getprotobyname "char *name"
+.Ft struct protoent *
+.Fn getprotobynumber "int proto"
+.Fn setprotoent "int stayopen"
+.Fn endprotoent 
+.Sh DESCRIPTION
+The
+.Fn getprotoent ,
+.Fn getprotobyname ,
 and
 and
-.I getprotobynumber
+.Fn getprotobynumber
+functions
 each return a pointer to an object with the
 following structure
 containing the broken-out
 fields of a line in the network protocol data base,
 each return a pointer to an object with the
 following structure
 containing the broken-out
 fields of a line in the network protocol data base,
-.IR /etc/protocols .
-.RS
-.PP
-.nf
+.Pa /etc/protocols .
+.Bd -literal -offset indent
+.Pp
 struct protoent {
        char    *p_name;        /* official name of protocol */
        char    **p_aliases;    /* alias list */
        int     p_proto;        /* protocol number */
 };
 struct protoent {
        char    *p_name;        /* official name of protocol */
        char    **p_aliases;    /* alias list */
        int     p_proto;        /* protocol number */
 };
-.ft R
-.ad
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The members of this structure are:
 The members of this structure are:
-.TP \w'p_aliases'u+2n
-p_name
+.Bl -tag -width p_aliases
+.It Fa p_name
 The official name of the protocol.
 The official name of the protocol.
-.TP \w'p_aliases'u+2n
-p_aliases
+.It Fa p_aliases
 A zero terminated list of alternate names for the protocol.
 A zero terminated list of alternate names for the protocol.
-.TP \w'p_aliases'u+2n
-p_proto
+.It Fa p_proto
 The protocol number.
 The protocol number.
-.PP
-.I Getprotoent
+.El
+.Pp
+The
+.Fn getprotoent
+function
 reads the next line of the file, opening the file if necessary.
 reads the next line of the file, opening the file if necessary.
-.PP
-.I Setprotoent
+.Pp
+The
+.Fn setprotoent
+function
 opens and rewinds the file.  If the
 opens and rewinds the file.  If the
-.I stayopen
+.Fa stayopen
 flag is non-zero,
 the net data base will not be closed after each call to 
 flag is non-zero,
 the net data base will not be closed after each call to 
-.I getprotobyname
+.Fn getprotobyname
 or
 or
-.IR getprotobynumber .
-.PP
-.I Endprotoent
+.Fn getprotobynumber .
+.Pp
+The
+.Fn endprotoent
+function
 closes the file.
 closes the file.
-.PP
-.I Getprotobyname
+.Pp
+The
+.Fn getprotobyname
+function
 and
 and
-.I getprotobynumber
+.Fn getprotobynumber
 sequentially search from the beginning
 of the file until a matching
 protocol name or
 protocol number is found,
 sequentially search from the beginning
 of the file until a matching
 protocol name or
 protocol number is found,
-or until EOF is encountered.
-.SH FILES
-/etc/protocols
-.SH "SEE ALSO"
-protocols(5)
-.SH DIAGNOSTICS
+or until
+.Dv EOF
+is encountered.
+.Sh RETURN VALUES
 Null pointer
 Null pointer
-(0) returned on EOF or error.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.  Only the Internet
+(0) returned on
+.Dv EOF
+or error.
+.Sh FILES
+.Bl -tag -width /etc/protocols -compact
+.It Pa /etc/protocols
+.El
+.Sh SEE ALSO
+.Xr protocols 5
+.Sh HISTORY
+The
+.Fn getprotoent ,
+.Fn getprotobynumber ,
+.Fn getprotobyname ,
+.Fn setprotoent ,
+and
+.Fn endprotoent
+functions appeared in 
+.Bx 4.2 .
+.Sh BUGS
+These functions use a static data space;
+if the data is needed for future use, it should be
+copied before any subsequent calls overwrite it.
+Only the Internet
 protocols are currently understood.
 protocols are currently understood.
index c6ca8f7..a9b6a6f 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getservent.3        6.5 (Berkeley) %G%
+.\"     @(#)getservent.3       6.6 (Berkeley) %G%
 .\"
 .\"
-.TH GETSERVENT 3 ""
-.UC 5
-.SH NAME
-getservent, getservbyport, getservbyname, setservent,
-endservent \- get service entry
-.SH SYNOPSIS
-.nf
-.ft B
-#include <netdb.h>
-.PP
-.ft B
-struct servent *getservent()
-.PP
-.ft B
-struct servent *getservbyname(name, proto)
-char *name, *proto;
-.PP
-.ft B
-struct servent *getservbyport(port, proto)
-int port; char *proto;
-.PP
-.ft B
-setservent(stayopen)
-int stayopen
-.PP
-.ft B
-endservent()
-.fi
-.SH DESCRIPTION
-.IR Getservent ,
-.IR getservbyname ,
+.Dd 
+.Dt GETSERVENT 3
+.Os BSD 4.2
+.Sh NAME
+.Nm getservent ,
+.Nm getservbyport ,
+.Nm getservbyname ,
+.Nm setservent ,
+.Nm endservent
+.Nd get service entry
+.Sh SYNOPSIS
+.Fd #include <netdb.h>
+.Ft struct servent *
+.Fn getservent 
+.Ft struct servent *
+.Fn getservbyname "char *name" "char *proto"
+.Ft struct servent *
+.Fn getservbyport "int port" proto
+.Ft void
+.Fn setservent "int stayopen"
+.Ft void
+.Fn endservent void
+.Sh DESCRIPTION
+The
+.Fn getservent ,
+.Fn getservbyname ,
 and
 and
-.I getservbyport
+.Fn getservbyport
+functions
 each return a pointer to an object with the
 following structure
 containing the broken-out
 fields of a line in the network services data base,
 each return a pointer to an object with the
 following structure
 containing the broken-out
 fields of a line in the network services data base,
-.IR /etc/services .
-.RS
-.PP
-.nf
+.Pa /etc/services .
+.Bd -literal -offset indent
 struct servent {
        char    *s_name;        /* official name of service */
        char    **s_aliases;    /* alias list */
        int     s_port;         /* port service resides at */
        char    *s_proto;       /* protocol to use */
 };
 struct servent {
        char    *s_name;        /* official name of service */
        char    **s_aliases;    /* alias list */
        int     s_port;         /* port service resides at */
        char    *s_proto;       /* protocol to use */
 };
-.ft R
-.ad
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The members of this structure are:
 The members of this structure are:
-.TP \w's_aliases'u+2n
-s_name
+.Bl -tag -width s_aliases
+.It Fa s_name
 The official name of the service.
 The official name of the service.
-.TP \w's_aliases'u+2n
-s_aliases
+.It Fa s_aliases
 A zero terminated list of alternate names for the service.
 A zero terminated list of alternate names for the service.
-.TP \w's_aliases'u+2n
-s_port
+.It Fa s_port
 The port number at which the service resides.
 Port numbers are returned in network byte order.
 The port number at which the service resides.
 Port numbers are returned in network byte order.
-.TP \w's_aliases'u+2n
-s_proto
+.It Fa s_proto
 The name of the protocol to use when contacting the
 service.
 The name of the protocol to use when contacting the
 service.
-.PP
-.I Getservent
+.El
+.Pp
+The
+.Fn getservent
+function
 reads the next line of the file, opening the file if necessary.
 reads the next line of the file, opening the file if necessary.
-.PP
-.I Setservent
+.Pp
+The
+.Fn setservent
+function
 opens and rewinds the file.  If the
 opens and rewinds the file.  If the
-.I stayopen
+.Fa stayopen
 flag is non-zero,
 the net data base will not be closed after each call to 
 flag is non-zero,
 the net data base will not be closed after each call to 
-.I getservbyname
-or .IR getservbyport .
-.PP
-.I Endservent
+.Fn getservbyname
+or
+.Fn getservbyport .
+.Pp
+The
+.Fn endservent
+function
 closes the file.
 closes the file.
-.PP
-.I Getservbyname
+.Pp
+The
+.Fn getservbyname
 and
 and
-.I getservbyport
+.Fn getservbyport
+functions
 sequentially search from the beginning
 of the file until a matching
 protocol name or
 port number is found,
 sequentially search from the beginning
 of the file until a matching
 protocol name or
 port number is found,
-or until EOF is encountered.
-If a protocol name is also supplied (non-NULL),
+or until
+.Dv EOF
+is encountered.
+If a protocol name is also supplied (non-
+.Dv NULL ) , 
 searches must also match the protocol.
 searches must also match the protocol.
-.SH FILES
-/etc/services
-.SH "SEE ALSO"
-getprotoent(3), services(5)
-.SH DIAGNOSTICS
+.Sh FILES
+.Bl -tag -width /etc/services -compact
+.It Pa /etc/services
+.El
+.Sh DIAGNOSTICS
 Null pointer
 Null pointer
-(0) returned on EOF or error.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.  Expecting port
-numbers to fit in a 32 bit
+(0) returned on
+.Dv EOF
+or error.
+.Sh SEE ALSO
+.Xr getprotoent 3 ,
+.Xr services 5
+.Sh HISTORY
+The
+.Fn getservent ,
+.Fn getservbyport ,
+.Fn getservbyname ,
+.Fn setservent ,
+and
+.Fn endservent
+functions appeared in 
+.Bx 4.2 .
+.Sh BUGS
+These functions use static data storage;
+if the data is needed for future use, it should be
+copied before any subsequent calls overwrite it.
+Expecting port numbers to fit in a 32 bit
 quantity is probably naive.
 quantity is probably naive.
index e1f4f78..d22e883 100644 (file)
-.\" Copyright (c) 1983, 1990 The Regents of the University of California.
+.\" Copyright (c) 1983, 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)inet.3      6.9 (Berkeley) %G%
+.\"     @(#)inet.3     6.10 (Berkeley) %G%
 .\"
 .\"
-.TH INET 3 ""
-.UC 5
-.SH NAME
-inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr, inet_lnaof, inet_netof \- Internet address manipulation routines
-.SH SYNOPSIS
-.nf
-.B "#include <sys/socket.h>
-.B "#include <netinet/in.h>
-.B "#include <arpa/inet.h>
-.PP
-.B "int inet_aton(cp, pin)
-.B "char *cp;
-.B "struct in_addr *pin;
-.PP
-.B "unsigned long inet_addr(cp)
-.B "char *cp;
-.PP
-.B "unsigned long inet_network(cp)
-.B "char *cp;
-.PP
-.B "char *inet_ntoa(in)
-.B "struct in_addr in;
-.PP
-.B "struct in_addr inet_makeaddr(net, lna)
-.B "int net, lna;
-.PP
-.B "unsigned long inet_lnaof(in)
-.B "struct in_addr in;
-.PP
-.B "unsigned long inet_netof(in)
-.B "struct in_addr in;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt INET 3
+.Os BSD 4.2
+.Sh NAME
+.Nm inet_aton ,
+.Nm inet_addr ,
+.Nm inet_network ,
+.Nm inet_ntoa ,
+.Nm inet_makeaddr ,
+.Nm inet_lnaof ,
+.Nm inet_netof
+.Nd Internet address manipulation routines
+.Sh SYNOPSIS
+.Fd #include <sys/socket.h>
+.Fd #include <netinet/in.h>
+.Fd #include <arpa/inet.h>
+.Ft int 
+.Fn inet_aton "char *cp" "struct in_addr *pin"
+.Ft unsigned long 
+.Fn inet_addr "char *cp"
+.Ft unsigned long 
+.Fn inet_network "char *cp"
+.Ft char *
+.Fn inet_ntoa "struct in_addr in"
+.Ft struct in_addr 
+.Fn inet_makeaddr "int net" "int lna"
+.Ft unsigned long 
+.Fn inet_lnaof "struct in_addr in"
+.Ft unsigned long 
+.Fn inet_netof "struct in_addr in"
+.Sh DESCRIPTION
 The routines
 The routines
-.IR inet_aton ,
-.I inet_addr
+.Fn inet_aton ,
+.Fn inet_addr
 and
 and
-.I inet_network
+.Fn inet_network
 interpret character strings representing
 interpret character strings representing
-numbers expressed in the Internet standard \*(lq.\*(rq
+numbers expressed in the Internet standard
+.Ql \&.
 notation.
 The
 notation.
 The
-.I inet_aton
+.Fn inet_aton
 routine interprets the specified character string as an Internet address,
 placing the address into the structure provided.
 It returns 1 if the string was successfully interpreted,
 or 0 if the string is invalid.
 The
 routine interprets the specified character string as an Internet address,
 placing the address into the structure provided.
 It returns 1 if the string was successfully interpreted,
 or 0 if the string is invalid.
 The
-.I inet_addr
+.Fn inet_addr
 and
 and
-.I inet_network
+.Fn inet_network
 functions return numbers suitable for use
 as Internet addresses and Internet network
 numbers, respectively.
 The routine
 functions return numbers suitable for use
 as Internet addresses and Internet network
 numbers, respectively.
 The routine
-.I inet_ntoa
-takes an Internet address and returns an ASCII
-string representing the address in \*(lq.\*(rq
+.Fn inet_ntoa
+takes an Internet address and returns an
+.Tn ASCII
+string representing the address in
+.Ql \&.
 notation.  The routine
 notation.  The routine
-.I inet_makeaddr
+.Fn inet_makeaddr
 takes an Internet network number and a local
 network address and constructs an Internet address
 from it.  The routines
 takes an Internet network number and a local
 network address and constructs an Internet address
 from it.  The routines
-.I inet_netof
+.Fn inet_netof
 and
 and
-.I inet_lnaof
+.Fn inet_lnaof
 break apart Internet host addresses, returning
 the network number and local network address part,
 respectively.
 break apart Internet host addresses, returning
 the network number and local network address part,
 respectively.
-.PP
+.Pp
 All Internet addresses are returned in network
 order (bytes ordered from left to right).
 All network numbers and local address parts are
 returned as machine format integer values.
 All Internet addresses are returned in network
 order (bytes ordered from left to right).
 All network numbers and local address parts are
 returned as machine format integer values.
-.SH "INTERNET ADDRESSES"
-Values specified using the \*(lq.\*(rq notation take one
+.Sh INTERNET ADDRESSES
+Values specified using the
+.Ql \&.
+notation take one
 of the following forms:
 of the following forms:
-.RS
-.nf
+.Bd -literal -offset indent
 a.b.c.d
 a.b.c
 a.b
 a
 a.b.c.d
 a.b.c
 a.b
 a
-.RE
-.fi
+.Ed
+.Pp
 When four parts are specified, each is interpreted
 as a byte of data and assigned, from left to right,
 to the four bytes of an Internet address.  Note
 that when an Internet address is viewed as a 32-bit
 When four parts are specified, each is interpreted
 as a byte of data and assigned, from left to right,
 to the four bytes of an Internet address.  Note
 that when an Internet address is viewed as a 32-bit
-integer quantity on the VAX the bytes referred to
-above appear as \*(lqd.c.b.a\*(rq.  That is, VAX bytes are
+integer quantity on the
+.Tn VAX
+the bytes referred to
+above appear as
+.Dq Li d.c.b.a .
+That is,
+.Tn VAX
+bytes are
 ordered from right to left.
 ordered from right to left.
-.PP
+.Pp
 When a three part address is specified, the last
 part is interpreted as a 16-bit quantity and placed
 in the right-most two bytes of the network address.
 This makes the three part address format convenient
 for specifying Class B network addresses as
 When a three part address is specified, the last
 part is interpreted as a 16-bit quantity and placed
 in the right-most two bytes of the network address.
 This makes the three part address format convenient
 for specifying Class B network addresses as
-\*(lq128.net.host\*(rq.
-.PP
+.Dq Li 128.net.host .
+.Pp
 When a two part address is supplied, the last part
 is interpreted as a 24-bit quantity and placed in
 the right most three bytes of the network address.
 This makes the two part address format convenient
 for specifying Class A network addresses as
 When a two part address is supplied, the last part
 is interpreted as a 24-bit quantity and placed in
 the right most three bytes of the network address.
 This makes the two part address format convenient
 for specifying Class A network addresses as
-\*(lqnet.host\*(rq.
-.PP
+.Dq Li net.host .
+.Pp
 When only one part is given, the value is stored
 directly in the network address without any byte
 rearrangement.
 When only one part is given, the value is stored
 directly in the network address without any byte
 rearrangement.
-.PP
-All numbers supplied as \*(lqparts\*(rq in a \*(lq.\*(rq notation
+.Pp
+All numbers supplied as
+.Dq parts
+in a
+.Ql  \&.
+notation
 may be decimal, octal, or hexadecimal, as specified
 in the C language (i.e., a leading 0x or 0X implies
 hexadecimal; otherwise, a leading 0 implies octal;
 otherwise, the number is interpreted as decimal).
 may be decimal, octal, or hexadecimal, as specified
 in the C language (i.e., a leading 0x or 0X implies
 hexadecimal; otherwise, a leading 0 implies octal;
 otherwise, the number is interpreted as decimal).
-.SH "SEE ALSO"
-gethostbyname(3), getnetent(3), hosts(5), networks(5),
-.SH DIAGNOSTICS
-The constant \fBINADDR_NONE\fP is returned by
-.I inet_addr
+.Sh DIAGNOSTICS
+The constant
+.Dv INADDR_NONE
+is returned by
+.Fn inet_addr
 and
 and
-.I inet_network
+.Fn inet_network
 for malformed requests.
 for malformed requests.
-.SH BUGS
-The value INADDR_NONE (0xffffffff) is a valid broadcast address, but
-.I inet_addr
+.Sh SEE ALSO
+.Xr gethostbyname 3 ,
+.Xr getnetent 3 ,
+.Xr hosts 5 ,
+.Xr networks 5 ,
+.Sh HISTORY
+These
+functions appeared in 
+.Bx 4.2 .
+.Sh BUGS
+The value
+.Dv INADDR_NONE
+(0xffffffff) is a valid broadcast address, but
+.Fn inet_addr
 cannot return that value without indicating failure.
 The newer
 cannot return that value without indicating failure.
 The newer
-.I inet_aton
+.Fn inet_aton
 function does not share this problem.
 The problem of host byte ordering versus network byte ordering is
 confusing.
 The string returned by
 function does not share this problem.
 The problem of host byte ordering versus network byte ordering is
 confusing.
 The string returned by
-.I inet_ntoa
+.Fn inet_ntoa
 resides in a static memory area.
 resides in a static memory area.
-.br
-Inet_addr should return a struct in_addr.
+.Pp
+Inet_addr should return a
+.Fa struct in_addr .
index 83fb40d..a68d77a 100644 (file)
@@ -1,52 +1,67 @@
-.\" Copyright (c) 1986 The Regents of the University of California.
+.\" Copyright (c) 1986, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ns.3        6.4 (Berkeley) %G%
+.\"     @(#)ns.3       6.5 (Berkeley) %G%
 .\"
 .\"
-.TH NS 3 ""
-.UC 6
-.SH NAME
-ns_addr, ns_ntoa \- Xerox NS(tm)  address conversion routines
-.SH SYNOPSIS
-.nf
-.B "#include <sys/types.h>
-.B "#include <netns/ns.h>
-.PP
-.B "struct ns_addr ns_addr(cp)
-.B "char *cp;
-.PP
-.B "char *ns_ntoa(ns)
-.B "struct ns_addr ns;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt NS 3
+.Os BSD 4.3
+.Sh NAME
+.Nm ns_addr ,
+.Nm ns_ntoa
+.Nd Xerox
+.Tn NS Ns (tm)
+address conversion routines
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <netns/ns.h>
+.Ft struct ns_addr 
+.Fn ns_addr "char *cp"
+.Ft char *
+.Fn ns_ntoa "struct ns_addr ns"
+.Sh DESCRIPTION
 The routine
 The routine
-.I ns_addr
+.Fn ns_addr
 interprets character strings representing
 interprets character strings representing
-XNS addresses, returning binary information suitable
+.Tn XNS
+addresses, returning binary information suitable
 for use in system calls.
 for use in system calls.
-.I ns_ntoa
-takes XNS addresses and returns ASCII
+The routine
+.Fn ns_ntoa
+takes
+.Tn XNS
+addresses and returns
+.Tn ASCII
 strings representing the address in a
 notation in common use in the Xerox Development Environment:
 strings representing the address in a
 notation in common use in the Xerox Development Environment:
-.nf
-       <network number>.<host number>.<port number>
-.fi
+.Bd -filled -offset indent
+<network number>.<host number>.<port number>
+.Ed
+.Pp
 Trailing zero fields are suppressed, and each number is printed in hexadecimal,
 in a format suitable for input to 
 Trailing zero fields are suppressed, and each number is printed in hexadecimal,
 in a format suitable for input to 
-.IR ns_addr .
+.Fn ns_addr .
 Any fields lacking super-decimal digits will have a
 Any fields lacking super-decimal digits will have a
-trailing ``H'' appended.
-.PP
-Unfortunately, no universal standard exists for representing XNS addresses.
+trailing
+.Ql H
+appended.
+.Pp
+Unfortunately, no universal standard exists for representing
+.Tn XNS
+addresses.
 An effort has been made to insure that
 An effort has been made to insure that
-.I ns_addr
+.Fn ns_addr
 be compatible with most formats in common use.
 It will first separate an address into 1 to 3 fields using a single delimiter
 chosen from
 be compatible with most formats in common use.
 It will first separate an address into 1 to 3 fields using a single delimiter
 chosen from
-period (``.''),
-colon (``:'') or pound-sign (``#'').
+period
+.Ql \&. ,
+colon
+.Ql \&:
+or pound-sign
+.Ql \&# .
 Each field is then examined for byte separators (colon or period).
 If there are byte separators, each subfield separated is taken to be
 a small hexadecimal number, and the entirety is taken as a network-byte-ordered
 Each field is then examined for byte separators (colon or period).
 If there are byte separators, each subfield separated is taken to be
 a small hexadecimal number, and the entirety is taken as a network-byte-ordered
@@ -56,20 +71,34 @@ the field is assumed to be a number in decimal notation
 with hyphens separating the millenia.
 Next, the field is assumed to be a number:
 It is interpreted
 with hyphens separating the millenia.
 Next, the field is assumed to be a number:
 It is interpreted
-as hexadecimal if there is a leading ``0x'' (as in C),
-a trailing ``H'' (as in Mesa), or there are any super-decimal digits present.
-It is interpreted as octal is there is a leading ``0''
+as hexadecimal if there is a leading
+.Ql 0x
+(as in C),
+a trailing
+.Ql H
+(as in Mesa), or there are any super-decimal digits present.
+It is interpreted as octal is there is a leading
+.Ql 0
 and there are no super-octal digits.
 Otherwise, it is converted as a decimal number.
 and there are no super-octal digits.
 Otherwise, it is converted as a decimal number.
-.SH "SEE ALSO"
-hosts(5), networks(5),
-.SH DIAGNOSTICS
-None (see BUGS).
-.SH BUGS
+.Sh RETURN VALUES
+None. (See
+.Sx BUGS . )
+.Sh SEE ALSO
+.Xr hosts 5 ,
+.Xr networks 5 ,
+.Sh HISTORY
+The
+.Fn ns_addr
+and
+.Fn ns_toa
+functions appeared in 
+.Bx 4.3 .
+.Sh BUGS
 The string returned by
 The string returned by
-.I ns_ntoa
+.Fn ns_ntoa
 resides in a static memory area.
 resides in a static memory area.
-.br
-.I ns_addr
+The function
+.Fn ns_addr
 should diagnose improperly formed input, and there should be an unambiguous
 way to recognize this.
 should diagnose improperly formed input, and there should be an unambiguous
 way to recognize this.
index d5c24a5..4494c73 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)rcmd.3      6.10 (Berkeley) %G%
+.\"     @(#)rcmd.3     6.11 (Berkeley) %G%
 .\"
 .\"
-.TH RCMD 3 ""
-.UC 5
-.SH NAME
-rcmd, rresvport, ruserok \- routines for returning a stream to a remote command
-.SH SYNOPSIS
-.nf
-.PP
-.B "rem = rcmd(ahost, inport, locuser, remuser, cmd, fd2p);"
-.B char **ahost;
-.B int inport;
-.B "char *locuser, *remuser, *cmd;"
-.B int *fd2p;
-.PP
-.B s = rresvport(port);
-.B int *port;
-.PP
-.B "ruserok(rhost, superuser, ruser, luser);"
-.B char *rhost;
-.B int superuser;
-.B char *ruser, *luser;
-.fi
-.SH DESCRIPTION
-.I Rcmd
-is a routine used by the super-user to execute a command on
+.Dd 
+.Dt RCMD 3
+.Os BSD 4.2
+.Sh NAME
+.Nm rcmd ,
+.Nm rresvport ,
+.Nm ruserok
+.Nd routines for returning a stream to a remote command
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn rcmd "char **ahost" "int inport" "const char *locuser" "const char *remuser" "const char *cmd" "int *fd2p"
+.Ft int
+.Fn rresvport "int *port"
+.Ft int
+.Fn ruserok "const char *rhost" "int superuser" "const char *ruser" "const char *luser"
+.Sh DESCRIPTION
+The
+.Fn rcmd
+function
+is used by the super-user to execute a command on
 a remote machine using an authentication scheme based
 on reserved port numbers.
 a remote machine using an authentication scheme based
 on reserved port numbers.
-.I Rresvport
-is a routine which returns a descriptor to a socket
+The
+.Fn rresvport
+function
+returns a descriptor to a socket
 with an address in the privileged port space.
 with an address in the privileged port space.
-.I Ruserok
-is a routine used by servers
+The
+.Fn ruserok
+function
+is used by servers
 to authenticate clients requesting service with
 to authenticate clients requesting service with
-.IR rcmd .
+.Fn rcmd .
 All three functions are present in the same file and are used
 by the
 All three functions are present in the same file and are used
 by the
-.IR rshd (8)
+.Xr rshd 8
 server (among others).
 server (among others).
-.PP
-.I Rcmd
+.Pp
+The
+.Fn rcmd
+function
 looks up the host
 looks up the host
-.I *ahost
+.Fa *ahost
 using
 using
-.IR gethostbyname (3),
+.Xr gethostbyname 3 ,
 returning \-1 if the host does not exist.
 Otherwise
 returning \-1 if the host does not exist.
 Otherwise
-.I *ahost
+.Fa *ahost
 is set to the standard name of the host
 and a connection is established to a server
 residing at the well-known Internet port
 is set to the standard name of the host
 and a connection is established to a server
 residing at the well-known Internet port
-.IR inport .
-.PP
+.Fa inport .
+.Pp
 If the connection succeeds,
 If the connection succeeds,
-a socket in the Internet domain of type SOCK_STREAM
+a socket in the Internet domain of type
+.Dv SOCK_STREAM
 is returned to the caller, and given to the remote
 command as 
 is returned to the caller, and given to the remote
 command as 
-.B stdin
+.Em stdin
 and
 and
-.BR stdout .
+.Em stdout .
 If
 If
-.I fd2p
+.Fa fd2p
 is non-zero, then an auxiliary channel to a control
 process will be set up, and a descriptor for it will be placed
 in
 is non-zero, then an auxiliary channel to a control
 process will be set up, and a descriptor for it will be placed
 in
-.IR *fd2p .
+.Fa *fd2p .
 The control process will return diagnostic
 output from the command (unit 2) on this channel, and will also
 The control process will return diagnostic
 output from the command (unit 2) on this channel, and will also
-accept bytes on this channel as being UNIX signal numbers, to be
+accept bytes on this channel as being
+.Tn UNIX
+signal numbers, to be
 forwarded to the process group of the command.
 If
 forwarded to the process group of the command.
 If
-.I fd2p
+.Fa fd2p
 is 0, then the 
 is 0, then the 
-.B stderr
+.Em stderr
 (unit 2 of the remote
 command) will be made the same as the 
 (unit 2 of the remote
 command) will be made the same as the 
-.B stdout
+.Em stdout
 and no
 provision is made for sending arbitrary signals to the remote process,
 although you may be able to get its attention by using out-of-band data.
 and no
 provision is made for sending arbitrary signals to the remote process,
 although you may be able to get its attention by using out-of-band data.
-.PP
+.Pp
 The protocol is described in detail in
 The protocol is described in detail in
-.IR rshd (8).
-.PP
+.Xr rshd 8 .
+.Pp
 The
 The
-.I rresvport
-routine is used to obtain a socket with a privileged
+.Fn rresvport
+function is used to obtain a socket with a privileged
 address bound to it.  This socket is suitable for use
 by 
 address bound to it.  This socket is suitable for use
 by 
-.I rcmd
-and several other routines.  Privileged Internet ports are those
+.Fn rcmd
+and several other functions.  Privileged Internet ports are those
 in the range 0 to 1023.  Only the super-user
 is allowed to bind an address of this sort to a socket.
 in the range 0 to 1023.  Only the super-user
 is allowed to bind an address of this sort to a socket.
-.PP
-.I Ruserok
+.Pp
+The
+.Fn ruserok
+argument
 takes a remote host's name, as returned by the
 takes a remote host's name, as returned by the
-.IR gethostbyaddr (3)
+.Xr gethostbyaddr 3
 routine, two user names and a flag indicating whether
 the local user's name is that of the super-user.  Then,
 if the user is
 routine, two user names and a flag indicating whether
 the local user's name is that of the super-user.  Then,
 if the user is
-.B NOT
+.Em NOT
 the super-user, it checks the files
 the super-user, it checks the files
-.IR /etc/hosts.equiv .
+.Pa /etc/hosts.equiv .
 If that lookup is not done, or is unsuccessful, the
 If that lookup is not done, or is unsuccessful, the
-.I .rhosts
+.Pa .rhosts
 in the local user's home directory is checked to see if the request for
 service is allowed.  If this file is owned by anyone other than the
 user or the super-user, or if it is writeable by anyone other than the
 owner, the check automatically fails.  A 0 is returned if the machine
 in the local user's home directory is checked to see if the request for
 service is allowed.  If this file is owned by anyone other than the
 user or the super-user, or if it is writeable by anyone other than the
 owner, the check automatically fails.  A 0 is returned if the machine
-name is listed in the ``hosts.equiv'' file, or the host and remote
-user name are found in the ``.rhosts'' file; otherwise
-.I ruserok
+name is listed in the
+.Dq Pa hosts.equiv
+file, or the host and remote
+user name are found in the
+.Dq Pa .rhosts
+file; otherwise
+.Fn ruserok
 returns \-1.
 returns \-1.
-If the local domain (as obtained from \fIgethostname\fP\|(2))
+If the local domain (as obtained from
+.Xr gethostname 2 )
 is the same as the remote domain, only the machine name need be specified.
 is the same as the remote domain, only the machine name need be specified.
-.SH SEE ALSO
-rlogin(1), rsh(1), intro(2), rexec(3), rexecd(8), rlogind(8), rshd(8)
-.SH DIAGNOSTICS
-.I Rcmd
+.Sh DIAGNOSTICS
+The
+.Fn rcmd
+function
 returns a valid socket descriptor on success.
 returns a valid socket descriptor on success.
-It returns -1 on error and prints a diagnostic message on the standard error.
-.PP
-.I Rresvport
+It returns \-1 on error and prints a diagnostic message on the standard error.
+.Pp
+The
+.Fn rresvport
+function
 returns a valid, bound socket descriptor on success.
 returns a valid, bound socket descriptor on success.
-It returns -1 on error with the global value
-.I errno
+It returns \-1 on error with the global value
+.Va errno
 set according to the reason for failure.
 set according to the reason for failure.
-The error code EAGAIN is overloaded to mean ``All network ports in use.''
+The error code
+.Dv EAGAIN
+is overloaded to mean ``All network ports in use.''
+.Sh SEE ALSO
+.Xr rlogin 1 ,
+.Xr rsh 1 ,
+.Xr intro 2 ,
+.Xr rexec 3 ,
+.Xr rexecd 8 ,
+.Xr rlogind 8 ,
+.Xr rshd 8
+.Sh HISTORY
+These
+functions appeared in 
+.Bx 4.2 .
index 87d5ac9..000ddda 100644 (file)
@@ -1,57 +1,65 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fclose.3    6.5 (Berkeley) %G%
+.\"     @(#)fclose.3   6.6 (Berkeley) %G%
 .\"
 .\"
-.TH FCLOSE 3 ""
-.UC 7
-.SH NAME
-fclose \- close a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fclose(FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fclose
+.Dd 
+.Dt FCLOSE 3
+.Os
+.Sh NAME
+.Nm fclose
+.Nd close a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fclose "FILE *stream"
+.Sh DESCRIPTION
+The
+.Fn fclose
+function
 dissociates the named
 dissociates the named
-.I stream
+.Fa stream
 from its underlying file or set of functions.
 If the stream was being used for output, any buffered data is written
 first, using
 from its underlying file or set of functions.
 If the stream was being used for output, any buffered data is written
 first, using
-.IR fflush (3).
-.SH "RETURN VALUE"
+.Xr fflush 3 .
+.Sh RETURN VALUES
 Upon successful completion 0 is returned.
 Otherwise,
 Upon successful completion 0 is returned.
 Otherwise,
-.B EOF
+.Dv EOF
 is returned and the global variable
 is returned and the global variable
-.I errno
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-In either case no further access to the stream is possible. 
-.SH ERRORS
-.TP 15
-[EBADF]
-.I Stream
+In either case no further access to the stream is possible.
+.Sh ERRORS
+.Bl -tag -width [EBADF]
+.It Bq Er EBADF
+The argument
+.Fa stream
 is not an open stream.
 is not an open stream.
-.PP
-.I Fclose
-may also fail and set 
-.I errno
+.El
+.Pp
+The
+.Fn fclose
+function
+may also fail and set
+.Va errno
 for any of the errors specified for the routines
 for any of the errors specified for the routines
-.IR close (2)
-or 
-.IR fflush (3).
-.SH STANDARDS
-.I Fclose
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH "SEE ALSO"
-close(2), fflush(3), fopen(3), setbuf(3)
+.Xr close 2
+or
+.Xr fflush 3 .
+.Sh SEE ALSO
+.Xr close 2 ,
+.Xr fflush 3 ,
+.Xr fopen 3 ,
+.Xr setbuf 3
+.Sh STANDARDS
+The
+.Fn fclose
+function
+conforms to
+.St -ansiC .
index 5151567..d90cfbd 100644 (file)
@@ -1,69 +1,72 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ferror.3    6.6 (Berkeley) %G%
+.\"     @(#)ferror.3   6.7 (Berkeley) %G%
 .\"
 .\"
-.TH FERROR 3 ""
-.UC 7
-.SH NAME
-clearerr, feof, ferror, fileno \- stream status inquiries
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-void
-clearerr(FILE *stream);
-
-int
-feof(FILE *stream);
-
-int
-ferror(FILE *stream);
-
-int
-fileno(FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Clearerr
+.Dd 
+.Dt FERROR 3
+.Os
+.Sh NAME
+.Nm clearerr ,
+.Nm feof ,
+.Nm ferror ,
+.Nm fileno
+.Nd check and reset stream status
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft void
+.Fn clearerr "FILE *stream"
+.Ft int
+.Fn feof "FILE *stream"
+.Ft int
+.Fn ferror "FILE *stream"
+.Ft int
+.Fn fileno "FILE *stream"
+.Sh DESCRIPTION
+The function
+.Fn clearerr
 clears the end-of-file and error indicators for the stream pointed
 clears the end-of-file and error indicators for the stream pointed
-to by 
-.IR stream .
-.PP
-.I Feof
+to by
+.Fa stream .
+.Pp
+The function
+.Fn feof
 tests the end-of-file indicator for the stream pointed to by
 tests the end-of-file indicator for the stream pointed to by
-.IR stream ,
+.Fa stream ,
 returning non-zero if it is set.
 returning non-zero if it is set.
-The end-of-file indicator can only be cleared by
-.IR clearerr .
-.PP
-.I Ferror
+The end-of-file indicator can only be cleared by the function
+.Fn clearerr .
+.Pp
+The function
+.Fn ferror
 tests the error indicator for the stream pointed to by
 tests the error indicator for the stream pointed to by
-.IR stream ,
+.Fa stream ,
 returning non-zero if it is set.
 returning non-zero if it is set.
-The error indicator can only be cleared by
-.IR clearerr .
-.PP
-.I Fileno
-returns the integer file descriptor associated with the
-.I stream
-(see
-.IR open (2)).
-.SH ERRORS
+The error indicator can only be reset by the
+.Fn clearerr
+function.
+.Pp
+The function
+.Fn fileno
+examines the argument
+.Fa stream
+and returns its integer desciptor.
+.Sh ERRORS
 These functions should not fail and do not set the external
 variable
 These functions should not fail and do not set the external
 variable
-.IR errno .
-.SH "SEE ALSO"
-open(2), stdio(3)
-.SH STANDARDS
-.IR Clearerr ,
-.IR feof ,
+.Va errno .
+.Sh SEE ALSO
+.Xr open 2 ,
+.Xr stdio 3
+.Sh STANDARDS
+The functions
+.Fn clearerr ,
+.Fn feof ,
 and
 and
-.I ferror
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn ferror
+conform to
+.St -ansiC .
index eba10ce..3d928b2 100644 (file)
@@ -1,75 +1,82 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fflush.3    5.1 (Berkeley) %G%
+.\"     @(#)fflush.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH FFLUSH 3 ""
-.UC 7
-.SH NAME
-fflush, fpurge \- flush a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fflush(FILE *stream);
-
-int
-fpurge(FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fflush
-writes any buffered data for the given output
-.I stream
+.Dd 
+.Dt FFLUSH 3
+.Os
+.Sh NAME
+.Nm fflush ,
+.Nm fpurge
+.Nd flush a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fflush "FILE *stream"
+.Ft int
+.Fn fpurge "FILE *stream"
+.Sh DESCRIPTION
+The function
+.Fn fflush
+forces a write of all buffered data for the given output or update
+.Fa stream
 via the stream's underlying write function.
 via the stream's underlying write function.
-The stream remains open.
-.PP
+The open status of the stream is unaffected.
+.Pp
 If the
 If the
-.I stream
-argument is NULL,
-.I fflush
+.Fa stream
+argument is
+.Dv NULL ,
+.Fn fflush
 flushes
 flushes
-.I all
+.Em all
 open output streams.
 open output streams.
-.PP
-.I Fpurge
+.Pp
+The function
+.Fn fpurge
 erases any input or output buffered in the given
 erases any input or output buffered in the given
-.IR stream .
+.Fa stream .
 For output streams this discards any unwritten output.
 For input streams this discards any input read from the underlying object
 but not yet obtained via
 For output streams this discards any unwritten output.
 For input streams this discards any input read from the underlying object
 but not yet obtained via
-.IR getc ;
+.Xr getc 3 ;
 this includes any text pushed back via
 this includes any text pushed back via
-.IR ungetc .
-.SH "RETURN VALUE"
+.Xr ungetc .
+.Sh RETURN VALUES
 Upon successful completion 0 is returned.
 Otherwise,
 Upon successful completion 0 is returned.
 Otherwise,
-.B EOF
+.Dv EOF
 is returned and the global variable
 is returned and the global variable
-.I errno
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.TP 15
-[EBADF]
-.I Stream
+.Sh ERRORS
+.Bl -tag -width [EBADF]
+.It Bq Er EBADF
+.Fa Stream
 is not an open stream, or, in the case of
 is not an open stream, or, in the case of
-.IR fflush ,
+.Fn fflush ,
 not a stream open for writing.
 not a stream open for writing.
-.PP
-.I Fflush
+.El
+.Pp
+The function
+.Fn fflush
 may also fail and set
 may also fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routine
 for any of the errors specified for the routine
-.IR write (2).
-.SH "SEE ALSO"
-write(2), fopen(3), fclose(3), setbuf(3)
-.SH STANDARDS
-.I Fflush
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Xr write 2 .
+.Sh SEE ALSO
+.Xr write 2 ,
+.Xr fopen 3 ,
+.Xr fclose 3 ,
+.Xr setbuf 3
+.Sh STANDARDS
+The
+.Fn fflush
+function
+conforms to
+.St -ansiC .
index ac97551..08420ff 100644 (file)
@@ -1,75 +1,98 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fgetln.3    5.3 (Berkeley) %G%
+.\"     @(#)fgetln.3   5.4 (Berkeley) %G%
 .\"
 .\"
-.TH FGETLINE 3 ""
-.UC 7
-.SH NAME
-fgetline \- get a line from a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-char *
-fgetline(FILE *stream, size_t *len);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fgetline
-returns a pointer to the next line from the stream pointed to by
-.IR stream .
-The newline character at the end of the line is replaced by a NUL.
-.PP
+.Dd 
+.Dt FGETLINE 3
+.Os
+.Sh NAME
+.Nm fgetline
+.Nd get a line from a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft char *
+.Fn fgetline "FILE *stream" "size_t *len"
+.Sh DESCRIPTION
+The
+.Fn fgetline
+function
+returns a pointer to the next line from the stream referenced by
+.Fa stream .
+The newline character at the end of the line is replaced by a
+.Dv NUL .
+.Pp
 If
 If
-.I len
+.Fa len
 is non-NULL, the length of the line, not counting the terminating
 is non-NULL, the length of the line, not counting the terminating
-NUL, is stored in the memory location it references.
-.SH "RETURN VALUE"
+.Dv NUL ,
+is stored in the memory location it references.
+.Sh RETURN VALUES
 Upon successful completion a pointer is returned;
 Upon successful completion a pointer is returned;
-this pointer becomes invalid after the next I/O operation on
-.I stream
+this pointer becomes invalid after the next
+.Tn I/O
+operation on
+.Fa stream
 (whether successful or not)
 or as soon as the stream is closed.
 (whether successful or not)
 or as soon as the stream is closed.
-Otherwise, NULL is returned.
-.I Fgetline
-does not distinguish between end-of-file and error, and callers must use
-.IR feof (3)
+Otherwise,
+.Dv NULL
+is returned.
+The
+.Fn fgetline
+function
+does not distinguish between end-of-file and error; the routines
+.Xr feof 3
 and
 and
-.IR ferror (3)
+.Xr ferror 3
+must be used
 to determine which occurred.
 If an error occurrs, the global variable
 to determine which occurred.
 If an error occurrs, the global variable
-.I errno
+.Va errno
 is set to indicate the error.
 The end-of-file condition is remembered, even on a terminal, and all
 is set to indicate the error.
 The end-of-file condition is remembered, even on a terminal, and all
-subsequent attempts to read will return NULL until the condition is
+subsequent attempts to read will return
+.Dv NULL
+until the condition is
 cleared with
 cleared with
-.IR clearerr (3).
-.PP
+.Xr clearerr 3 .
+.Pp
 The text to which the returned pointer points may be modified,
 The text to which the returned pointer points may be modified,
-provided that no changes are made beyond the terminating NUL.
+provided that no changes are made beyond the terminating
+.Dv NUL .
 These changes are lost as soon as the pointer becomes invalid.
 These changes are lost as soon as the pointer becomes invalid.
-.SH ERRORS
-.TP 15
-[EBADF]
-.I Stream
+.Sh ERRORS
+.Bl -tag -width [EBADF]
+.It Bq Er EBADF
+The argument
+.Fa stream
 is not a stream open for reading.
 is not a stream open for reading.
-.PP
-.I Fgetline
+.El
+.Pp
+The
+.Fn fgetline
+function
 may also fail and set
 may also fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routines
 for any of the errors specified for the routines
-.IR fflush (3),
-.IR malloc (3),
-.IR read (2),
-.IR stat (2),
+.Xr fflush 3 ,
+.Xr malloc 3 ,
+.Xr read 2 ,
+.Xr stat 2 ,
 or
 or
-.IR realloc (3).
-.SH "SEE ALSO"
-ferror(3), fgets(3), fopen(3), putc(3)
-.SH BUGS
+.Xr realloc 3 .
+.Sh SEE ALSO
+.Xr ferror 3 ,
+.Xr fgets 3 ,
+.Xr fopen 3 ,
+.Xr putc 3
+.Sh HISTORY
+The
+.Fn fgetline
+function is
+.Ud .
+.Sh BUGS
 It is not possible to tell whether the final line of an input file
 was terminated with a newline.
 It is not possible to tell whether the final line of an input file
 was terminated with a newline.
index 58869ab..b488cc9 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fgets.3     6.7 (Berkeley) %G%
+.\"     @(#)fgets.3    6.8 (Berkeley) %G%
 .\"
 .\"
-.TH FGETS 3 ""
-.UC 7
-.SH NAME
-fgets, gets \- get a line from a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-char *
-fgets(char *str, size_t size, FILE *stream);
-
-char *
-gets(char *str);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fgets
+.Dd 
+.Dt FGETS 3
+.Os
+.Sh NAME
+.Nm fgets ,
+.Nm gets
+.Nd get a line from a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft char *
+.Fn fgets "char *str" "size_t size" "FILE *stream"
+.Ft char *
+.Fn gets "char *str"
+.Sh DESCRIPTION
+The
+.Fn fgets
+function
 reads at most one less than the number of characters specified by
 reads at most one less than the number of characters specified by
-.IR size
+.Xr size
 from the given
 from the given
-.I stream
-into the string
-.IR str .
+.Fa stream
+and stores them in the string
+.Fa str .
 Reading stops when a newline character is found,
 at end-of-file or error.
 The newline, if any, is retained.
 Reading stops when a newline character is found,
 at end-of-file or error.
 The newline, if any, is retained.
-In any case a '\e0' character is appended to end the string.
-.PP
-.I Gets
+In any case a
+.Ql \e0
+character is appended to end the string.
+.Pp
+The
+.Fn gets
+function
 is equivalent to
 is equivalent to
-.I fgets
+.Fn fgets
 with an infinite
 with an infinite
-.I size
+.Xr size
 and a
 and a
-.I stream
+.Fa stream
 of
 of
-.BR stdin ,
+.Em stdin ,
 except that the newline character (if any) is not stored in the string.
 It is the caller's responsibility to ensure that the input line,
 if any, is sufficiently short to fit in the string.
 except that the newline character (if any) is not stored in the string.
 It is the caller's responsibility to ensure that the input line,
 if any, is sufficiently short to fit in the string.
-.SH "RETURN VALUE"
-.PP
+.Sh RETURN VALUES
+.Pp
 Upon successful completion,
 Upon successful completion,
-.I fgets
+.Fn fgets
 and 
 and 
-.I gets
+.Fn gets
 return
 return
-.IR s .
+a pointer to the string.
 If end-of-file or an error occurs before any characters are read, 
 If end-of-file or an error occurs before any characters are read, 
-they return NULL.
-.I Fgets
+they return
+.Dv NULL.
+The
+.Fn fgets
 and
 and
-.I gets
+functions
+.Fn gets
 do not distinguish between end-of-file and error, and callers must use
 do not distinguish between end-of-file and error, and callers must use
-.IR feof (3)
+.Xr feof 3
 and
 and
-.I ferror (3)
+.Xr ferror 3
 to determine which occurred.
 to determine which occurred.
-.SH ERRORS
-.TP 15
-[EBADF]
-.I Stream
+.Sh ERRORS
+.Bl -tag -width [EBADF]
+.It Bq Er EBADF
+The given
+.Fa stream
 is not a readable stream.
 is not a readable stream.
-.PP
-.I Fgets
+.El
+.Pp
+The function
+.Fn fgets
 may also fail and set
 may also fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routines
 for any of the errors specified for the routines
-.IR fflush (3),
-.IR fstat (2),
-.IR read (2),
+.Xr fflush 3 ,
+.Xr fstat 2 ,
+.Xr read 2 ,
 or
 or
-.IR malloc (3).
-.PP
-.I Gets
+.Xr malloc 3 .
+.Pp
+The function
+.Fn gets
 may also fail and set
 may also fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routine
 for any of the errors specified for the routine
-.IR getchar (3).
-.SH "SEE ALSO"
-feof(3), ferror(3), fgetline(3)
-.SH STANDARDS
-.I Fgets
+.Xr getchar 3 .
+.Sh SEE ALSO
+.Xr feof 3 ,
+.Xr ferror 3 ,
+.Xr fgetline 3
+.Sh STANDARDS
+The functions
+.Fn fgets
 and
 and
-.I gets
-conform to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Fn gets
+conform to
+.St -ansiC .
+.Sh BUGS
 Since it is usually impossible to ensure that the next input line
 is less than some arbitrary length, and because overflowing the
 input buffer is almost invariably a security violation, programs
 should
 Since it is usually impossible to ensure that the next input line
 is less than some arbitrary length, and because overflowing the
 input buffer is almost invariably a security violation, programs
 should
-.B NEVER
+.Em NEVER
 use
 use
-.IR gets .
-.I Gets
-exists purely to conform to ANSI X3.159-1989.
+.Fn gets .
+The
+.Fn gets
+function
+exists purely to conform to
+.St -ansiC .
index daa7386..c6bc3ba 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fopen.3     6.6 (Berkeley) %G%
+.\"     @(#)fopen.3    6.7 (Berkeley) %G%
 .\"
 .\"
-.TH FOPEN 3 ""
-.UC 7
-.SH NAME
-fopen, fdopen, freopen \- open a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-FILE *
-fopen(char *path, char *type);
-
-FILE *
-fdopen(int fildes, char *type);
-
-FILE *
-freopen(char *path, char *type, FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fopen
-opens the file named by
-.I path
-and associates a stream with it, returning a pointer for identifying
-the stream in subsequent operations.
-.PP
-.I Type
-is one of the following character strings:
-.TP
-``r''
-Open for reading.
+.Dd 
+.Dt FOPEN 3
+.Os
+.Sh NAME
+.Nm fopen ,
+.Nm fdopen ,
+.Nm freopen
+.Nd stream open functions
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft FILE *
+.Fn fopen "char *path" "char *mode"
+.Ft FILE *
+.Fn fdopen "int fildes" "char *mode"
+.Ft FILE *
+.Fn freopen "char *path" "char *mode" "FILE *stream"
+.Sh DESCRIPTION
+The
+.Fn fopen
+function
+opens the file whose name is the string pointed to by
+.Fa path
+and associates a stream with it.
+.Pp
+The argument
+.Fa mode
+points to a string beginning with one of the following
+sequences (Additional characters may follow these sequences.):
+.Bl -tag -width indent
+.It Dq Li r
+Open text file for reading.
 The stream is positioned at the beginning of the file.
 The stream is positioned at the beginning of the file.
-.TP
-``r+''
+.It Dq Li r+
 Open for reading and writing.
 The stream is positioned at the beginning of the file.
 Open for reading and writing.
 The stream is positioned at the beginning of the file.
-.TP
-``w''
-Open for writing.
-The file is created if it does not exist, otherwise it is truncated.
+.It Dq Li w
+Truncate file to zero length or create text file for writing.
 The stream is positioned at the beginning of the file.
 The stream is positioned at the beginning of the file.
-.TP
-``w+''
+.No It Dq Li w+
 Open for reading and writing.
 The file is created if it does not exist, otherwise it is truncated.
 The stream is positioned at the beginning of the file.
 Open for reading and writing.
 The file is created if it does not exist, otherwise it is truncated.
 The stream is positioned at the beginning of the file.
-.TP
-``a''
+.It Dq Li a
 Open for writing.
 The file is created if it does not exist.
 The stream is positioned at the end of the file.
 Open for writing.
 The file is created if it does not exist.
 The stream is positioned at the end of the file.
-.TP
-``a+''
+.It Dq Li a+
 Open for reading and writing.
 The file is created if it does not exist.
 The stream is positioned at the end of the file.
 Open for reading and writing.
 The file is created if it does not exist.
 The stream is positioned at the end of the file.
-.PP
+.El
+.Pp
 The
 The
-.I type
+.Fa mode
 string can also include the letter ``b'' either as a third character or
 as a character between the characters in any of the two-character strings
 described above.
 string can also include the letter ``b'' either as a third character or
 as a character between the characters in any of the two-character strings
 described above.
-This is strictly for compatibility with ANSI X3.159-1989 (``ANSI C'')
+This is strictly for compatibility with
+.St -ansiC
 and has no effect; the ``b'' is ignored.
 and has no effect; the ``b'' is ignored.
-.PP
-Any created files will have mode ``S_IRUSR  |  S_IWUSR | S_IRGRP | 
-S_IWGRP | S_IROTH | S_IWOTH'' (0666), as modified by the process'
+.Pp
+Any created files will have mode
+.Pf \\*q Dv S_IRUSR
+\&|
+.Dv S_IWUSR
+\&|
+.Dv S_IRGRP
+\&|
+.Dv S_IWGRP
+\&|
+.Dv S_IROTH
+\&|
+.Dv S_IWOTH Ns \\*q
+.Pq Li 0666 ,
+as modified by the process'
 umask value (see
 umask value (see
-.IR umask (2)).
-.PP
+.Xr umask 2 ) .
+.Pp
 Reads and writes may be intermixed on read/write streams in any order,
 Reads and writes may be intermixed on read/write streams in any order,
-and do not require an intermediate seek as in previous versions of 
-stdio.
-This is not portable to other systems, however; ANSI C requires that
+and do not require an intermediate seek as in previous versions of
+.Em stdio .
+This is not portable to other systems, however;
+.Tn ANSI C
+requires that
 a file positioning function intervene between output and input, unless
 an input operation encounters end-of-file.
 a file positioning function intervene between output and input, unless
 an input operation encounters end-of-file.
-.PP
-.I Fdopen
-associates a stream with a file descriptor obtained from
-.IR creat (2),
-.IR dup (2),
-.IR open (2),
-or
-.IR pipe (2).
+.Pp
 The
 The
-.I type
+.Fn fdopen
+function associates a stream with the existing file descriptor,
+.Fa fildes .
+The
+.Fa mode
 of the stream must be compatible with the mode of the file descriptor.
 of the stream must be compatible with the mode of the file descriptor.
-.PP
-.I Freopen
-substitutes the named file in place of the open
-.IR stream 
-and returns a pointer to it.
-The original stream is closed.
-.I Freopen
-is typically used to attach the preopened constant names,
-.IR stdin ,
-.IR stdout ,
-and
-.I stderr
-to files.
-.SH "SEE ALSO"
-open(2), fclose(3), fseek(3), funopen(3)
-.SH "RETURN VALUES"
-Upon successful completion 
-.IR fopen ,
-.I fdopen
+.Pp
+The
+.Fn freopen
+function
+opens the file whose name is the string pointed to by
+.Fa path
+and associates the stream pointed to by
+.Fa stream
+with it.
+The original stream (if it exists) is closed.
+The
+.Fa mode
+argument is used just as in the
+.Xr fopen
+function.
+The primary use of the
+.Fn freopen
+function
+is to change the file associated with a
+standard text stream
+.Pf ( Em stderr ,
+.Em stdin ,
+or
+.Em stdout ) .
+.Sh RETURN VALUES
+Upon successful completion
+.Fn fopen ,
+.Fn fdopen
 and
 and
-.I freopen
-return a FILE pointer.
-Otherwise, NULL is returned and the global variable
-.I errno
+.Fn freopen
+return a
+.Tn FILE
+pointer.
+Otherwise,
+.Dv NULL
+is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.TP 15 
-[EINVAL]
-The 
-.I type
-provided to 
-.IR fopen ,
-.IR fdopen ,
+.Sh ERRORS
+.Bl -tag -width [EINVAL]
+.It Bq Er EINVAL
+The
+.Fa mode
+provided to
+.Fn fopen ,
+.Fn fdopen ,
 or
 or
-.IR freopen 
+.Fn freopen
 was invalid.
 was invalid.
-.PP
-.IR Fopen ,
-.I fdopen
+.El
+.Pp
+The
+.Fn fopen ,
+.Fn fdopen
 and
 and
-.I freopen
+.Fn freopen
+functions
 may also fail and set
 may also fail and set
-.IR errno
+.Va errno
 for any of the errors specified for the routine
 for any of the errors specified for the routine
-.IR malloc (3).
-.PP
-.I Fopen
+.Xr malloc 3 .
+.Pp
+The
+.Fn fopen
+function
 may also fail and set
 may also fail and set
-.IR errno
+.Va errno
 for any of the errors specified for the routine
 for any of the errors specified for the routine
-.IR open (2).
-.PP
-.I Fdopen
+.Xr open 2 .
+.Pp
+The
+.Fn fdopen
+function
 may also fail and set
 may also fail and set
-.IR errno
+.Va errno
 for any of the errors specified for the routine
 for any of the errors specified for the routine
-.IR fcntl (2).
-.PP
-.I Freopen
+.Xr fcntl 2 .
+.Pp
+The
+.Fn freopen
+function
 may also fail and set
 may also fail and set
-.IR errno
+.Va errno
 for any of the errors specified for the routines
 for any of the errors specified for the routines
-.IR open (2), 
-.IR fclose (3)
+.Xr open 2 ,
+.Xr fclose 3
 and
 and
-.IR fflush (3).
-.SH STANDARDS
-.I Fopen
+.Xr fflush 3 .
+.Sh SEE ALSO
+.Xr open 2 ,
+.Xr fclose 3 ,
+.Xr fseek 3 ,
+.Xr funopen 3
+.Sh STANDARDS
+The
+.Fn fopen
 and
 and
-.I freopen
-conform to ANSI X3.159-1989 (``ANSI C'').
-.I Fdopen
-conforms to IEEE Std 1003.1-1988 (``POSIX'').
-.SH BUGS
-.I Fdopen
-may not be portable to systems other than UNIX.
+.Fn freopen
+functions
+conform to
+.St -ansiC .
+The
+.Fn fdopen
+function
+conforms to
+.St -p1003.1-88 .
index 546590c..9228a7f 100644 (file)
@@ -1,68 +1,79 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fputs.3     6.3 (Berkeley) %G%
+.\"     @(#)fputs.3    6.5 (Berkeley) %G%
 .\"
 .\"
-.TH FPUTS 3 ""
-.UC 7
-.SH NAME
-fputs, puts \- put a line to a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fputs(char *str, FILE *stream);
-
-int
-puts(char *str);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fputs
-writes the string
-.I str
-to the given
-.IR stream .
-.PP
-.I Puts
+.Dd 
+.Dt FPUTS 3
+.Os
+.Sh NAME
+.Nm fputs ,
+.Nm puts
+.Nd output a line to a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fputs "const char *str" "FILE *stream"
+.Ft int
+.Fn puts "const char *str"
+.Sh DESCRIPTION
+The function
+.Fn fputs
+writes the string pointed to by
+.Fa str
+to the stream pointed to by
+.Fa stream .
+.\" The terminating
+.\" .Dv NUL
+.\" character is not written.
+.Pp
+The function
+.Fn puts
 writes the string
 writes the string
-.I str
-to the standard output stream
-.BR stdout ,
-appending a newline character.
-.SH "RETURN VALUE"
-.I Fputs
-returns 0 on success,
-.B EOF
+.Fa str ,
+and a terminating newline character,
+to the stream
+.Em stdout .
+.Sh RETURN VALUES
+The
+.Fn fputs
+function
+returns 0 on success and
+.Dv EOF
 on error;
 on error;
-.I puts
-returns a nonnegative integer on success,
-.B EOF
+.Fn puts
+returns a nonnegative integer on success and
+.Dv EOF
 on error.
 on error.
-.SH "SEE ALSO"
-putc(3), ferror(3), stdio(3)
-.SH ERRORS
-.TP 15
-[EBADF]
-.I Stream
+.Sh ERRORS
+.Bl -tag -width [EBADF]
+.It Bq Er EBADF
+The
+.Fa stream
+supplied
 is not a writable stream.
 is not a writable stream.
-.PP
-.I Fputs
+.El
+.Pp
+The functions
+.Fn fputs
 and
 and
-.I puts
+.Fn puts
 may also fail and set
 may also fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routines
 for any of the errors specified for the routines
-.IR write (2).
-.SH STANDARDS
-.I Fputs
+.Xr write 2 .
+.Sh SEE ALSO
+.Xr putc 3 ,
+.Xr ferror 3 ,
+.Xr stdio 3
+.Sh STANDARDS
+The functions
+.Fn fputs
 and
 and
-.I puts
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn puts
+conform to
+.St -ansiC .
index ae5ad08..56b35a8 100644 (file)
@@ -1,64 +1,73 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fread.3     6.4 (Berkeley) %G%
+.\"     @(#)fread.3    6.5 (Berkeley) %G%
 .\"
 .\"
-.TH FREAD 3 ""
-.UC 7
-.SH NAME
-fread, fwrite \- stream binary input/output
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fread(void *ptr, size_t size, size_t count, FILE *stream);
-
-int
-fwrite(void *ptr, size_t size, size_t count, FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fread
+.Dd 
+.Dt FREAD 3
+.Os
+.Sh NAME
+.Nm fread ,
+.Nm fwrite
+.Nd binary stream input/output
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fread "void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
+.Ft int
+.Fn fwrite "void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
+.Sh DESCRIPTION
+The function
+.Fn fread
 reads
 reads
-.I count
-items of data, each
-.I size
-bytes long, from the given input
-.IR stream ,
+.Fa nmemb
+elements of data, each
+.Xr size
+bytes long, from the stream pointed to by
+.Fa stream ,
 storing them at the location given by
 storing them at the location given by
-.IR ptr .
-It returns the actual count of items read
-(which will be less than
-.I count
-in the event of an
-.B EOF
-or error).
-.PP
-Fread does not distinguish between end-of-file and error, and callers
+.Fa ptr .
+.Pp
+The function
+.Fn fwrite
+writes
+.Fa nmemb
+elements of data, each
+.Fa size
+bytes long, to the stream pointed to by
+.Fa stream ,
+obtaining them from the location given by
+.Fa ptr .
+.Sh RETURN VALUES
+The functions
+.Fn fread
+and
+.Fn fwrite
+advance the file position indicator for the stream
+by the number of characters successfully read or written and return
+that number.
+If an error occurs, or the end-of-file is reached,
+the return value is a short character count (or zero).
+.Pp
+The function
+.Fn fread
+does not distinguish between end-of-file and error, and callers
 must use
 must use
-.IR feof (3)
+.Xr feof 3
 and
 and
-.IR ferror (3)
+.Xr ferror 3
 to determine which occurred.
 to determine which occurred.
-.PP
-.I Fwrite
-writes
-.I count
-items of data, each
-.I size
-bytes long, to the given output
-.I stream ,
-obtaining them from the location given by
-.IR ptr .
-It returns the actual count of items written.
-.SH "RETURN VALUE"
-These functions return 0 (or a short count) upon end of file or error.
-.SH "SEE ALSO"
-read(2), write(2)
+.Sh SEE ALSO
+.Xr read 2 ,
+.Xr write 2
+.Sh STANDARDS
+The functions
+.Fn fread
+and
+.Fn fwrite
+conform to
+.St -ansiC .
index 71c22ed..24e5b60 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fseek.3     6.8 (Berkeley) %G%
+.\"     @(#)fseek.3    6.9 (Berkeley) %G%
 .\"
 .\"
-.TH FSEEK 3 ""
-.UC 7
-.SH NAME
-fgetpos, fseek, fsetpos, ftell, rewind \- reposition a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fseek(FILE *stream, long offset, int whence);
-
-long
-ftell(FILE *stream);
-
-void
-rewind(FILE *stream);
-
-int
-fgetpos(FILE *stream, fpos_t *pos);
-
-int
-fsetpos(FILE *stream, fpos_t *pos);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fseek
-sets the position of the next input or output
-operation on the given
-.IR stream .
-The new position is at the signed distance
-.I offset
-bytes from a specified point in the file depending on the
-value of 
-.IR whence .
+.Dd 
+.Dt FSEEK 3
+.Os
+.Sh NAME
+.Nm fgetpos ,
+.Nm fseek ,
+.Nm fsetpos ,
+.Nm ftell ,
+.Nm rewind
+.Nd reposition a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fseek "FILE *stream" "long offset" "int whence"
+.Ft long
+.Fn ftell "FILE *stream"
+.Ft void
+.Fn rewind "FILE *stream"
+.Ft int
+.Fn fgetpos "FILE *stream" "fpos_t *pos"
+.Ft int
+.Fn fsetpos "FILE *stream" "fpos_t *pos"
+.Sh DESCRIPTION
+The
+.Fn fseek
+function sets the file position indicator for the stream pointed
+to by
+.Fa stream .
+The new position, measured in bytes, is obtained by adding
+.Fa offset
+bytes to the position specified by
+.Fa whence .
 If 
 If 
-.I whence
-is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is from the
-beginning, the current position, or the end of the file, respectively.
-.I Fseek
-undoes any effects of
-.IR ungetc .
-.PP
-.I Ftell
-returns the current value of the offset relative to the beginning
-of the file associated with the named
-.IR stream .
-.PP
-.IR Rewind
-is equivalent to ``fseek(stream, 0L, SEEK_SET)'', except the error
-indicator for the stream is cleared as well (see
-.IR clearerr (3)).
-.PP
-.I Fgetpos
+.Fa whence
+is set to
+.Dv SEEK_SET ,
+.Dv SEEK_CUR ,
+or
+.Dv SEEK_END ,
+the offset is relative to the
+start of the file, the current position indicator, or end-of-file,
+respectively.
+A successful call to the
+.Fn fseek
+function clears the end-of-file indicator for the stream and undoes
+any effects of the
+.Xr ungetc 3
+function on the same stream.
+.Pp
+The
+.Fn ftell
+function
+obtains the current value of the file position indicator for the
+stream pointed to by
+.Fa stream .
+.Pp
+The
+.Fn rewind
+function sets the file position indicator for the stream pointed
+to by
+.Fa stream
+to the beginning of the file.
+It is equivalent to:
+.Pp
+.Dl (void)fseek(stream, 0L, SEEK_SET)
+.Pp
+except that the error indicator for the stream is also cleared
+(see
+.Xr clearerr 3 ) .
+.Pp
+The
+.Fn fgetpos
 and
 and
-.I fsetpos
+.Fn fsetpos
+functions
 are alternate interfaces equivalent to
 are alternate interfaces equivalent to
-.I ftell
+.Fn ftell
 and
 and
-.I fseek
-(with whence set to SEEK_SET), setting and storing the current value of
+.Fn fseek
+(with whence set to
+.Dv SEEK_SET
+), setting and storing the current value of
 the file offset into or from the object referenced by 
 the file offset into or from the object referenced by 
-.IR pos .
-On some (non-UNIX) systems an ``fpos_t'' object may be a complex object
+.Fa pos .
+On some
+.Pq (non- Ns Tn UNIX )
+systems an
+.Dq Fa fpos_t
+object may be a complex object
 and these routines may be the only way to portably reposition a text stream.
 and these routines may be the only way to portably reposition a text stream.
-.SH "SEE ALSO"
-lseek(2)
-.SH "RETURN VALUE"
-.I Rewind
+.Sh RETURN VALUES
+The
+.Fn rewind
+function
 returns no value.
 Upon successful completion,
 returns no value.
 Upon successful completion,
-.IR fgetpos ,
-.IR fseek ,
-and
-.I fsetpos
-return 0,
+.Fn fgetpos ,
+.Fn fseek ,
+.Fn fsetpos ,
 and
 and
-.I ftell
-returns the current offset.
+.Fn ftell
+return 0.
 Otherwise, \-1 is returned and the global variable errno is set to
 indicate the error.
 Otherwise, \-1 is returned and the global variable errno is set to
 indicate the error.
-.SH ERRORS
-.TP 15
-[EBADF]
-.I Stream
+.Sh ERRORS
+.Bl -tag -width [EINVAL]
+.It Bq Er EBADF
+The
+.Fa stream
+specified
 is not a seekable stream.
 is not a seekable stream.
-.TP
-[EINVAL]
+.It Bq Er EINVAL
 The
 The
-.I whence
+.Fa whence
 argument to 
 argument to 
-.I fseek
-was not SEEK_SET, SEEK_END, or SEEK_CUR.
-.PP
-.IR Fgetpos ,
-.IR fseek ,
-.IR fsetpos ,
+.Fn fseek
+was not
+.Dv SEEK_SET ,
+.Dv SEEK_END ,
+or
+.Dv SEEK_CUR .
+.El
+.Pp
+The function
+.Fn fgetpos ,
+.Fn fseek ,
+.Fn fsetpos ,
 and 
 and 
-.I ftell
+.Fn ftell
 may also fail and set
 may also fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routines
 for any of the errors specified for the routines
-.IR fflush (3),
-.IR fstat (2),
-.IR lseek (2),
+.Xr fflush 3 ,
+.Xr fstat 2 ,
+.Xr lseek 2 ,
 and 
 and 
-.IR malloc (3).
-.SH STANDARDS
-.IR Fgetpos ,
-.IR fsetpos ,
-.IR fseek ,
-.IR ftell ,
+.Xr malloc 3 .
+.Sh SEE ALSO
+.Xr lseek 2
+.Sh STANDARDS
+The
+.Fn fgetpos ,
+.Fn fsetpos ,
+.Fn fseek ,
+.Fn ftell ,
 and
 and
-.IR rewind
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn rewind
+functions
+conform to
+.St -ansiC .
index b88b8c2..ec47627 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)funopen.3   5.1 (Berkeley) %G%
+.\"     @(#)funopen.3  5.3 (Berkeley) %G%
 .\"
 .\"
-.TH FUNOPEN 3 ""
-.UC 7
-.SH NAME
-funopen, fropen, fwopen \- open a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-FILE *
-funopen(void *cookie, int (*readfn)(void *, char *, int),
-.RS
-.\" old man macros need the reset of bold mode
-.ft B
-int (*writefn)(void *, char *, int),
-fpos_t (*seekfn)(void *, off_t, int), int (*closefn)(void *));
-.RE
-.\" old man macros need the reset of bold mode
-.ft B
-
-FILE *
-fropen(void *cookie, int (*readfn)(void *, char *, int));
-
-FILE *
-fwopen(void *cookie, int (*writefn)(void *, char *, int));
-.ft R
-.fi
-.SH DESCRIPTION
-.I Funopen
-associates a stream with up to four ``I/O functions''.
+.Dd 
+.Dt FUNOPEN 3
+.Os
+.Sh NAME
+.Nm funopen ,
+.Nm fropen ,
+.Nm fwopen
+.Nd open a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft FILE *
+.Fn funopen "void  *cookie" "int  (*readfn)(void *, char *, int)" "int (writefn*)(void *, const char *, int)" "fpos_t (seekfn*)(void *, fpos_t, int)" "int (closefn*)(void *)"
+.Ft FILE *
+.Fn fropen "void  *cookie" "int  (*readfn)(void *, char *, int)"
+.Ft FILE *
+.Fn fwopen "void  *cookie" "int  (*writefn)(void *, char *, int)"
+.Sh DESCRIPTION
+The
+.Fn funopen
+function
+associates a stream with up to four
+.Dq Tn I/O No functions .
 Either 
 Either 
-.I readfn
+.Fa readfn
 or
 or
-.I writefn
+.Fa writefn
 must be specified;
 must be specified;
-the others can be given as an appropriately-typed NULL pointer.
-These I/O functions will be used to read, write, seek and
+the others can be given as an appropriately-typed
+.Dv NULL
+pointer.
+These
+.Tn I/O
+functions will be used to read, write, seek and
 close the new stream.
 close the new stream.
-.PP
+.Pp
 In general, omitting a function means that any attempt to perform the
 associated operation on the resulting stream will fail.
 If the close function is omitted, closing the stream will flush 
 any buffered output and then succeed.
 In general, omitting a function means that any attempt to perform the
 associated operation on the resulting stream will fail.
 If the close function is omitted, closing the stream will flush 
 any buffered output and then succeed.
-.PP
+.Pp
 The calling conventions of
 The calling conventions of
-.IR readfn ,
-.IR writefn ,
-.I seekfn 
+.Fa readfn ,
+.Fa writefn ,
+.Fa seekfn
 and
 and
-.I closefn
+.Fa closefn
 must match those, respectively, of
 must match those, respectively, of
-.IR read (2),
-.IR write (2),
-.IR seek (2),
+.Xr read 2 ,
+.Xr write 2 ,
+.Xr seek 2 ,
 and
 and
-.IR close (2)
+.Xr close 2
 with the single exception that they are passed the
 with the single exception that they are passed the
-.I cookie
+.Fa cookie
 argument specified to 
 argument specified to 
-.I funopen
+.Fn funopen
 in place of the traditional file descriptor argument.
 in place of the traditional file descriptor argument.
-.PP
-Read and write I/O functions are allowed to change the underlying buffer
+.Pp
+Read and write
+.Tn I/O
+functions are allowed to change the underlying buffer
 on fully buffered or line buffered streams by calling
 on fully buffered or line buffered streams by calling
-.IR setvbuf .
+.Xr setvbuf 3 .
 They are also not required to completely fill or empty the buffer.
 They are not, however, allowed to change streams from unbuffered to buffered
 or to change the state of the line buffering flag.
 They must also be prepared to have read or write calls occur on buffers other
 than the one most recently specified.
 They are also not required to completely fill or empty the buffer.
 They are not, however, allowed to change streams from unbuffered to buffered
 or to change the state of the line buffering flag.
 They must also be prepared to have read or write calls occur on buffers other
 than the one most recently specified.
-.PP
-All user I/O functions can report an error by returning \-1.
+.Pp
+All user
+.Tn I/O
+functions can report an error by returning \-1.
 Additionally, all of the functions should set the external variable
 Additionally, all of the functions should set the external variable
-.I errno
+.Va errno
 appropriately if an error occurs.
 appropriately if an error occurs.
-.PP
+.Pp
 An error on 
 An error on 
-.I closefn
+.Fn closefn
 does not keep the stream open.
 does not keep the stream open.
-.PP
-As a convenience, the include file ``<stdio.h>'' defines the macros
-.I fropen
+.Pp
+As a convenience, the include file
+.Aq Pa stdio.h
+defines the macros
+.Fn fropen
 and
 and
-.I fwopen
+.Fn fwopen
 as calls to
 as calls to
-.I funopen
+.Fn funopen
 with only a read or write function specified.
 with only a read or write function specified.
-.SH "SEE ALSO"
-fcntl(2), open(2), fclose(3), fopen(3), fseek(3), setbuf(3)
-.SH "RETURN VALUES"
+.Sh RETURN VALUES
 Upon successful completion, 
 Upon successful completion, 
-.I funopen
-returns a FILE pointer.
-Otherwise, NULL is returned and the global variable
-.I errno
+.Fn funopen
+returns a
+.Dv FILE
+pointer.
+Otherwise,
+.Dv NULL
+is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.TP 15
-[EINVAL]
-.I Funopen
+.Sh ERRORS
+.Bl -tag -width [EINVAL]
+.It Bq Er EINVAL
+The
+.Fn funopen
+function
 was called without either a read or write function.
 was called without either a read or write function.
-.I Funopen
-may also fail and set errno for any of the errors
+The
+.Fn funopen
+function
+may also fail and set
+.Va errno
+for any of the errors
 specified for the routine
 specified for the routine
-.IR malloc (3).
-.SH BUGS
-.I Funopen
-may not be portable to systems other than BSD.
+.Xr malloc 3 .
+.El
+.Sh SEE ALSO
+.Xr fcntl 2 ,
+.Xr open 2 ,
+.Xr fclose 3 ,
+.Xr fopen 3 ,
+.Xr fseek 3 ,
+.Xr setbuf 3
+.Sh HISTORY
+These
+functions are
+.Ud .
+.Sh BUGS
+The
+.Fn funopen
+function
+may not be portable to systems other than
+.Bx .
index bcec321..02a8530 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getc.3      6.5 (Berkeley) %G%
+.\"     @(#)getc.3     6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETC 3 ""
-.UC 7
-.SH NAME
-fgetc, getc, getchar, getw \- get a character or word from a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fgetc(FILE *stream);
-
-int
-getc(FILE *stream);
-
-int
-getchar();
-
-int
-getw(FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fgetc
-returns the next input character from the given
-.IR stream ,
-or the next character pushed back via
-.IR ungetc .
-.PP
-.I Getc
+.Dd 
+.Dt GETC 3
+.Os
+.Sh NAME
+.Nm fgetc ,
+.Nm getc ,
+.Nm getchar ,
+.Nm getw
+.Nd get next character or word from input stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fgetc "FILE *stream"
+.Ft int
+.Fn getc "FILE *stream"
+.Ft int
+.Fn getchar 
+.Ft int
+.Fn getw "FILE *stream"
+.Sh DESCRIPTION
+The
+.Fn fgetc
+function
+obtains the next input character (if present) from the stream pointed at by
+.Fa stream ,
+or the next character pushed back on the stream via
+.Xr ungetc .
+.Pp
+The
+.Fn getc
+function
 acts essentially identically to
 acts essentially identically to
-.IR fgetc ,
+.Fn fgetc ,
 but is a macro that expands in-line.
 but is a macro that expands in-line.
-.PP
-.I Getchar
-is identical to ``getc(stdin)''.
-.PP
-.I Getw
-returns the next
-.B int
-from the named input
-.IR stream .
-.SH "RETURN VALUE"
-These functions return the integer constant
-.B EOF
-at end-of-file, upon read error, or if an attempt is made to read a
-write-only stream.
-Callers must use 
-.I feof 
+.Pp
+The
+.Fn getchar
+function
+is equivalent to:
+getc with the argument stdin.
+.Pp
+The
+.Fn getw
+function
+obtains the next
+.Em int
+(if present)
+from the stream pointed at by
+.Fa stream .
+.Sh RETURN VALUES
+If successful, these routines return the next requested object
+from the
+.Fa stream .
+If the stream is at end-of-file or a read error occurs,
+the routines return
+.Dv EOF .
+The routines
+.Xr feof 3
 and
 and
-.I ferror
-to distinguish between end-of-file and error.
+.Xr ferror 3
+must be used to distinguish between end-of-file and error.
 If an error occurs, the global variable
 If an error occurs, the global variable
-.I errno
+.Va errno
 is set to indicate the error.
 The end-of-file condition is remembered, even on a terminal, and all
 subsequent attempts to read will return
 is set to indicate the error.
 The end-of-file condition is remembered, even on a terminal, and all
 subsequent attempts to read will return
-.B EOF
+.Dv EOF
 until the condition is cleared with
 until the condition is cleared with
-.IR clearerr .
-.SH "SEE ALSO"
-ferror(3), fread(3), fopen(3), putc(3), ungetc(3)
-.SH BUGS
+.Xr clearerr .
+.Sh SEE ALSO
+.Xr ferror 3 ,
+.Xr fread 3 ,
+.Xr fopen 3 ,
+.Xr putc 3 ,
+.Xr ungetc 3
+.Sh STANDARDS
+The
+.Fn fgetc ,
+.Fn getc
+and
+.Fn getchar
+functions
+conform to
+.St -ansiC .
+.Sh BUGS
 Since
 Since
-.B EOF
+.Dv EOF
 is a valid integer value,
 is a valid integer value,
-.I feof
+.Xr feof
 and
 and
-.I ferror
+.Xr ferror
 must be used to check for failure after calling
 must be used to check for failure after calling
-.IR getw .
+.Fn getw .
 The size and byte order of an
 The size and byte order of an
-.B int
+.Em int
 varies from one machine to another, and
 varies from one machine to another, and
-.I getw
+.Fn getw
 is not recommended for portable applications.
 is not recommended for portable applications.
-.PP
-Because it is implemented as a macro,
-.I getc
-treats a
-.I stream
-argument with side effects incorrectly.
-In particular, ``getc(*f++);'' may not work sensibly.
-.SH STANDARDS
-.IR Fgetc ,
-.IR getc
-and
-.I getchar
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Pp
index 36e9131..97bad5b 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)mktemp.3    6.8 (Berkeley) %G%
+.\"     @(#)mktemp.3   6.10 (Berkeley) %G%
 .\"
 .\"
-.TH MKTEMP 3  ""
-.AT 3
-.SH NAME
-mktemp \- create a unique file name
-.SH SYNOPSIS
-.nf
-.ft B
-#include <unistd.h>
-
-char *mktemp(char *template);
-
-int mkstemp(char *template);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Mktemp
-takes a file name template and overwrites it to create a unique file
-name for use by the application.
-The template may be any file name with some number of X's appended
-to it, for example ``/tmp/temp.XXXX''.
-The trailing X's are replaced with the current process number and/or a
+.Dd 
+.Dt MKTEMP 3
+.Os
+.Sh NAME
+.Nm mktemp
+.Nd make temporary file name (unique)
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft char *
+.Fn mktemp "char *template"
+.Ft int
+.Fn mkstemp "char *template"
+.Sh DESCRIPTION
+The
+.Fn mktemp
+function
+takes the given file name template and overwrites a portion of it
+to create a file name.
+This file name is unique and suitable for use
+by the application.
+The template may be any file name with some number of
+.Ql X Ns s
+appended
+to it, for example
+.Pa /tmp/temp.XXXX .
+The trailing
+.Ql X Ns s
+are replaced with the current process number and/or a
 unique letter combination.
 The number of unique file names
 unique letter combination.
 The number of unique file names
-.I mktemp
-can return depends on the number of X's provided; six X's will
+.Fn mktemp
+can return depends on the number of
+.Ql X Ns s
+provided; six
+.Ql X Ns s
+will
 result in
 result in
-.I mktemp
+.Fn mktemp
 testing roughly 26 ** 6 combinations.
 testing roughly 26 ** 6 combinations.
-.PP
-.I Mkstemp
+.Pp
+The
+.Fn mkstemp
+function
 makes the same replacement to the template and creates the template file,
 mode 0600, returning a file descriptor opened for reading and writing.
 This avoids the race between testing for a file's existence and opening it
 for use.
 makes the same replacement to the template and creates the template file,
 mode 0600, returning a file descriptor opened for reading and writing.
 This avoids the race between testing for a file's existence and opening it
 for use.
-.SH "RETURN VALUE"
-.I Mktemp
-returns a pointer to the template on success and NULL on failure.
-.I Mkstemp
-returns -1 if no suitable file could be created.
-If either call fails an error code is placed in the global location
-.IR errno .
-.SH ERRORS
-.I Mktemp
+.Sh RETURN VALUES
+The
+.Fn mktemp
+function
+returns a pointer to the template on success and
+.Dv NULL
+on failure.
+The
+.Fn mkstemp
+function
+returns \-1 if no suitable file could be created.
+If either call fails an error code is placed in the global variable
+.Va errno .
+.Sh ERRORS
+The
+.Fn mktemp
 and
 and
-.I mkstemp
+.Fn mkstemp
+functions
 may set
 may set
-.I errno
+.Va errno
 to one of the following values:
 to one of the following values:
-.TP
-[ENOTDIR]
+.Bl -tag -width [ENOTDIR]
+.It Bq Er ENOTDIR
 The pathname portion of the template is not an existing directory.
 The pathname portion of the template is not an existing directory.
-.PP
-.I Mktemp
+.El
+.Pp
+The
+.Fn mktemp
 and
 and
-.I mkstemp
+.Fn mkstemp
+functions
 may also set
 may also set
-.I errno
+.Va errno
 to any value specified by the
 to any value specified by the
-.IR stat (2)
+.Xr stat 2
 function.
 function.
-.I Mkstemp
+.Pp
+The
+.Fn mkstemp
+function
 may also set
 may also set
-.I errno
+.Va errno
 to any value specified by the
 to any value specified by the
-.IR open (2)
+.Xr open 2
 function.
 function.
-.SH "SEE ALSO"
-chmod(2), getpid(2), open(2), stat(2)
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr getpid 2 ,
+.Xr open 2 ,
+.Xr stat 2
+.Sh HISTORY
+A
+.Nm mktemp
+function appeared in
+.At v7 .
index 1daf8bc..5a888ed 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)printf.3    6.9 (Berkeley) %G%
+.\"     @(#)printf.3   6.11 (Berkeley) %G%
 .\"
 .\"
-.TH PRINTF 3 ""
-.UC 7
-.SH NAME
-printf, fprintf, sprintf, snprintf, vprintf, vfprintf,
-vsprintf, vsnprintf \- formatted output conversion
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B printf(format
-[ , arg ... ]
-.B )
-.br
-.B char *format;
-.PP
-.B fprintf(stream, format
-[ , arg ... ]
-.B )
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *format;
-.PP
-.B sprintf(str, format
-[ , arg ... ]
-.B )
-.br
-.B char *str, *format;
-.PP
-.B snprintf(str, size, format
-[ , arg ... ]
-.B )
-.br
-.B char *str;
-.br
-.B size_t size;
-.br
-.B char *format;
-.\" .PP
-.\" .B char *smprintf(format
-.\" [ , arg ... ]
-.\" .B )
-.PP
-.B #include <varargs.h>
-.PP
-.B vprintf(format, ap)
-.br
-.B char *format;
-.br
-.B va_list ap;
-.PP
-.B vfprintf(stream, format, ap)
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *format;
-.br
-.B va_list ap;
-.PP
-.B vsprintf(str, format, ap)
-.br
-.B char *str, *format;
-.br
-.B va_list ap;
-.PP
-.B vsnprintf(str, size, format, ap)
-.br
-.B char *str;
-.br
-.B size_t size;
-.br
-.B char *format;
-.br
-.B va_list ap;
-.\" .PP
-.\" .B char *vsmprintf(format, ap)
-.\" .br
-.\" .B char *format;
-.\" .br
-.\" .B va_list ap;
-.SH DESCRIPTION
+.Dd 
+.Dt PRINTF 3
+.Os
+.Sh NAME
+.Nm printf ,
+.Nm fprintf ,
+.Nm sprintf ,
+.Nm snprintf ,
+.Nm vprintf ,
+.Nm vfprintf,
+.Nm vsprintf ,
+.Nm vsnprintf
+.Nd formatted output conversion
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn printf "const char *format" ...
+.Ft int
+.Fn fprintf "FILE *stream" "const char *format" ...
+.Ft int
+.Fn sprintf "char *str" "const char *format" ...
+.Ft int
+.Fn snprintf "char *str" "size_t size" "const char *format" ...
+.\" .Ft int
+.\" .Fn smprintf "const char *format" ...
+.Fd #include <varargs.h>
+.Ft int
+.Fn vprintf "const char *format" "va_list ap"
+.Ft int
+.Fn vfprintf "FILE *stream" "const char *format" "va_list ap"
+.Ft int
+.Fn vsprintf "char *str" "char *format" "va_list ap"
+.Ft int
+.Fn vsnprintf "char *str" "size_t size" "const char *format" "va_list ap"
+.\" .Ft int
+.\" .Fn vsmprintf "const char *format" "va_list ap"
+.Sh DESCRIPTION
 The
 The
-.I printf
+.Fn printf
 family of functions produces output according to a
 family of functions produces output according to a
-.I format
+.Fa format
 as described below.
 as described below.
-.I Printf
+.Fn Printf
 and
 and
-.I vprintf
-write the standard output stream
-.BR stdout ;
-.I fprintf
+.Fn vprintf
+write output to
+.Em stdout,
+the standard output stream;
+.Fn fprintf
 and
 and
-.I vfprintf
-write the named output
-.IR stream ;
-.IR sprintf ,
-.IR snprintf ,
-.IR vsprintf ,
+.Fn vfprintf
+write output to the given output
+.Fa stream ;
+.Fn sprintf ,
+.Fn snprintf ,
+.Fn vsprintf ,
 and
 and
-.I vsnprintf
+.Fn vsnprintf
 write to the character string
 write to the character string
-.IR str .
+.Fa str .
 .\" .IR str ;
 .\" and
 .\" .I smprintf
 .\" .IR str ;
 .\" and
 .\" .I smprintf
@@ -121,21 +74,22 @@ write to the character string
 .\" .I vsmprintf
 .\" dynamically allocate a new string with
 .\" .IR malloc .
 .\" .I vsmprintf
 .\" dynamically allocate a new string with
 .\" .IR malloc .
-Each function converts, formats, and prints the arguments following the
-.I format
-(or accessed via the variable-length argument facilities of
-.IR varargs (3))
-under control of the
-.I format
-argument.
+These functions write the output under the control of a
+.Fa format
+string that specifies how subsequent arguments
+(or arguments accessed via the variable-length argument facilities of
+.Xr varargs 3 )
+are converted for output.
 .\" Except for
 .\" .I smprintf
 .\" and
 .\" .IR vsmprintf ,
 .\" all of these functions return
 .\" Except for
 .\" .I smprintf
 .\" and
 .\" .IR vsmprintf ,
 .\" all of these functions return
-Each function returns
+These functions return
 the number of characters printed
 the number of characters printed
-(not including the trailing `\e0' used to end output to strings).
+(not including the trailing
+.Ql \e0
+used to end output to strings).
 .\" .I Smprintf
 .\" and
 .\" .I vsmprintf
 .\" .I Smprintf
 .\" and
 .\" .I vsmprintf
@@ -150,420 +104,484 @@ the number of characters printed
 .\" .I vsmprintf
 .\" will return
 .\" .SM
 .\" .I vsmprintf
 .\" will return
 .\" .SM
-.\" .BR NULL .
-.I Snprintf
+.\" .BR
+.Fn Snprintf
 and
 and
-.I vsnprintf
+.Fn vsnprintf
 will write at most
 will write at most
-.IR size \-1
+.Fa size Ns \-1
 of the characters printed into the output string
 (the
 of the characters printed into the output string
 (the
-.IR size 'th
-character then gets the terminating `\e0');
+.Fa size Ns 'th
+character then gets the terminating
+.Ql \e0 ) ;
 if the return value is greater than or equal to the
 if the return value is greater than or equal to the
-.I size
+.Fa size
 argument, the string was too short
 and some of the printed characters were discarded.
 argument, the string was too short
 and some of the printed characters were discarded.
-.I Sprintf
+.Fn Sprintf
 and
 and
-.I vsprintf
+.Fn vsprintf
 effectively assume an infinte
 effectively assume an infinte
-.IR size .
-.PP
-The format is a string comprised of two types of objects:
-plain characters, which are simply copied to the output stream,
-and conversion specifications,
-each of which causes conversion and printing of the next successive
-.IR arg .
-These arguments must correspond properly (after type promotion)
+.Fa size .
+.Pp
+The format string is composed of zero or more directives:
+ordinary
+.\" multibyte
+characters (not
+.Cm % ) ,
+which are copied unchanged to the output stream;
+and conversion specifications, each of which results
+in fetching zero or more subsequent arguments.
+Each conversion specification is introduced by
+the character
+.Cm % .
+The arguments must correspond properly (after type promotion)
 with the conversion specifier.
 with the conversion specifier.
-Each conversion is introduced by the
-.B %
-(percent sign) character.
-The rest of the conversion includes, in the following order,
-.TP 4
-.B \(bu
+After the
+.Cm % ,
+the following appear in sequence:
+.Bl -bullet
+.It
 Zero or more of the following flags:
 Zero or more of the following flags:
-.RS
-.TP 4
-.B \(bu
-a `#' character
+.Bl -hyphen -offset indent
+.It
+a
+.Cm #
+character
 specifying that the value should be converted to an ``alternate form''.
 For 
 specifying that the value should be converted to an ``alternate form''.
 For 
-.BR c ,
-.BR d ,
-.BR i ,
-.BR n ,
-.BR p ,
-.BR s ,
+.Cm c ,
+.Cm d ,
+.Cm i ,
+.Cm n ,
+.Cm p ,
+.Cm s ,
 and
 and
-.BR u ,
+.Cm u ,
 conversions, this option has no effect.
 For 
 conversions, this option has no effect.
 For 
-.B o
+.Cm o
 conversions, the precision of the number is increased to force the first
 character of the output string to a zero (except if a zero value is printed
 with an explicit precision of zero).
 For
 conversions, the precision of the number is increased to force the first
 character of the output string to a zero (except if a zero value is printed
 with an explicit precision of zero).
 For
-.B x
+.Cm x
 and
 and
-.B X
+.Cm X
 conversions, a non-zero result has the string
 conversions, a non-zero result has the string
-.B 0x
+.Ql 0x
 (or
 (or
-.B 0X
+.Ql 0X
 for
 for
-.B X
+.Cm X
 conversions) prepended to it.
 For
 conversions) prepended to it.
 For
-.BR e ,
-.BR E ,
-.BR f ,
-.BR g ,
+.Cm e ,
+.Cm E ,
+.Cm f ,
+.Cm g ,
 and
 and
-.BR G ,
+.Cm G ,
 conversions, the result will always contain a decimal point, even if no
 digits follow it (normally, a decimal point appears in the results of
 those conversions only if a digit follows).
 For
 conversions, the result will always contain a decimal point, even if no
 digits follow it (normally, a decimal point appears in the results of
 those conversions only if a digit follows).
 For
-.B g
+.Cm g
 and
 and
-.B G
+.Cm G
 conversions, trailing zeros are not removed from the result as they
 would otherwise be.
 conversions, trailing zeros are not removed from the result as they
 would otherwise be.
-.TP 4
-.B \(bu
-A zero `0' character specifying zero padding.
+.It
+A zero
+.Sq Cm \&0
+character specifying zero padding.
 For all conversions except
 For all conversions except
-.BR n ,
+.Cm n ,
 the converted value is padded on the left with zeros rather than blanks.
 If a precision is given with a numeric conversion
 the converted value is padded on the left with zeros rather than blanks.
 If a precision is given with a numeric conversion
-.RB ( d ,
-.BR i ,
-.BR o ,
-.BR u ,
-.BR i ,
-.BR x ,
+.Pf ( Mc d ,
+.Cm i ,
+.Cm o ,
+.Cm u ,
+.Cm i ,
+.Cm x ,
 and
 and
-.BR X ),
-the `0' flag is ignored.
-.TP 4
-.B \(bu
-A minus sign (`-') specifying left adjustment of the converted value
-in the indicated field.
+.Cm X ) ,
+the
+.Sq Cm \&0
+flag is ignored.
+.It
+A negative field width flag
+.Sq Cm \-
+indicates the converted value is to be left adjusted on the field boundary.
 Except for
 Except for
-.B n
+.Cm n
 conversions, the converted value is padded on the right with blanks,
 rather than on the left with blanks or zeros.
 conversions, the converted value is padded on the right with blanks,
 rather than on the left with blanks or zeros.
-A `-' overrides a `0' if both are given.
-.TP 4
-.B \(bu
+A
+.Sq Cm \-
+overrides a
+.Sq Cm \&0
+if both are given.
+.It
 A space, specifying that a blank should be left before a positive number
 produced by a signed conversion
 A space, specifying that a blank should be left before a positive number
 produced by a signed conversion
-.RB ( d ,
-.BR e ,
-.BR E ,
-.BR f ,
-.BR g ,
-.BR G ,
+.Pf ( Cm d ,
+.Cm e ,
+.Cm E ,
+.Cm f ,
+.Cm g ,
+.Cm G ,
 or
 or
-.BR i ).
-.TP 4
-.B \(bu
-a `+' character specifying that a sign always be placed before a
+.Cm i ) .
+.It
+a
+.Sq Cm +
+character specifying that a sign always be placed before a
 number produced by a signed conversion.
 number produced by a signed conversion.
-A `+' overrides a space if both are used.
-.RE
-.TP 4
-.B \(bu
-An optional digit string specifying a field width.
+A
+.Sq Cm +
+overrides a space if both are used.
+.El
+.It
+An optional decimal digit string specifying a minimum field width.
 If the converted value has fewer characters than the field width, it will
 If the converted value has fewer characters than the field width, it will
-be padded on the left (or right, if the left-adjustment flag is used) to
-make up the field width.
-.TP 4
-.B \(bu
-An optional precision, in the form of a period (`.') followed by an
+be padded with spaces on the left (or right, if the left-adjustment
+flag has been given) to fill out
+the field width.
+.It
+An optional precision, in the form of a period
+.Sq Cm \&.
+followed by an
 optional digit string.  If the digit string is omitted, the precision
 is taken as zero.  This gives the minimum number of digits to appear for
 optional digit string.  If the digit string is omitted, the precision
 is taken as zero.  This gives the minimum number of digits to appear for
-.BR d ,
-.BR i ,
-.BR o ,
-.BR u ,
-.BR x ,
+.Cm d ,
+.Cm i ,
+.Cm o ,
+.Cm u ,
+.Cm x ,
 and
 and
-.B X
-conversions, the number of digits to appear after the decimal point for
-.BR e ,
-.BR E ,
+.Cm X
+conversions, the number of digits to appear after the decimal-point for
+.Cm e ,
+.Cm E ,
 and
 and
-.B f
+.Cm f
 conversions, the maximum number of significant digits for
 conversions, the maximum number of significant digits for
-.B g
+.Cm g
 and
 and
-.B G
+.Cm G
 conversions, or the maximum number of characters to be printed from a
 string for
 conversions, or the maximum number of characters to be printed from a
 string for
-.B s
+.Cm s
 conversions.
 conversions.
-.TP 4
-.B \(bu
-The character
-.BR h ,
+.It
+The optional character
+.Cm h ,
 specifying that a following
 specifying that a following
-.BR d ,
-.BR i ,
-.BR o ,
-.BR u ,
-.BR x ,
+.Cm d ,
+.Cm i ,
+.Cm o ,
+.Cm u ,
+.Cm x ,
 or
 or
-.B X
+.Cm X
 conversion corresponds to a
 conversion corresponds to a
-.B "short int"
+.Em short int
 or
 or
-.B "unsigned short int"
+.Em unsigned short int
 argument, or that a following
 argument, or that a following
-.B n
+.Cm n
 conversion corresponds to a pointer to a
 conversion corresponds to a pointer to a
-.B "short int"
+.Em short int
 argument.
 argument.
-.TP 4
-.B \(bu
-the character
-.B l
+.It
+The optional character
+.Cm l
 (ell) specifying that a following
 (ell) specifying that a following
-.BR d ,
-.BR i ,
-.BR o ,
-.BR u ,
-.BR x ,
+.Cm d ,
+.Cm i ,
+.Cm o ,
+.Cm u ,
+.Cm x ,
 or
 or
-.B X
-conversion corresponds to a
-.B "long int"
+.Cm X
+conversion applies to a pointer to a
+.Em long int
 or
 or
-.B "unsigned long int"
+.Em unsigned long int
 argument, or that a following
 argument, or that a following
-.B n
+.Cm n
 conversion corresponds to a pointer to a
 conversion corresponds to a pointer to a
-.B "long int"
+.Em long int
 argument.
 argument.
-.TP 4
-.B \(bu
+.It
 The character
 The character
-.B L
+.Cm L
 specifying that a following
 specifying that a following
-.BR e ,
-.BR E ,
-.BR f ,
-.BR g ,
+.Cm e ,
+.Cm E ,
+.Cm f ,
+.Cm g ,
 or
 or
-.B G
+.Cm G
 conversion corresponds to a
 conversion corresponds to a
-.B "long double"
+.Em long double
 argument (but note that long double values are not currently supported
 argument (but note that long double values are not currently supported
-by the \s-2VAX\s0 and Tahoe compilers).
-.TP 4
-.B \(bu
-A character which indicates the type of conversion to be applied.
-.PP
-A field width or precision may be an asterisk (`*') instead of a
+by the
+.Tn VAX
+and
+.Tn Tahoe
+compilers).
+.It
+A character that specifies the type of conversion to be applied.
+.El
+.Pp
+A field width or precision, or both, may be indicated by
+an asterisk
+.Ql *
+instead of a
 digit string.
 digit string.
-In this case an
-.B int
-argument supplies the value.
+In this case, an
+.Em int
+argument supplies the field width or precision.
 A negative field width is treated as a left adjustment flag followed by a
 positive field width; a negative precision is treated as though it were
 missing.
 A negative field width is treated as a left adjustment flag followed by a
 positive field width; a negative precision is treated as though it were
 missing.
-.PP
-The conversion characters and their meanings are:
-.TP 4
-.B diouxX
+.Pp
+The conversion specifiers and their meanings are:
+.Bl -tag -width "diouxX"
+.It Cm diouxX
 The
 The
-.B int
+.Em int
 (or appropriate variant) argument is converted to signed decimal
 (or appropriate variant) argument is converted to signed decimal
-.RB ( d " and " i ),
+.Pf ( Cm d
+and
+.Cm i ) ,
 unsigned octal
 unsigned octal
-.RB ( o ),
+.Pq Cm o ,
 unsigned decimal
 unsigned decimal
-.RB ( u ),
+.Pq Cm u ,
 or unsigned hexadecimal
 or unsigned hexadecimal
-.RB ( x " and " X )
-notation respectively.  The letters
-.B abcdef
+.Pf ( Cm x
+and
+.Cm X )
+notation.  The letters
+.Cm abcdef
 are used for
 are used for
-.B x
+.Cm x
 conversions; the letters
 conversions; the letters
-.B ABCDEF
+.Cm ABCDEF
 are used for
 are used for
-.B X
+.m X
 conversions.
 The precision, if any, gives the minimum number of digits that must
 appear; if the converted value requires fewer digits, it is padded on
 the left with zeros.
 conversions.
 The precision, if any, gives the minimum number of digits that must
 appear; if the converted value requires fewer digits, it is padded on
 the left with zeros.
-.TP 4
-.B DOU
+.It Cm DOU
 The
 The
-.B "long int"
+.Em long int
 argument is converted to signed decimal, unsigned octal, or unsigned
 decimal, as if the format had been
 argument is converted to signed decimal, unsigned octal, or unsigned
 decimal, as if the format had been
-.BR ld ,
-.BR lo ,
+.Cm ld ,
+.Cm lo ,
 or
 or
-.B lu
+.Cm lu
 respectively.
 These conversion characters are deprecated, and will eventually disappear.
 respectively.
 These conversion characters are deprecated, and will eventually disappear.
-.TP 4
-.B eE
+.It Cm eE
 The
 The
-.B double
+.Em double
 argument is rounded and converted in the style
 argument is rounded and converted in the style
-`[\fB\-\fR]d\fB.\fRddd\fBe\fR\(+-dd' where there is one digit before the
-decimal point and the number after is equal to the precision specification
-for the argument.
-If the precision is missing, 6 digits are given; if the precision is
-explicitly zero, no decimal point appears.
+.Sm off
+.Pf [\-]d Cm \&. No ddd Cm e No \\*(Pmdd
+.Sm on
+where there is one digit before the
+decimal-point character
+and the number of digits after it is equal to the precision;
+if the precision is missing,
+it is taken as 6; if the precision is
+zero, no decimal-point character appears.
 An
 An
-.B E
+.Cm E
 conversion uses the letter
 conversion uses the letter
-.B E
+.Cm E
 (rather than
 (rather than
-.BR e )
+.Cm e )
 to introduce the exponent.
 The exponent always contains at least two digits; if the value is zero,
 the exponent is 00.
 to introduce the exponent.
 The exponent always contains at least two digits; if the value is zero,
 the exponent is 00.
-.TP 4
-.B f
+.It Cm f
 The
 The
-.B double
+.Em double
 argument is rounded and converted to decimal notation in the style
 argument is rounded and converted to decimal notation in the style
-`[\fB\-\fR]ddd.ddd' where the number of digits after the decimal point
-is equal to the precision.
-If the precision is missing, 6 digits are given; if the precision is
-explicitly 0, no digits and no decimal point are printed.
+.Sm off
+.Pf [-]ddd Cm \&. No ddd ,
+.Sm on
+where the number of digits after the decimal-point character
+is equal to the precision specification.
+If the precision is missing, it is taken as 6; if the precision is
+explicitly zero, no decimal-point character appears.
 If a decimal point appears, at least one digit appears before it.
 If a decimal point appears, at least one digit appears before it.
-.TP 4
-.B g
+.It Cm g
 The
 The
-.B double
-argument is printed in style
-.B f
+.Em double
+argument is converted in style
+.Cm f
 or
 or
-.B e
+.Cm e
 (or
 (or
-.B E
+.Cm E
 for
 for
-.B G
+.Cm G
 conversions).
 The precision specifies the number of significant digits.
 If the precision is missing, 6 digits are given; if the precision is zero,
 it is treated as 1.
 Style
 conversions).
 The precision specifies the number of significant digits.
 If the precision is missing, 6 digits are given; if the precision is zero,
 it is treated as 1.
 Style
-.B e
+.Cm e
 is used if the exponent from its conversion is less than -4 or greater than
 or equal to the precision.
 Trailing zeros are removed from the fractional part of the result; a
 decimal point appears only if it is followed by at least one digit.
 is used if the exponent from its conversion is less than -4 or greater than
 or equal to the precision.
 Trailing zeros are removed from the fractional part of the result; a
 decimal point appears only if it is followed by at least one digit.
-.TP 4
-.B c
+.It Cm c
 The
 The
-.B int
+.Em int
 argument is converted to an
 argument is converted to an
-.B "unsigned char",
-and the resulting character is printed.
-.TP 4
-.B s
+.Em unsigned char ,
+and the resulting character is written.
+.It Cm s
 The
 The
-.B "char *"
-argument is taken to be a string (character pointer).
-Characters from the string are printed until a null character is reached,
-or until the number of characters indicated by the precision have been
-printed, whichever occurs first; if a precision is given, no null character
-need be present.
-.TP 4
-.B p
+.Dq Em char *
+argument is expected to be a pointer to an array of character type (pointer
+to a string).
+Characters from the array are written up to (but not including)
+a terminating
+.Dv NUL
+character;
+if a precision is specified, no more than the number specified are
+written.
+If a precision is given, no null character
+need be present; if the precision is not specified, or is greater than
+the size of the array, the array must contain a terminating
+.Dv NUL
+character.
+.It Cm p
 The
 The
-.B "void *"
-pointer argument is printed in hexadecimal (as if by `%#x' or `%#lx').
-.TP 4
-.B n
+.Dq Em void *
+pointer argument is printed in hexadecimal (as if by
+.Ql %#x
+or
+.Ql %#lx ) .
+.It Cm n
 The number of characters written so far is stored into the
 integer indicated by the
 The number of characters written so far is stored into the
 integer indicated by the
-.B "int *"
+.Dq Em int *
 (or variant) pointer argument.
 No argument is converted.
 (or variant) pointer argument.
 No argument is converted.
-.TP 4
-.B %
-Prints a `%'; no argument is converted.
-.PP
+.It Cm %
+A
+.Ql %
+is written. No argument is converted. The complete conversion specification
+is
+.Ql %% .
+.El
+.Pp
 In no case does a non-existent or small field width cause truncation of
 a field; if the result of a conversion is wider than the field width, the
 In no case does a non-existent or small field width cause truncation of
 a field; if the result of a conversion is wider than the field width, the
-field is expanded to contain it.
-Similarly, padding takes place only if the specified field width exceeds
-the actual width.
-.PP
-.SH EXAMPLES
+field is expanded to contain the conversion result.
+.Pp
+.Sh EXAMPLES
 .br
 To print a date and time in the form `Sunday, July 3, 10:02',
 where
 .br
 To print a date and time in the form `Sunday, July 3, 10:02',
 where
-.I weekday
+.Em weekday
 and
 and
-.I month
-are pointers to null-terminated strings:
-.RS
-.HP
-.nh
-printf("%s, %s %d, %02d:%.2d", weekday, month, day, hour, min);
-.RE
-.hy
-.PP
-To print
-.if n pi
-.if t \(*p
-to 5 decimals:
-.IP
-printf("pi = %.5f", 4*atan(1.0));
-.PP
+.Em month
+are pointers to strings:
+.Bd -literal -offset indent
+#include <stdio.h>
+fprintf(stdout,"%s, %s %d, %.2d:%.2d0",
+       weekday, month, day, hour, min);
+.Ed
+.Pp
+To print \*(Pi
+to five decimal places:
+.Bd -literal -offset indent
+#include <math.h>
+#include <stdio.h>
+fprintf(stdout,"pi = %.5f0", 4 * atan(1.0));
+.Ed
+.Pp
 To allocate a 128 byte string and print into it:
 To allocate a 128 byte string and print into it:
-.RS
-.nf
-.ta 1i 2i
-.sp
+.Bd -literal -offset indent
 #include <stdio.h>
 #include <varargs.h>
 char *newfmt(va_alist)
 #include <stdio.h>
 #include <varargs.h>
 char *newfmt(va_alist)
-       va_dcl
+               va_dcl
 {
 {
-       char *p, *malloc(), *fmt;
-       va_list ap;
-       if ((p = malloc(128)) == NULL)
-               return (NULL);
-       va_start(ap);
-       fmt = va_arg(ap, char *);
-       (void) vsprintf(p, fmt, ap);
-       va_end(ap);
-       return (p);
+               char *p, *malloc(), *fmt;
+               va_list ap;
+               if ((p = malloc(128)) == NULL)
+                       return (NULL);
+               va_start(ap);
+               fmt = va_arg(ap, char *);
+               (void) vsprintf(p, fmt, ap);
+               va_end(ap);
+               return (p);
 }
 }
-.RE
-.fi
-.SH "SEE ALSO"
-printf(1), scanf(3)
-.SH BUGS
-The conversion formats `%D', `%O', and `%U' are not standard and
+.Ed
+.Sh SEE ALSO
+.Xr printf 1 ,
+.Xr scanf 3
+.Sh STANDARDS
+The functions
+.Fn fprintf ,
+.Fn printf ,
+.Fn sprintf ,
+.Fn snprintf ,
+.Fn vprintf ,
+.Fn vfprintf ,
+.Fn vsprintf ,
+and
+.Fn vsnprintf
+functions
+conform to
+.St -ansiC .
+.Sh BUGS
+The conversion formats
+.Cm %D ,
+.Cm %O ,
+and
+.Cm %U
+are not standard and
 are provided only for backward compatibility.
 are provided only for backward compatibility.
-The effect of padding the `%p' format with zeros (either by the `0'
+The effect of padding the
+.Cm %p
+format with zeros (either by the
+.Sq Cm 0
 flag or by specifying a precision), and the benign effect (i.e., none)
 flag or by specifying a precision), and the benign effect (i.e., none)
-of the `#' flag on `%n' and `%p' conversions, as well as other
-nonsensical combinations such as `%Ld', are not standard; such combinations
+of the
+.Sq Cm #
+flag on
+.Cm %n
+and
+.Cm %p
+conversions, as well as other
+nonsensical combinations such as
+.Cm %Ld ,
+are not standard; such combinations
 should be avoided.
 should be avoided.
-.PP
+.Pp
 Because
 Because
-.I sprintf
+.Fn sprintf
 and
 and
-.I vsprintf
+.Fn vsprintf
 assume an infinitely long string,
 callers must be careful not to overflow the actual space;
 this is often impossible to assure.
 For safety, programmers should use the
 assume an infinitely long string,
 callers must be careful not to overflow the actual space;
 this is often impossible to assure.
 For safety, programmers should use the
-.I snprintf
+.Fn snprintf
 interface instead.
 Unfortunately, this interface is not portable.
 interface instead.
 Unfortunately, this interface is not portable.
index 7540c36..9cc89b6 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)putc.3      6.4 (Berkeley) %G%
+.\"     @(#)putc.3     6.6 (Berkeley) %G%
 .\"
 .\"
-.TH PUTC 3 ""
-.UC 7
-.SH NAME
-fputc, putc, putchar, putw \- put a character or word to a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-fputc(int c, FILE *stream);
-
-int
-putc(int c, FILE *stream);
-
-int
-putchar(int c);
-
-int
-putw(int w, FILE *stream);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Fputc
+.Dd 
+.Dt PUTC 3
+.Os
+.Sh NAME
+.Nm fputc ,
+.Nm putc ,
+.Nm putchar ,
+.Nm putw
+.Nd output a character or word to a stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn fputc "int c" "FILE *stream"
+.Ft int
+.Fn putc "int c" "FILE *stream"
+.Ft int
+.Fn putchar "int c"
+.Ft int
+.Fn putw "int w" "FILE *stream"
+.Sh DESCRIPTION
+The
+.Fn fputc
+function
 writes the character
 writes the character
-.I c
+.Fa c
 (converted to an ``unsigned char'')
 (converted to an ``unsigned char'')
-to the specified output
-.IR stream .
-.PP
-.I Putc
+to the output stream pointed to by
+.Fa stream .
+.Pp
+.Fn Putc
 acts essentially identically to
 acts essentially identically to
-.IR fputc ,
-but is a macro that expands in-line.
-.PP
-.I Putchar
+.Fn fputc ,
+but is a macro that expands in-line. It may evaluate
+.Fa stream
+more than once, so arguments given to
+.Fn putc
+should not be expressions with potential side effects.
+.Pp
+.Fn Putchar
 is identical to
 is identical to
-.I putc
+.Fn putc
 with an output stream of
 with an output stream of
-.BR stdout .
-.PP
-.I Putw
+.Em stdout .
+.Pp
+The
+.Fn putw
+function
 writes the specified
 writes the specified
-.B int
+.Em int
 to the named output
 to the named output
-.IR stream .
-.SH "RETURN VALUE"
-These functions return the integer constant
-.SM
-.B EOF
-upon write error,
-or if an attempt is made to write a read-only stream.
-.I Putw
+.Fa stream .
+.Sh RETURN VALUES
+The functions,
+.Fn fputc ,
+.Fn putc
+and
+.Fn putchar
+return the character written.
+If an error occurs, the value
+.Dv EOF
+is returned.
+The
+.Fn putw
+function
 returns 0 on success;
 returns 0 on success;
-the other functions return the character printed.
-.SH "SEE ALSO"
-ferror(3), fopen(3), getc(3), stdio(3)
-.SH BUGS
+.Dv EOF
+is returned if
+a write error occurs,
+or if an attempt is made to write a read-only stream.
+.Sh SEE ALSO
+.Xr ferror 3 ,
+.Xr fopen 3 ,
+.Xr getc 3 ,
+.Xr stdio 3
+.Sh STANDARDS
+The functions
+.Fn fputc ,
+.Fn putc ,
+and
+.Fn putchar ,
+conform to
+.St -ansiC .
+A function
+.Fn putw
+function appeared in
+.At v6 .
+.Sh BUGS
 The size and byte order of an
 The size and byte order of an
-.B int
+.Em int
 varies from one machine to another, and
 varies from one machine to another, and
-.I putw
+.Fn putw
 is not recommended for portable applications.
 is not recommended for portable applications.
-.PP
-Because it is implemented as a macro,
-.I putc
-treats a
-.I stream
-argument with side effects incorrectly.
-In particular, ``putc(c, *f++);'' may not work sensibly
-(although ``putc(*cp++, f);''
-.I does
-work correctly).
index dc40b73..4e00d20 100644 (file)
@@ -1,47 +1,50 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)remove.3    5.1 (Berkeley) %G%
+.\"     @(#)remove.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH REMOVE 3 ""
-.UC 7
-.SH NAME
-remove \- remove directory entry
-.SH SYNOPSIS
-.nf
-.ft B
-int
-remove(char *path);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Remove
+.Dd 
+.Dt REMOVE 3
+.Os
+.Sh NAME
+.Nm remove
+.Nd remove directory entry
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn remove "const char *path"
+.Sh DESCRIPTION
+The
+.Fn remove
+function
 is an alias for the 
 is an alias for the 
-.IR unlink (2)
+.Xr unlink 2
 system call.
 It deletes the file referenced by
 system call.
 It deletes the file referenced by
-.IR path .
-.SH "SEE ALSO"
-unlink(2)
-.SH "RETURN VALUE"
+.Fa path .
+.Sh RETURN VALUES
 Upon successful completion, 
 Upon successful completion, 
-.I remove
+.Fn remove
 returns 0.
 Otherwise, \-1 is returned and the global variable
 returns 0.
 Otherwise, \-1 is returned and the global variable
-.I errno
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Remove 
+.Sh ERRORS
+The
+.Fn remove
+function
 may fail and set
 may fail and set
-.I errno
+.Va errno
 for any of the errors specified for the routine
 for any of the errors specified for the routine
-.IR unlink (2).
-.SH STANDARDS
+.Xr unlink 2 .
+.Sh SEE ALSO
+.Xr unlink 2
+.Sh STANDARDS
 The
 The
-.I remove
-function conforms to ANSI X3.159-1989 (``ANSI C'').
+.Fn remove
+function conforms to
+.St -ansiC .
index d5e246f..2685f11 100644 (file)
@@ -1,99 +1,79 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)scanf.3     6.4 (Berkeley) %G%
+.\"     @(#)scanf.3    6.6 (Berkeley) %G%
 .\"
 .\"
-.TH SCANF 3 ""
-.UC 7
-.SH NAME
-scanf, fscanf, sscanf, vfscanf \- formatted input conversion
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B scanf(format
-[ , pointer ... ]
-.B )
-.br
-.B char *format;
-.PP
-.B fscanf(stream, format
-[ , pointer ... ]
-.B )
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *format;
-.PP
-.B sscanf(str, format
-[ , pointer ... ]
-.B )
-.br
-.B char *str;
-.br
-.B char *format;
-.PP
-.B #include <varargs.h>
-.PP
-.B vfscanf(stream, format, ap)
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *format;
-.br
-.B va_list ap;
-.br
-.SH DESCRIPTION
+.Dd 
+.Dt SCANF 3
+.Os
+.Sh NAME
+.Nm scanf ,
+.Nm fscanf ,
+.Nm sscanf ,
+.Nm vfscanf
+.Nd input format conversion
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn scanf "const char *format" ...
+.Ft int
+.Fn fscanf "FILE *stream" "const char *format" ...
+.Fd #include <varargs.h>
+.Ft int
+.Fn sscanf "char *str" "const char *format" ...
+.Ft int
+.Fn vfscanf "FILE *stream" "char *format" "va_list ap"
+.Sh DESCRIPTION
 The
 The
-.I scanf
+.Fn scanf
 family of functions scans input according to a
 family of functions scans input according to a
-.I format
+.Fa format
 as described below.
 This format may contain
 as described below.
 This format may contain
-.IR "conversion specifiers" ;
+.Em conversion specifiers ;
 the results from such conversions, if any,
 are stored through the
 the results from such conversions, if any,
 are stored through the
-.I pointer
+.Em pointer
 arguments.
 arguments.
-.I Scanf
-reads the standard input stream
-.BR stdin ,
-.I fscanf
-reads the named input
-.IR stream ,
+The
+.Fn scanf
+function
+reads input from the standard input stream
+.Em stdin ,
+.Fn fscanf
+reads input from the stream pointer
+.Fa stream ,
 and
 and
-.I sscanf
-reads from the character string
-.IR str .
-.I Vfscanf
+.Fn sscanf
+reads its input from the character string pointed to by
+.Fa str .
+The
+.Fn vfscanf
+function
 is analogous to
 is analogous to
-.I vfprintf
-and reads from a named input
-.I stream
+.Xr vfprintf 3
+and reads input from the stream pointer
+.Fa stream
 using a variable argument list of pointers (see
 using a variable argument list of pointers (see
-.IR varargs (3)).
+.Xr varargs 3 ) .
 Each successive
 Each successive
-.I pointer
+.Em pointer
 argument must correspond properly with
 each successive conversion specifier
 (but see `suppression' below).
 All conversions are introduced by the
 argument must correspond properly with
 each successive conversion specifier
 (but see `suppression' below).
 All conversions are introduced by the
-.B %
+.Cm %
 (percent sign) character.
 The
 (percent sign) character.
 The
-.I format
+.Fa format
 string
 may also contain other characters.
 White space (such as blanks, tabs, or newlines) in the
 string
 may also contain other characters.
 White space (such as blanks, tabs, or newlines) in the
-.I format
+.Fa format
 string match any amount of white space, including none, in the input.
 Everything else
 matches only itself.
 string match any amount of white space, including none, in the input.
 Everything else
 matches only itself.
@@ -101,60 +81,57 @@ Scanning stops
 when an input character does not match such a format character.
 Scanning also stops
 when an input conversion cannot be made (see below).
 when an input character does not match such a format character.
 Scanning also stops
 when an input conversion cannot be made (see below).
-
-.SH CONVERSIONS
+.Sh CONVERSIONS
 Following the
 Following the
-.B %
+.Cm %
 character introducing a conversion
 there may be a number of
 character introducing a conversion
 there may be a number of
-.I flag
+.Em flag
 characters, as follows:
 characters, as follows:
-.TP 4
-.B *
-suppresses assignment.
+.Bl -tag -width indent
+.It Cm *
+Suppresses assignment.
 The conversion that follows occurs as usual, but no pointer is used;
 the result of the conversion is simply discarded.
 The conversion that follows occurs as usual, but no pointer is used;
 the result of the conversion is simply discarded.
-.TP 4
-.B h
-indicates that the conversion will be one of
-.B dioux
+.It Cm h
+Indicates that the conversion will be one of
+.Cm dioux
 or
 or
-.B n
+.Cm n
 and the next pointer is a pointer to a
 and the next pointer is a pointer to a
-.B short int
+.Em short  int
 (rather than
 (rather than
-.BR int ).
-.TP 4
-.B l
-indicates either that the conversion will be one of
-.B dioux
+.Em int ) .
+.It Cm l
+Indicates either that the conversion will be one of
+.Cm dioux
 or
 or
-.B n
+.Cm n
 and the next pointer is a pointer to a
 and the next pointer is a pointer to a
-.B long int
+.Em long  int
 (rather than
 (rather than
-.BR int ),
+.Em int ) ,
 or that the conversion will be one of
 or that the conversion will be one of
-.B efg
+.Cm efg
 and the next pointer is a pointer to
 and the next pointer is a pointer to
-.B double
+.Em double
 (rather than
 (rather than
-.BR float ).
-.TP 4
-.B L
-indicates that the conversion will be
-.B efg
+.Em float ) .
+.It Cm L
+Indicates that the conversion will be
+.Cm efg
 and the next pointer is a pointer to
 and the next pointer is a pointer to
-.BR "long double" .
+.Em long double .
 (This type is not implemented; the
 (This type is not implemented; the
-.B L
+.Cm L
 flag is currently ignored.)
 flag is currently ignored.)
-.PP
+.El
+.Pp
 In addition to these flags,
 there may be an optional maximum field width,
 expressed as a decimal integer,
 between the
 In addition to these flags,
 there may be an optional maximum field width,
 expressed as a decimal integer,
 between the
-.B %
+.Cm %
 and the conversion.
 If no width is given,
 a default of `infinity' is used (with one exception, below);
 and the conversion.
 If no width is given,
 a default of `infinity' is used (with one exception, below);
@@ -163,218 +140,231 @@ in processing the conversion.
 Before conversion begins,
 most conversions skip white space;
 this white space is not counted against the field width.
 Before conversion begins,
 most conversions skip white space;
 this white space is not counted against the field width.
-.PP
+.Pp
 The following conversions are available:
 The following conversions are available:
-.TP 4
-.B %
-matches a literal `%'.
+.Bl -tag -width XXXX
+.It Cm %
+Matches a literal `%'.
 That is, `%%' in the format string
 matches a single input `%' character.
 That is, `%%' in the format string
 matches a single input `%' character.
-No conversion is done, and no assignment occurs.
-.TP 4
-.B d
-a decimal integer is expected;
+No conversion is done, and assignment does not occur.
+.It Cm d
+Matches an optionally signed decimal integer;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR int .
-.TP 4
-.B D
-equivalent to
-.BR ld ;
+.Em int .
+.It Cm D
+Equivalent to
+.Xr ld ;
 this exists only for backwards compatibility.
 this exists only for backwards compatibility.
-.TP 4
-.B i
-an integer is expected;
+.It Cm i
+Matches an optionally signed integer;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR int .
-The integer is read in base 16 if it begins with `0x' or `0X',
-in base 8 if it begins with `0', and in base 10 otherwise.
+.Em int .
+The integer is read in base 16 if it begins
+with
+.Ql 0x
+or
+.Ql 0X ,
+in base 8 if it begins with
+.Ql 0 ,
+and in base 10 otherwise.
 Only characters that correspond to the base are used.
 Only characters that correspond to the base are used.
-.TP 4
-.B o
-an octal integer is expected;
+.It Cm o
+Matches an octal integer;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR "unsigned int" .
-.TP 4
-.B O
-equivalent to
-.BR lo ;
+.Em unsigned int .
+.It Cm O
+Equivalent to
+.Xr lo ;
 this exists for backwards compatibility.
 this exists for backwards compatibility.
-.TP 4
-.B u
-a signed or unsigned decimal integer is expected;
+.It Cm u
+Matches an optionally signed decimal integer;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR "unsigned int" .
-.TP 4
-.B x
-a signed or unsigned hexadecimal integer is expected;
+.Em unsigned int .
+.It Cm x
+Matches an optionally a signed hexadecimal integer;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR "unsigned int" .
-.TP 4
-.B X
-equivalent to
-.BR lx ;
-this violates the ANSI C standard X3.159-1989,
+.Em unsigned int .
+.It Cm X
+Equivalent to
+.Cm lx ;
+this violates the
+.St -ansiC ,
 but is backwards compatible with previous
 but is backwards compatible with previous
-.UX
+.Ux
 systems.
 systems.
-.TP 4
-.B f
-a floating-point number is expected;
+.It Cm f
+Matches an optionally signed floating-point number;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR float .
-.TP 4
-.B e
-equivalent to
-.BR f .
-.TP 4
-.B g
-equivalent to
-.BR f .
-.TP 4
-.B E
-equivalent to
-.BR lf ;
-this violates the ANSI C standard X3.159-1989,
+.Em float .
+.It Cm e
+Equivalent to
+.Cm f .
+.It Cm g
+Equivalent to
+.Cm f .
+.It Cm E
+Equivalent to
+.Cm lf ;
+this violates the
+.St -ansiC ,
 but is backwards compatible with previous
 but is backwards compatible with previous
-.UX
+.Ux
 systems.
 systems.
-.TP 4
-.B F
-equivalent to
-.BR lf ;
+.It Cm F
+Equivalent to
+.Cm lf ;
 this exists only for backwards compatibility.
 this exists only for backwards compatibility.
-.TP 4
-.B s
-a string is expected;
+.It Cm s
+Matches a sequence of non-white-space characters;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR char ,
-and there must be enough room for all the characters in the string,
-plus a terminating `\e0'.
+.Em char ,
+and the array must be large enough to accept all the sequence and the
+terminating
+.Dv NUL
+character.
 The input string stops at white space
 or at the maximum field width, whichever occurs first.
 The input string stops at white space
 or at the maximum field width, whichever occurs first.
-.TP 4
-.B c
-.I width
-characters (default 1) are expected;
+.It Cm c
+Matches a sequence of
+.Em width
+count
+characters (default 1);
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR char ,
+.Em char ,
 and there must be enough room for all the characters
 and there must be enough room for all the characters
-(no terminating `\e0' is added).
+(no terminating
+.Dv NUL
+is added).
 The usual skip of leading white space is suppressed.
 To skip white space first, use an explicit space in the format.
 The usual skip of leading white space is suppressed.
 To skip white space first, use an explicit space in the format.
-.TP 4
-.B [
-a string is expected;
+.It Cm \&[
+Matches a nonempty sequence of characters from the specified set
+of accepted characters;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR char ,
+.Em char ,
 and there must be enough room for all the characters in the string,
 and there must be enough room for all the characters in the string,
-plus a terminating `\e0'.
+plus a terminating
+.Dv NUL
+character.
 The usual skip of leading white space is suppressed.
 The string is to be made up of characters in
 (or not in)
 a particular set;
 the set is defined by the characters between the open bracket
 The usual skip of leading white space is suppressed.
 The string is to be made up of characters in
 (or not in)
 a particular set;
 the set is defined by the characters between the open bracket
-.B [
+.Cm [
 character
 and a close bracket
 character
 and a close bracket
-.B ]
+.Cm ]
 character.
 The set
 character.
 The set
-.I excludes
+.Em excludes
 those characters
 if the first character after the open bracket is a circumflex
 those characters
 if the first character after the open bracket is a circumflex
-.BR ^ .
+.Cm ^ .
 To include a close bracket in the set,
 make it the first character after the open bracket
 or the circumflex;
 any other position will end the set.
 The hyphen character
 To include a close bracket in the set,
 make it the first character after the open bracket
 or the circumflex;
 any other position will end the set.
 The hyphen character
-.B \-
+.Cm -
 is also special;
 when placed between two other characters,
 it adds all intervening characters to the set.
 To include a hyphen,
 make it the last character before the final close bracket.
 is also special;
 when placed between two other characters,
 it adds all intervening characters to the set.
 To include a hyphen,
 make it the last character before the final close bracket.
-For instance, `[^]0-9-]'
+For instance,
+.Ql [^]0-9-]
 means the set `everything except close bracket, zero through nine,
 and hyphen'.
 means the set `everything except close bracket, zero through nine,
 and hyphen'.
-The string ends at the first character not in
-(or, with a circumflex, in)
-the set, or when the field width runs out.
-.TP 4
-.B p
-a pointer value (as printed by `%p' in
-.IR printf (3))
-is expected;
+The string ends with the appearance of a character not in the
+(or, with a circumflex, in) set
+or when the field width runs out.
+.It Cm p
+Matches a pointer value (as printed by
+.Ql %p
+in
+.Xr printf 3 ) ;
 the next pointer must be a pointer to
 the next pointer must be a pointer to
-.BR void .
-.TP 4
-.B n
-nothing is expected;
+.Em void .
+.It Cm n
+Nothing is expected;
 instead, the number of characters consumed thus far from the input
 is stored through the next pointer,
 which must be a pointer to
 instead, the number of characters consumed thus far from the input
 is stored through the next pointer,
 which must be a pointer to
-.BR int .
+.Em int .
 This is
 This is
-.I not
+.Em not
 a conversion, although it can be suppressed with the
 a conversion, although it can be suppressed with the
-.B *
+.Cm *
 flag.
 flag.
-.PP
+.El
+.Pp
 For backwards compatibility,
 For backwards compatibility,
-other conversion characters (except '\e0')
-are taken as if they were `%d' or, if uppercase, `%ld',
-and a `conversion' of `%\e0' causes an immediate return of
-.SM
-.BR EOF .
+other conversion characters (except
+.Ql \e0 )
+are taken as if they were
+.Ql %d
+or, if uppercase,
+.Ql %ld ,
+and a `conversion' of
+.Ql %\e0
+causes an immediate return of
+.Dv EOF .
 The
 The
-.B F
+.Cm F
 and
 and
-.B X
+.Cm X
 conversions will be changed in the future
 conversions will be changed in the future
-to conform to the ANSI C standard,
+to conform to the
+.Tn ANSI
+C standard,
 after which they will act like
 after which they will act like
-.B f
+.Cm f
 and
 and
-.B x
+.Cm x
 respectively.
 respectively.
-.PP
-The
-.I scanf
-functions return the number of successfully assigned conversions, or
-.SM
-.B EOF
-if nothing was assigned
-before the end of input (or an error during input) was encountered.
-A return value of 0
+.Pp
+.Sh RETURN VALUES
+These
+functions
+return
+the number of input items assigned, which can be fewer than provided
+for, or even zero, in the event of a matching failure.
+Zero
 indicates that, while there was input available,
 no conversions were assigned;
 typically this is due to an invalid input character,
 indicates that, while there was input available,
 no conversions were assigned;
 typically this is due to an invalid input character,
-such as an alphabetic character for a `%d' conversion.
-.SH "SEE ALSO"
-strtol(3),
-strtoul(3),
-getc(3),
-printf(3)
-.SH "RETURN VALUE"
-The 
-.I scanf
-functions return
-.SM
-.B EOF
-on end of input,
-or a short count for missing or illegal data items.
-.SH BUGS
+such as an alphabetic character for a
+.Ql %d
+conversion.
+The value
+.Dv EOF
+is returned if an input failure occurs before any conversion such as an
+end-of-file occurs. If an error or end-of-file occurs after conversion
+has begun,
+the number of conversions which were successfully completed is returned.
+.Sh SEE ALSO
+.Xr strtol 3 ,
+.Xr strtoul 3 ,
+.Xr getc 3 ,
+.Xr printf 3
+.Sh HISTORY
+A
+.Nm
+function appeared in
+.At v7 .
+.Sh BUGS
 The current situation with
 The current situation with
-.B %F
+.Cm %F
 and
 and
-.B %X
+.Cm %X
 conversions is unfortunate.
 conversions is unfortunate.
-.br
+.Pp
 All of the backwards compatibility formats will be removed in the future.
 All of the backwards compatibility formats will be removed in the future.
-.br
+.Pp
 There is no
 There is no
-.I vscanf
+.Em vscanf
 or
 or
-.IR vsscanf .
+.Em vsscanf .
 .\" Had to draw the line somewhere!
 .\" Had to draw the line somewhere!
index cf072a9..a98bad8 100644 (file)
@@ -1,32 +1,30 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)setbuf.3    6.7 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SETBUF 3
-.UC 4
-.SH NAME
-setbuf, setbuffer, setlinebuf, setvbuf \- assign buffering to a stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-setbuf(FILE *stream, char *buf);
-
-int
-setbuffer(FILE *stream, char *buf, size_t size);
-
-int
-setlinebuf(FILE *stream);
-
-int
-setvbuf(FILE *stream, char *buf, int mode, size_t size);
-.ft R
-.fi
-.SH DESCRIPTION
+.\"     @(#)setbuf.3   6.9 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SETBUF 3
+.Os BSD 4
+.Sh NAME
+.Nm setbuf ,
+.Nm setbuffer ,
+.Nm setlinebuf ,
+.Nm setvbuf
+.Nd stream buffering operations
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn setbuf "FILE *stream" "char *buf"
+.Ft int
+.Fn setbuffer "FILE *stream" "char *buf" "size_t size"
+.Ft int
+.Fn setlinebuf "FILE *stream"
+.Ft int
+.Fn setvbuf "FILE *stream" "char *buf" "int mode" "size_t size"
+.Sh DESCRIPTION
 The three types of buffering available are unbuffered, block buffered,
 and line buffered.
 When an output stream is unbuffered, information appears on the
 The three types of buffering available are unbuffered, block buffered,
 and line buffered.
 When an output stream is unbuffered, information appears on the
@@ -35,95 +33,115 @@ when it is block buffered many characters are saved up and written as a block;
 when it is line buffered characters are saved up until a newline is
 output or input is read from any stream attached to a terminal device
 (typically stdin).
 when it is line buffered characters are saved up until a newline is
 output or input is read from any stream attached to a terminal device
 (typically stdin).
-.I Fflush
-(see 
-.IR fclose (3))
+The function
+.Xr fflush 3
 may be used to force the block out early.
 may be used to force the block out early.
+(See 
+.Xr fclose 3 . )
 Normally all files are block buffered.
 Normally all files are block buffered.
-A buffer is obtained from
-.IR malloc (3)
-upon the first read or write operation on the file.
+When the first
+.Tn I/O
+operation occurs on a file,
+.Xr malloc 3
+is called,
+and a buffer is obtained.
 If a stream refers to a terminal
 (as
 If a stream refers to a terminal
 (as
-.B stdout
+.Em stdout
 normally does) it is line buffered.
 normally does) it is line buffered.
-The standard stream
-.B stderr
+The standard error stream
+.Em stderr
 is always unbuffered.
 is always unbuffered.
-.PP
-.I Setvbuf
+.Pp
+The
+.Fn setvbuf
+function
 may be used at any time on any open stream
 to change its buffer.
 The
 may be used at any time on any open stream
 to change its buffer.
 The
-.I mode
+.Fa mode
 parameter must be one of the following three macros:
 parameter must be one of the following three macros:
-.RS
-.TP 8
-.B _IONBF
+.Bl -tag -width _IOFBF -offset indent
+.It Dv _IONBF
 unbuffered
 unbuffered
-.br
-.ns
-.TP 8
-.B _IOLBF
+.It Dv _IOLBF
 line buffered
 line buffered
-.br
-.ns
-.TP 8
-.B _IOFBF
+.It Dv _IOFBF
 fully buffered
 fully buffered
-.RE
-.LP
+.El
+.Pp
 Except for unbuffered files, the 
 Except for unbuffered files, the 
-.I buf
+.Fa buf
 argument should point to a buffer at least
 argument should point to a buffer at least
-.I size
+.Fa size
 bytes long;
 this buffer will be used instead of the current buffer.
 bytes long;
 this buffer will be used instead of the current buffer.
-If
-.I buf
+If the argument
+.Fa buf
 is NULL,
 only the mode is affected;
 a new buffer will be allocated on the next read or write operation.
 is NULL,
 only the mode is affected;
 a new buffer will be allocated on the next read or write operation.
-.I Setvbuf
+The
+.Fn setvbuf
+function
 may be used at any time,
 but can only change the mode of a stream
 when it is not ``active'':
 may be used at any time,
 but can only change the mode of a stream
 when it is not ``active'':
-that is, before any I/O,
+that is, before any
+.Tn I/O ,
 or immediately after a call to
 or immediately after a call to
-.IR fflush .
-.PP
+.Xr fflush .
+.Pp
 The other three calls are, in effect, simply aliases
 for calls to
 The other three calls are, in effect, simply aliases
 for calls to
-.IR setvbuf .
-.I Setbuf
+.Fn setvbuf .
+The
+.Fn setbuf
+function
 is exactly equivalent to the call
 is exactly equivalent to the call
-.sp
-.ti +0.5i
-setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
-.sp
-.I Setbuffer
+.Pp
+.Dl setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
+.Pp
+The
+.Fn setbuffer
+function
 is the same, except that the size of the buffer is up to the caller,
 is the same, except that the size of the buffer is up to the caller,
-rather than being determined by the manifest constant
-.SM
-.BR BUFSIZ .
-.I Setlinebuf
-is exactly equivalent to the call
-.sp
-.ti +0.5i
-setvbuf(stream, (char *)NULL, _IOLBF, 0);
-.SH "SEE ALSO"
-fopen(3), fclose(3), fread(3), malloc(3), puts(3), printf(3)
-.SH STANDARDS
-.I Setbuf  
+rather than being determined by the default
+.Dv BUFSIZ .
+The
+.Fn setlinebuf
+function
+is exactly equivalent to the call:
+.Pp
+.Dl setvbuf(stream, (char *)NULL, _IOLBF, 0);
+.Sh SEE ALSO
+.Xr fopen 3 ,
+.Xr fclose 3 ,
+.Xr fread 3 ,
+.Xr malloc 3 ,
+.Xr puts 3 ,
+.Xr printf 3
+.Sh STANDARDS
+The
+.Fn setbuf
 and
 and
-.I setvbuf
-conform to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Fn setvbuf
+functions
+conform to
+.St -ansiC .
+.Sh BUGS
 The
 The
-.I setbuffer
+.Fn setbuffer
+and
+.Fn setlinebuf
+functions are not portable to versions of
+.Bx
+before
+.Bx 4.2 .
+On
+.Bx 4.2
 and
 and
-.I setlinebuf
-functions are not portable to versions of BSD UNIX before 4.2BSD.
-On 4.2BSD and 4.3BSD systems,
-.I setbuf
+.Bx 4.3
+systems,
+.Fn setbuf
 always uses a suboptimal buffer size and should be avoided.
 always uses a suboptimal buffer size and should be avoided.
index a272eaa..4d0e02b 100644 (file)
-.\" Copyright (c) 1988 The Regents of the University of California.
+.\" Copyright (c) 1988, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)tmpnam.3    5.11 (Berkeley) %G%
+.\"     @(#)tmpnam.3   5.13 (Berkeley) %G%
 .\"
 .\"
-.TH TMPFILE 3 ""
-.UC 7
-.SH NAME
-tempnam, tmpfile, tmpnam \- temporary file routines
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-FILE *
-tmpfile(void);
-
-char *
-tmpnam(char *str);
-
-char *
-tempnam(const char *tmpdir, const char *prefix);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Tmpfile
+.Dd 
+.Dt TMPFILE 3
+.Os
+.Sh NAME
+.Nm tempnam ,
+.Nm tmpfile ,
+.Nm tmpnam
+.Nd temporary file routines
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft FILE *
+.Fn tmpfile void
+.Ft char *
+.Fn tmpnam "char *str"
+.Ft char *
+.Fn tempnam "const char *tmpdir" "const char *prefix"
+.Sh DESCRIPTION
+The
+.Fn tmpfile
+function
 returns a pointer to a stream associated with a file descriptor returned
 by the routine
 returns a pointer to a stream associated with a file descriptor returned
 by the routine
-.IR mkstemp (3).
+.Xr mkstemp 3 .
 The created file is unlinked before
 The created file is unlinked before
-.I tmpfile
+.Fn tmpfile
 returns, causing the file to be automatically deleted when the last
 reference to it is closed.
 returns, causing the file to be automatically deleted when the last
 reference to it is closed.
-The file is opened with the access value ``w+''.
-.PP
-.I Tmpnam
-returns a pointer to a file name, in the ``P_tmpdir'' directory, which
+The file is opened with the access value
+.Ql w+ .
+.Pp
+The
+.Fn tmpnam
+function
+returns a pointer to a file name, in the
+.Dv P_tmpdir
+directory, which
 did not reference an existing file at some indeterminate point in the
 past.
 did not reference an existing file at some indeterminate point in the
 past.
-P_tmpdir is defined in the include file <stdio.h>.
+.Dv P_tmpdir
+is defined in the include file
+.Aq Pa stdio.h .
 If the argument
 If the argument
-.I s
-is non-NULL, the file name is copied to the buffer it references.
+.Fa s
+is
+.Pf non- Dv NULL ,
+the file name is copied to the buffer it references.
 Otherwise, the file name is copied to a static buffer.
 In either case,
 Otherwise, the file name is copied to a static buffer.
 In either case,
-.I tmpnam
+.Fn tmpnam
 returns a pointer to the file name.
 returns a pointer to the file name.
-.PP
+.Pp
 The buffer referenced by 
 The buffer referenced by 
-.I s
-is expected to be at least ``L_tmpnam'' bytes in length.
-L_tmpnam is defined in the include file <stdio.h>.
-.PP
-.I Tempnam
+.Fa s
+is expected to be at least
+.Dv L_tmpnam
+bytes in length.
+.Dv L_tmpnam
+is defined in the include file
+.Aq Pa stdio.h .
+.Pp
+The
+.Fn tempnam
+function
 is similar to
 is similar to
-.I tmpnam,
+.Fn tmpnam ,
 but provides the ability to specify the directory which will
 contain the temporary file and the file name prefix.
 but provides the ability to specify the directory which will
 contain the temporary file and the file name prefix.
-.PP
-The environmental variable ``TMPDIR'' (if set), the argument
-.I dir
-(if non-NULL), the directory P_tmpdir, and the directory ``/tmp''
+.Pp
+The environment variable
+.Ev TMPDIR
+(if set), the argument
+.Fa dir
+(if
+.Pf non- Dv NULL ) ,
+the directory
+.Dv P_tmpdir ,
+and the directory
+.Pa /tmp
 are tried, in the listed order, as directories in which to store the
 temporary file.
 are tried, in the listed order, as directories in which to store the
 temporary file.
-.PP
+.Pp
 The argument
 The argument
-.IR prefix ,
-if non-NULL, is used to specify a file name prefix, which will be the
+.Fa prefix ,
+if
+.Pf non- Dv NULL ,
+is used to specify a file name prefix, which will be the
 first part of the created file name.
 first part of the created file name.
-.I Tempnam
+.Fn Tempnam
 allocates memory in which to store the file name; the returned pointer
 may be used as a subsequent argument to
 allocates memory in which to store the file name; the returned pointer
 may be used as a subsequent argument to
-.IR free (3).
-.SH "RETURN VALUES"
-.I Tmpfile
-returns a pointer to an open file stream on success, and a NULL pointer
+.Xr free 3 .
+.Sh RETURN VALUES
+The
+.Fn tmpfile
+function
+returns a pointer to an open file stream on success, and a
+.Dv NULL
+pointer
 on error.
 on error.
-.PP
-.I Tmpnam
+.Pp
+The
+.Fn tmpnam
 and
 and
-.I tempfile
-return a pointer to a file name on success, and a NULL pointer
+.Fn tempfile
+functions
+return a pointer to a file name on success, and a
+.Dv NULL
+pointer
 on error.
 on error.
-.SH ERRORS
-.I Tmpfile
-may fail and set
-.I errno
+.Sh ERRORS
+The
+.Fn tmpfile
+function
+may fail and set the global variable
+.Va errno
 for any of the errors specified for the library functions
 for any of the errors specified for the library functions
-.IR fdopen (3)
+.Xr fdopen 3
 or
 or
-.IR mkstemp (3).
-.PP
-.I Tmpnam
+.Xr mkstemp 3 .
+.Pp
+The
+.Fn tmpnam
+function
 may fail and set
 may fail and set
-.I errno
+.Va errno
 for any of the errors specified for the library function
 for any of the errors specified for the library function
-.IR mktemp (3).
-.PP
-.I Tempnam
+.Xr mktemp 3 .
+.Pp
+The
+.Fn tempnam
+function
 may fail and set
 may fail and set
-.I errno
+.Va errno
 for any of the errors specified for the library functions
 for any of the errors specified for the library functions
-.IR malloc (3)
+.Xr malloc 3
 or
 or
-.IR mktemp (3).
-.SH BUGS
-These interfaces are provided for System V and ANSI compatibility only.
+.Xr mktemp 3 .
+.Sh SEE ALSO
+.Xr mkstemp 3 ,
+.Xr mktemp 3
+.Sh STANDARDS
 The
 The
-.IR mkstemp (3)
+.Fn tmpfile
+and
+.Fn tmpnam
+functions
+conform to
+.St -ansiC .
+.Sh BUGS
+These interfaces are provided for System V and
+.Tn ANSI
+compatibility only.
+The
+.Xr mkstemp 3
 interface is strongly preferred.
 interface is strongly preferred.
-.PP
+.Pp
 There are four important problems with these interfaces (as well as
 with the historic
 There are four important problems with these interfaces (as well as
 with the historic
-.IR mktemp (3)
+.Xr mktemp 3
 interface).
 First, there is an obvious race between file name selection and file
 creation and deletion.
 interface).
 First, there is an obvious race between file name selection and file
 creation and deletion.
@@ -121,26 +171,19 @@ Second, most historic implementations provide only a limited number
 of possible temporary file names (usually 26) before file names will
 start being recycled.
 Third, the System V implementations of these functions (and of
 of possible temporary file names (usually 26) before file names will
 start being recycled.
 Third, the System V implementations of these functions (and of
-.IR mktemp )
+.Xr mktemp )
 use the
 use the
-.IR access (2)
+.Xr access 2
 function to determine whether or not the temporary file may be created.
 This has obvious ramifications for setuid or setgid programs, complicating
 the portable use of these interfaces in such programs.
 Finally, there is no specification of the permissions with which the
 temporary files are created.
 function to determine whether or not the temporary file may be created.
 This has obvious ramifications for setuid or setgid programs, complicating
 the portable use of these interfaces in such programs.
 Finally, there is no specification of the permissions with which the
 temporary files are created.
-.PP
+.Pp
 This implementation does not have these flaws, but portable software
 cannot depend on that.
 In particular, the
 This implementation does not have these flaws, but portable software
 cannot depend on that.
 In particular, the
-.I tmpfile
+.Fn tmpfile
 interface should not be used in software expected to be used on other systems
 if there is any possibility that the user does not wish the temporary file to
 be publicly readable and writable.
 interface should not be used in software expected to be used on other systems
 if there is any possibility that the user does not wish the temporary file to
 be publicly readable and writable.
-.SH STANDARDS
-.I Tmpfile
-and
-.I tmpnam
-conform to ANSI X3.159-1989 (``ANSI C'').
-.SH SEE ALSO
-mkstemp(3), mktemp(3)
index 690ecc9..b2d1320 100644 (file)
@@ -1,55 +1,67 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ungetc.3    6.3 (Berkeley) %G%
+.\"     @(#)ungetc.3   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH UNGETC 3 ""
-.UC 7
-.SH NAME
-ungetc \- push character back into input stream
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdio.h>
-
-int
-ungetc(int c, FILE *stream);
-.fr R
-.fi
-.SH DESCRIPTION
-.I Ungetc
-pushes the integer
-.I c
-(converted to an ``unsigned char'') back on an input stream, so that
-the next
-.I getc
-call on that stream will return
-.IR c .
-.I Ungetc 
-returns 
-.IR c .
-.PP
-One character of pushback is always guaranteed, but as long as there is
+.Dd 
+.Dt UNGETC 3
+.Os
+.Sh NAME
+.Nm ungetc
+.Nd un-get character from input stream
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn ungetc "int c" "FILE *stream"
+.Sh DESCRIPTION
+The
+.Fn ungetc
+function pushes the character
+.Fa c
+(converted to an unsigned char)
+back onto the input stream pointed to by
+.Fa stream .
+The pushed-backed characters will be returned by subsequent reads on the
+stream (in reverse order).
+A successful intervening call, using the same stream, to one of the file
+positioning functions
+.Po
+.Xr fseek 3 ,
+.Xr fsetpos 3 ,
+or
+.Xr rewind 3
+.Pc
+will discard the pushed back characters.
+.Pp
+One character of push-back is guaranteed,
+but as long as there is
 sufficient memory, an effectively infinite amount of pushback is allowed.
 sufficient memory, an effectively infinite amount of pushback is allowed.
-Attempts to push
-.B EOF
-are rejected.
-.PP
-A successful call to
-.I fseek
-erases all memory of pushed back characters.
-.SH "SEE ALSO"
-getc(3), fseek(3), setvbuf(3)
-.SH "RETURN VALUE"
-.I Ungetc
+.Pp
+If a character is successfully pushed-back,
+the end-of-file indicator for the stream is cleared.
+.Sh RETURN VALUES
+The
+.Fn ungetc
+function
 returns
 returns
-.SM
-.B EOF
-if it cannot push back the given character for any reason
-(this includes attempts to push
-.BR EOF ).
+the character pushed-back after the conversion, or
+.Dv EOF
+if the operation fails.
+If the value of the argument
+.Fa c
+character equals
+.Dv EOF ,
+the operation will fail and the stream will remain unchanged.
+.Sh SEE ALSO
+.Xr getc 3 ,
+.Xr fseek 3 ,
+.Xr setvbuf 3
+.Sh STANDARDS
+The
+.Fn ungetc
+function conforms to
+.St -ansiC .
index 62ff4ff..18a099d 100644 (file)
@@ -1,32 +1,40 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)abort.3     6.5 (Berkeley) %G%
+.\"     @(#)abort.3    6.6 (Berkeley) %G%
 .\"
 .\"
-.TH ABORT 3 ""
-.AT 3
-.SH NAME
-abort \- cause abnormal program termination
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-void
-abort(void);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt ABORT 3
+.Os
+.Sh NAME
+.Nm abort
+.Nd cause abnormal program termination
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft void
+.Fn abort void
+.Sh DESCRIPTION
 The
 The
-.I abort
+.Fn abort
 function causes abnormal program termination to occur, unless the
 function causes abnormal program termination to occur, unless the
-signal SIGABRT is being caught and the signal handler does not return.
-.PP
+signal
+.Dv SIGABRT
+is being caught and the signal handler does not return.
+.Pp
 No open streams are closed or flushed.
 No open streams are closed or flushed.
-.SH SEE ALSO
-sigvec(2), exit(2)
-.SH STANDARDS
-.B Abort
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh RETURN VALUES
+The
+.Nm abort
+function
+never returns.
+.Sh SEE ALSO
+.Xr sigaction 2 ,
+.Xr exit 2
+.Sh STANDARDS
+The
+.Fn abort
+function
+conforms to
+.St -ansiC .
index 59a98a4..b60f5ea 100644 (file)
@@ -1,31 +1,43 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)abs.3       6.2 (Berkeley) %G%
+.\"     @(#)abs.3      6.3 (Berkeley) %G%
 .\"
 .\"
-.TH ABS 3 ""
-.UC 7
-.SH NAME
-abs \- return the absolute value of an integer
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-int
-abs(int j);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Abs
-returns the absolute value of the integer
-.IR n .
-.SH SEE ALSO
-floor(3), labs(3)
-.SH STANDARDS
-.B Abs
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Dd 
+.Dt ABS 3
+.Os
+.Sh NAME
+.Nm abs
+.Nd integer absolute value function
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft int
+.Fn abs "int j"
+.Sh DESCRIPTION
+The
+.Fn abs
+function
+computes
+the absolute value of the integer
+.Ar j .
+.Sh RETURN VALUES
+The
+.Fn abs
+function
+returns
+the absolute value.
+.Sh SEE ALSO
+.Xr floor 3 ,
+.Xr labs 3
+.Xr cabs 3
+.Xr hypot 3
+.Xr math 3
+.Sh STANDARDS
+The
+.Fn abs
+function conforms to
+.St -ansiC .
+.Sh BUGS
 The absolute value of the most negative integer remains negative.
 The absolute value of the most negative integer remains negative.
index 20e65c7..4bd2449 100644 (file)
@@ -1,43 +1,49 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)atexit.3    5.1 (Berkeley) %G%
+.\"     @(#)atexit.3   5.2 (Berkeley) %G%
 .\"
 .\"
-.TH ATEXIT 3 ""
-.UC 7
-.SH NAME
-atexit \- register a function to be called on exit
-.SH SYNOPSIS
-.B #include <stdlib.h>
-.PP
-.B "atexit(void (*function)())
-.SH DESCRIPTION
-.B Atexit
+.Dd 
+.Dt ATEXIT 3
+.Os
+.Sh NAME
+.Nm atexit
+.Nd register a function to be called on exit
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft int
+.Fn atexit "void (*function)(void)"
+.Sh DESCRIPTION
+The
+.Fn atexit
+function
 registers the given
 registers the given
-.I function
+.Ar function
 to be called at program exit, whether via
 to be called at program exit, whether via
-.IR exit (3)
+.Xr exit 3
 or via return from the program's
 or via return from the program's
-.BR main .
+.Em main .
 Functions so registered are called in reverse order;
 no arguments are passed.
 At least 32 functions can always be registered,
 and more are allowed as long as sufficient memory can be allocated.
 Functions so registered are called in reverse order;
 no arguments are passed.
 At least 32 functions can always be registered,
 and more are allowed as long as sufficient memory can be allocated.
-.SH RETURN VALUE
-.B Atexit
-returns 0 on success, \-1 on error.
-.SH ERRORS
-.TP
-[ENOMEM]
+.Sh RETURN VALUES
+.Rv -std atexit
+.Sh ERRORS
+.Bl -tag -width [ENOMEM]
+.It Bq Er ENOMEM
 No memory was available to add the function to the list.
 The existing list of functions is unmodified.
 No memory was available to add the function to the list.
 The existing list of functions is unmodified.
-.SH SEE ALSO
-exit(3)
-.SH STANDARDS
-.B Atexit
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.El
+.Sh SEE ALSO
+.Xr exit 3
+.Sh STANDARDS
+The
+.Fn atexit
+function
+conforms to
+.St -ansiC .
index 7618900..daccde3 100644 (file)
@@ -1,53 +1,57 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)atof.3      6.2 (Berkeley) %G%
+.\"     @(#)atof.3     6.3 (Berkeley) %G%
 .\"
 .\"
-.TH ATOF 3 ""
-.UC 7
-.SH NAME
-atof \- convert ASCII string to double
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-double
-atof(const char *nptr);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt ATOF 3
+.Os
+.Sh NAME
+.Nm atof
+.Nd convert
+.Tn ASCII
+string to double
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft double
+.Fn atof "const char *nptr"
+.Sh DESCRIPTION
 The
 The
-.I atof
+.Fn atof
 function converts the initial portion of the string pointed to by
 function converts the initial portion of the string pointed to by
-.I nptr
+.Ar nptr
 to
 to
-.I double
+.Ar double
 representation.
 representation.
-.PP
+.Pp
 It is equivalent to:
 It is equivalent to:
-.sp
-.RS
+.Bd -literal -offset indent
 strtod(nptr, (char **)NULL);
 strtod(nptr, (char **)NULL);
-.RE
-.SH SEE ALSO
-atoi(3), atol(3), strtod(3), strtol(3), strtoul(3)
-.SH STANDARDS
-.B Atof
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Ed
+.Sh SEE ALSO
+.Xr atoi 3 ,
+.Xr atol 3 ,
+.Xr strtod 3 ,
+.Xr strtol 3 ,
+.Xr strtoul 3
+.Sh STANDARDS
+The
+.Fn atof
+function conforms to
+.St -ansiC .
+.Sh BUGS
 This manual page represents intent instead of actual practice.
 While it is intended that
 This manual page represents intent instead of actual practice.
 While it is intended that
-.I atof
+.Fn atof
 be implemented using
 be implemented using
-.IR strtod (3),
+.Xr strtod 3 ,
 this has not yet happened.
 In the current system,
 this has not yet happened.
 In the current system,
-.I atof
-translates a string in the following form to a double:
-an optional string of spaces, followed by an optional sign (``+'' or ``-''),
-followed by a string of digits which may contain a decimal point (``.''),
-followed by an optional exponent flag (``E'' or ``e''), followed by an
-optionally signed integer.
+.Fn atof
+translates a string in the following form to a double: a string of
+leading white space, possibly followed by a sign (``+'' or ``-''),
+followed by a digit string which may contain one decimal point (``.''),
+which may be followed by either of the exponent flags (``E'' or ``e''),
+and lastly, followed by a signed or unsigned integer.
index d4369cd..7b007a5 100644 (file)
@@ -1,39 +1,44 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)atoi.3      5.1 (Berkeley) %G%
+.\"     @(#)atoi.3     5.2 (Berkeley) %G%
 .\"
 .\"
-.TH ATOI 3 ""
-.UC 7
-.SH NAME
-atoi \- convert ASCII string to integer
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-int
-atoi(const char *nptr);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt ATOI 3
+.Os
+.Sh NAME
+.Nm atoi
+.Nd convert
+.Tn ASCII
+string to integer
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft int
+.Fn atoi "const char *nptr"
+.Sh DESCRIPTION
 The
 The
-.I atoi
+.Fn atoi
 function converts the initial portion of the string pointed to by
 function converts the initial portion of the string pointed to by
-.I nptr
+.Em nptr
 to
 to
-.I integer
+.Em integer
 representation.
 representation.
-.PP
+.Pp
 It is equivalent to:
 It is equivalent to:
-.sp
-.RS
+.Pp
+.Bd -literal -offset indent
 (int)strtol(nptr, (char **)NULL, 10);
 (int)strtol(nptr, (char **)NULL, 10);
-.RE
-.SH SEE ALSO
-atof(3), atol(3), strtod(3), strtol(3), strtoul(3)
-.SH STANDARDS
-.B Atoi
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Ed
+.Sh SEE ALSO
+.Xr atof 3 ,
+.Xr atol 3 ,
+.Xr strtod 3 ,
+.Xr strtol 3 ,
+.Xr strtoul 3
+.Sh STANDARDS
+The
+.Fn atoi
+function conforms to
+.St -ansiC .
index 6174f63..9287f08 100644 (file)
@@ -1,39 +1,44 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)atol.3      5.1 (Berkeley) %G%
+.\"     @(#)atol.3     5.2 (Berkeley) %G%
 .\"
 .\"
-.TH ATOL 3 ""
-.UC 7
-.SH NAME
-atol \- convert ASCII string to long integer
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-long
-atol(const char *nptr);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt ATOL 3
+.Os
+.Sh NAME
+.Nm atol
+.Nd convert
+.Tn ASCII
+string to long integer
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft long
+.Fn atol "const char *nptr"
+.Sh DESCRIPTION
 The
 The
-.I atol
+.Fn atol
 function converts the initial portion of the string pointed to by
 function converts the initial portion of the string pointed to by
-.I nptr
+.Ar nptr
 to
 to
-.I long integer
+.Em long integer
 representation.
 representation.
-.PP
+.Pp
 It is equivalent to:
 It is equivalent to:
-.sp
-.RS
+.Bd -literal -offset indent
 strtol(nptr, (char **)NULL, 10);
 strtol(nptr, (char **)NULL, 10);
-.RE
-.SH SEE ALSO
-atof(3), atoi(3), strtod(3), strtol(3), strtoul(3)
-.SH STANDARDS
-.B Atol
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Ed
+.Sh SEE ALSO
+.Xr atof 3 ,
+.Xr atoi 3 ,
+.Xr strtod 3 ,
+.Xr strtol 3 ,
+.Xr strtoul 3
+.Sh STANDARDS
+The
+.Fn atol
+function
+conforms to
+.St -ansiC .
index 5ffa951..a1aa429 100644 (file)
@@ -1,57 +1,60 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bsearch.3   5.3 (Berkeley) %G%
+.\"     @(#)bsearch.3  5.4 (Berkeley) %G%
 .\"
 .\"
-.TH BSEARCH 3 ""
-.UC 7
-.SH NAME
-bsearch - binary search of a sorted table
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-.sp
-char *
-bsearch(const void *key, const void *base,
-size_t nmemb, size_t size,
-int (*compar) (const void *, const void *));
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt BSEARCH 3
+.Os
+.Sh NAME
+.Nm bsearch
+.Nd binary search of a sorted table
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft void *
+.Fn bsearch "const void *key" "const void *base" "size_t nmemb" "size_t size" "int (*compar) (const void *, const void *)"
+.Sh DESCRIPTION
 The
 The
-.I bsearch
+.Fn bsearch
 function searches an array of
 function searches an array of
-.I nmemb
+.Fa nmemb
 objects, the inital member of which is 
 pointed to by
 objects, the inital member of which is 
 pointed to by
-.IR base ,
+.Fa base ,
 for a member that matches the object pointed to by
 for a member that matches the object pointed to by
-.IR key .
+.Fa key .
 The size of each member of the array is specified by 
 The size of each member of the array is specified by 
-.I size .
-.PP
+.Fa size .
+.Pp
 The contents of the array should be in ascending sorted order according
 to the comparison function referenced by
 The contents of the array should be in ascending sorted order according
 to the comparison function referenced by
-.IR compar .
-.I Compar
-is called with two arguments that point to the
-.I key
-object and to an array member, in that order, and must return an integer
+.Fa compar .
+The
+.Fa compar
+routine
+is expected to have two
+two arguments which point to the
+.Fa key
+object and to an array member, in that order, and should return an integer
 less than, equal to, or greater than zero if the
 less than, equal to, or greater than zero if the
-.I key
-object is considered, respectively, to be less than, equal to, or to
+.Fa key
+object is found, respectively, to be less than, to match, or be
 greater than the array member.
 greater than the array member.
-.PP
+.Sh RETURN VALUES
 The
 The
-.I bsearch
+.Fn bsearch
 function returns a pointer to a matching member of the array, or a null
 pointer if no match is found.
 If two members compare as equal, which member is matched is unspecified.
 function returns a pointer to a matching member of the array, or a null
 pointer if no match is found.
 If two members compare as equal, which member is matched is unspecified.
-.SH "SEE ALSO"
-db(3), lsearch(3), qsort(3)
-.SH STANDARDS
-.B Bsearch
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr hsearch 3 ,
+.Xr lsearch 3 ,
+.Xr qsort 3 ,
+.\" .Xr tsearch 3
+.Sh STANDARDS
+The
+.Fn bsearch
+function conforms to
+.St -ansiC .
index 9fb2f1d..178227a 100644 (file)
@@ -1,40 +1,41 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)div.3       5.1 (Berkeley) %G%
+.\"     @(#)div.3      5.2 (Berkeley) %G%
 .\"
 .\"
-.TH DIV 3 ""
-.UC 7
-.SH NAME
-div \- return quotient and remainder from division
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-div_t
-div(int num, int denom);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Div
+.Dd 
+.Dt DIV 3
+.Os
+.Sh NAME
+.Nm div
+.Nd return quotient and remainder from division
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft div_t
+.Fn div "int num" "int denom"
+.Sh DESCRIPTION
+The
+.Fn div
+function
 computes the value
 computes the value
-.I num/denom
+.Fa num/denom
 and returns the quotient and remainder in a structure named
 and returns the quotient and remainder in a structure named
-.B div_t
+.Fa div_t
 that contains two
 that contains two
-.BR int
+.Em int
 members named
 members named
-.B quot
+.Fa quot
 and
 and
-.BR rem .
-.SH SEE ALSO
-ldiv(3)
-.SH STANDARDS
-.B Div
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Fa rem .
+.Sh SEE ALSO
+.Xr ldiv 3
+.Sh STANDARDS
+The
+.Fn div
+function
+conforms to
+.St -ansiC .
index 1df5c3a..2884d5e 100644 (file)
@@ -1,48 +1,53 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)exit.3      6.4 (Berkeley) %G%
+.\"     @(#)exit.3     6.5 (Berkeley) %G%
 .\"
 .\"
-.TH EXIT 3 ""
-.UC 5
-.SH NAME
-exit \- perform normal program termination
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-void
-exit(status)
-int status;
-.fi
-.SH DESCRIPTION
-.I Exit
+.Dd 
+.Dt EXIT 3
+.Os
+.Sh NAME
+.Nm exit
+.Nd perform normal program termination
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft void
+.Fn exit "int status"
+.Sh DESCRIPTION
+.Fn Exit
 terminates a process.
 terminates a process.
-.PP
+.Pp
 Before termination it performs the following functions in the
 order listed:
 Before termination it performs the following functions in the
 order listed:
-.RS
-.PP
+.Bl -enum -offset indent
+.It
 Call the functions registered with the
 Call the functions registered with the
-.IR atexit (3)
+.Xr atexit 3
 function, in the reverse order of their registration.
 function, in the reverse order of their registration.
-.PP
+.It
 Flush all open output streams.
 Flush all open output streams.
-.PP
+.It
 Close all open streams.
 Close all open streams.
-.PP
+.It
 Unlink all files created with the
 Unlink all files created with the
-.IR tmpfile (3)
+.Xr tmpfile 3
 function.
 function.
-.RE
-.PP
-.I Exit
+.El
+.Sh RETURN VALUES
+The
+.Fn exit
+function
 never returns.
 never returns.
-.SH "SEE ALSO"
-exit(2), atexit(3), intro(3), tmpfile(3)
-.SH STANDARDS
-.B Exit
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr _exit 2 ,
+.Xr atexit 3 ,
+.Xr intro 3 ,
+.Xr tmpfile 3
+.Sh STANDARDS
+The
+.Fn exit
+function
+conforms to
+.St -ansiC .
index c542289..49c107b 100644 (file)
-.\" Copyright (c) 1988 The Regents of the University of California.
+.\" Copyright (c) 1988, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getenv.3    6.9 (Berkeley) %G%
+.\"     @(#)getenv.3   6.10 (Berkeley) %G%
 .\"
 .\"
-.TH GETENV 3 ""
-.AT 3
-.SH NAME
-getenv, putenv, setenv, unsetenv \- manipulate environmental variables
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-char *
-getenv(const char *name);
-
-setenv(const char *name, const char *value, int overwrite);
-
-putenv(const char *string);
-
-void
-unsetenv(const char *name);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Getenv
-searches the environment list (see
-.IR environ (7))
-for a string of the form \fIname\fP\fB=\fP\fIvalue\fP and returns
-a pointer to the string
-.I value
-if such a string is present, and a NULL pointer if it is not.
-.PP
-.I Setenv
-searches the environment list as
-.I getenv
-does; if the string
-.I name
-is not found, a string of the form \fIname\fP\fB=\fP\fIvalue\fP is
-added to the environment.
-If it is found, and
-.I overwrite
-is non-zero, its value is changed to
-.IR value .
-.I Setenv
-returns 0 on success and -1 on failure, setting the external variable
-.IR errno .
-.PP
-.I Putenv
-takes an argument of the form ``\fIname\fR=\fIvalue\fR'' and is the
-equivalent of:
-.sp
-.RS
+.Dd 
+.Dt GETENV 3
+.Os
+.Sh NAME
+.Nm getenv ,
+.Nm putenv ,
+.Nm setenv ,
+.Nm unsetenv
+.Nd environment variable functions
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft char *
+.Fn getenv "const char *name"
+.Ft int
+.Fn setenv "const char *name" "const char *value" "int overwrite"
+.Ft int
+.Fn putenv "const char *string"
+.Ft void
+.Fn unsetenv "const char *name"
+.Sh DESCRIPTION
+These functions set, unset and fetch environment variables from the
+host
+.Em environment list .
+For compatibility with differing environment conventions,
+the given arguments
+.Ar name
+and
+.Ar value
+may be appended and prepended, 
+respectively,
+with an equal sign
+.Dq Li \&= .
+.Pp
+The
+.Fn getenv
+function obtains the current value of the environment variable,
+.Ar name .
+If the variable
+.Ar name
+is not in the current environment ,
+a null pointer is returned.
+.Pp
+The
+.Fn setenv
+function inserts or resets the environment variable
+.Ar name
+in the current environment list.
+If the variable
+.Ar name
+does not exist in the list,
+it is inserted with the given
+.Ar value.
+If the variable does exist, the argument
+.Ar overwrite
+is tested; if
+.Ar overwrite is
+zero, the
+variable is not reset, otherwise it is reset
+to the given
+.Ar value .
+.Pp
+The
+.Fn putenv
+function
+performs the equivalent of:
+.Bd -literal -offset indent
 setenv(name, value, 1);
 setenv(name, value, 1);
-.RE
-.PP
-.I Unsetenv
-removes all occurrences of the string
-.I name
-from the environment.
-There is no library provision for completely removing the current
-environment.
-It is suggested that the following code be used to do so.
-.sp
-.RS
-.nf
-static char    *envinit[1];
-extern char    **environ;
-environ = envinit;
-.fi
-.RE
-.PP
-All of these routines permit, but do not require, a trailing equals
-(``='') sign on
-.I name
-or a leading equals sign on
-.IR value .
-.SH ERRORS
-.TP
-[ENOMEM]
-.I Setenv
+.Ed
+.Pp
+The
+.Fn unsetenv
+function
+deletes all instances of the variable name pointed to by
+.Fa name
+from the list.
+.Sh RETURN VALUES
+The functions
+.Fn setenv
+and
+.Fn putenv
+return zero if successful; otherwise the global variable
+.Va errno
+is set to indicate the error and a
+\-1 is returned.
+.Sh ERRORS
+.Bl -tag -width [ENOMEM]
+.It Bq Er ENOMEM
+The function
+.Fn setenv
 or
 or
-.I putenv
+.Fn putenv
 failed because they were unable to allocate memory for the environment.
 failed because they were unable to allocate memory for the environment.
-.SH SEE ALSO
-csh(1), sh(1), execve(2), environ(7)
-.SH STANDARDS
-.B Getenv
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.El
+.Sh SEE ALSO
+.Xr csh 1 ,
+.Xr sh 1 ,
+.Xr execve 2 ,
+.Xr environ 7
+.Sh STANDARDS
+The
+.Fn getenv
+function conforms to
+.St -ansiC .
+.Sh HISTORY
+The functions
+.Fn setenv
+and
+.Fn unsetenv
+appeared in
+.At v7 .
+The
+.Fn putenv
+function appeared in
+.Bx 4.3 Reno .
index 8df4b13..d3e7bb4 100644 (file)
-.\" Copyright (c) 1988 Regents of the University of California.
+.\" Copyright (c) 1988, 1991 Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getopt.3    6.15 (Berkeley) %G%
+.\"     @(#)getopt.3   6.16 (Berkeley) %G%
 .\"
 .\"
-.TH GETOPT 3 ""
-.UC 6
-.SH NAME
-getopt \- get option letter from argv
-.SH SYNOPSIS
-.ft B
-.nf
-int getopt(argc, argv, optstring)
-int argc;
-char **argv;
-char *optstring;
-.sp
-extern char *optarg;
-extern int optind;
-extern int opterr;
-.ft
-.SH DESCRIPTION
-.I Getopt
-returns the next option letter in
-.I argv
-that matches a letter in
-.IR optstring .
-.I Optstring
-is a string of recognized option letters; if a letter is followed by a
-colon, the option is expected to have an argument that may or may not
-be separated from it by white space.
-.PP
+.Dd 
+.Dt GETOPT 3
+.Os BSD 4.3
+.Sh NAME
+.Nm getopt
+.Nd get option letter from argv
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Vt extern char *optarg
+.Vt extern int   optind
+.Vt extern int   opterr
+.Ft int
+.Fn getopt "int argc" "char * const *argv" "const char *optstring"
+.Sh DESCRIPTION
+The
+.Fn getopt
+function gets 
+the next
+.Em known
+option character from
+.Fa argv .
+An option character is
+.Em known
+if it has been specified in the string of accepted option characters,
+.Fa optstring .
+.Pp
+The option string
+.Fa optstring
+may contain the following characters; letters and
+letters followed by a colon to indicate an option argument
+is to follow. It does not matter to
+.Fn getopt
+if a following argument has leading white space.
+.Pp
 On return from
 On return from
-.IR getopt ,
-optarg is set to point to the start of any option argument.
-.I Optind
-contains the
-.I argv
-index of the next argument to be processed.
-.PP
-.I Opterr
+.Fn getopt ,
+.Va optarg
+points to an option argument, if it is anticipated,
+and the variable
+.Va optind
+contains the index to the next
+.Fa argv
+argument for a subsequent call
+to
+.Fn getopt .
+.Pp
+The variable
+.Va opterr
 and
 and
-.I optind
+.Va optind
 are both initialized to 1.
 In order to use
 are both initialized to 1.
 In order to use
-.I getopt
+.Fn getopt
 to evaluate multiple sets of arguments, or to evaluate a single set of
 arguments multiple times,
 to evaluate multiple sets of arguments, or to evaluate a single set of
 arguments multiple times,
-.I optind
+.Va optind
 must be initialized to the number of argv entries to be skipped in each
 evaluation.
 must be initialized to the number of argv entries to be skipped in each
 evaluation.
-.PP
+.Pp
+The
+.Fn getopt
+function
+returns an
+.Dv EOF
+when the argument list is exhausted, or a non-recognized
+option is encountered.
+The interpretation of options in the argument list may be cancelled
+by the option
+.Ql --
+(double dash) which causes
+.Fn getopt
+to signal the end of argument processing and return an
+.Dv EOF . 
 When all options have been processed (i.e., up to the first non-option
 argument),
 When all options have been processed (i.e., up to the first non-option
 argument),
-.I getopt
-returns EOF.
-The special option ``\-\-'' may be used to delimit the end of the options;
-EOF will be returned, and the ``\-\-'' will be skipped.
-.SH DIAGNOSTICS
-.I Getopt
-prints an error message on
-.I stderr
-and returns a question mark (``?'') when it encounters an option
-letter not included in
-.IR optstring ,
-or it encounters an option that requires an argument which is not
-supplied.
+.Fn getopt
+returns
+.Dv EOF .
+.Sh DIAGNOSTICS
+If the
+.Fn getopt
+function encounters a character not found in the string
+.Va optarg
+or detects
+a missing option argument
+it writes error message
+.Ql ?
+to the
+.Em stderr .
 Setting
 Setting
-.I opterr
+.Va opterr
 to a zero will disable these error messages.
 to a zero will disable these error messages.
-.SH EXAMPLE
-.nf
-.in +5
+.Sh EXAMPLE
+.Bd -literal -compact
 extern char *optarg;
 extern int optind;
 int bflag, ch, fd;
 extern char *optarg;
 extern int optind;
 int bflag, ch, fd;
@@ -86,48 +112,60 @@ while ((ch = getopt(argc, argv, "bf:")) != EOF)
        case 'f':
                if ((fd = open(optarg, O_RDONLY, 0)) < 0) {
                        (void)fprintf(stderr,
        case 'f':
                if ((fd = open(optarg, O_RDONLY, 0)) < 0) {
                        (void)fprintf(stderr,
-                           "myname: unable to read file %s.\en", optarg);
-                       exit(1);
+                               "myname: unable to read file %s.\en", optarg);
+                       exit(1) ;
                }
                break;
        case '?':
        default:
                usage();
                }
                break;
        case '?':
        default:
                usage();
-       }
+}
 argc -= optind;
 argv += optind;
 argc -= optind;
 argv += optind;
-.fi
-.SH BUGS
-Option arguments are allowed to begin with ``\-''; this is reasonable but
+.Ed
+.Sh HISTORY
+The
+.Fn getopt
+function appeared
+.Bx 4.3 .
+.Sh BUGS
+Option arguments are allowed to begin with
+.Dq Li \- ;
+this is reasonable but
 reduces the amount of error checking possible.
 reduces the amount of error checking possible.
-.PP
-A single dash (``-'') may be specified as an character in
-.IR optstring ,
+.Pp
+A single dash
+.Dq Li -
+may be specified as an character in
+.Fa optstring ,
 however it should
 however it should
-.B never
+.Em never
 have an argument associated with it.
 This allows
 have an argument associated with it.
 This allows
-.I getopt
-to be used with programs that expect ``-'' as an option flag.
+.Fn getopt
+to be used with programs that expect
+.Dq Li -
+as an option flag.
 This practice is wrong, and should not be used in any current development.
 It is provided for backward compatibility
 This practice is wrong, and should not be used in any current development.
 It is provided for backward compatibility
-.BR only .
+.Em only .
 By default, a single dash causes
 By default, a single dash causes
-.I getopt
-to return EOF.
+.Fn getopt
+to return
+.Dv EOF .
 This is, we believe, compatible with System V.
 This is, we believe, compatible with System V.
-.PP
+.Pp
 It is also possible to handle digits as option letters.
 This allows
 It is also possible to handle digits as option letters.
 This allows
-.I getopt
-to be used with programs that expect a number (``-3'') as an option.
+.Fn getopt
+to be used with programs that expect a number
+.Pq Dq Li \&-\&3
+as an option.
 This practice is wrong, and should not be used in any current development.
 It is provided for backward compatibility
 This practice is wrong, and should not be used in any current development.
 It is provided for backward compatibility
-.BR only .
+.Em only .
 The following code fragment works fairly well.
 The following code fragment works fairly well.
-.sp
-.nf
-.in +5
+.Bd -literal -offset indent
 int length;
 char *p;
 
 int length;
 char *p;
 
@@ -143,4 +181,4 @@ while ((c = getopt(argc, argv, "0123456789")) != EOF)
                break;
        }
 }
                break;
        }
 }
-.fi
+.Ed
index fc044b8..f43bfc0 100644 (file)
@@ -1,59 +1,71 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getsubopt.3 5.2 (Berkeley) %G%
+.\"     @(#)getsubopt.3        5.3 (Berkeley) %G%
 .\"
 .\"
-.TH GETSUBOPT 3 ""
-.UC 7
-.SH NAME
-getsubopt \- get sub options from an argument
-.SH SYNOPSIS
-.nf
-.ft B
-int getsubopt(char **optionp, char * const *tokens, char **valuep);
-
-extern char *suboptarg;
-.SH DESCRIPTION
-.I Getsubopt
+.Dd 
+.Dt GETSUBOPT 3
+.Os
+.Sh NAME
+.Nm getsubopt
+.Nd get sub options from an argument
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn getsubopt "char **optionp" "char * const *tokens" "char **valuep"
+.Sh DESCRIPTION
+The
+.Fn getsubopt
 parses a string containing tokens delimited by one or more tab, space or
 parses a string containing tokens delimited by one or more tab, space or
-comma (``,'') characters.
+comma
+.Pq Ql \&,
+characters.
 It is intended for use in parsing groups of option arguments provided
 as part of a utility command line.
 It is intended for use in parsing groups of option arguments provided
 as part of a utility command line.
-.PP
-.I Optionp
+.Pp
+The argument
+.Fa optionp
 is a pointer to a pointer to the string.
 is a pointer to a pointer to the string.
-.I Tokens
-is a pointer to a NULL-terminated array of pointers to strings.
-.PP
-.I Getsubopt
+The argument
+.Fa tokens
+is a pointer to a
+.Dv NULL Ns -terminated
+array of pointers to strings.
+.Pp
+The
+.Fn getsubopt
+function
 returns the zero-based offset of the pointer in the
 returns the zero-based offset of the pointer in the
-.I tokens
+.Fa tokens
 array referencing a string which matches the first token
 array referencing a string which matches the first token
-in the string, or, -1 if the string contains no tokens or
-.I tokens
+in the string, or, \-1 if the string contains no tokens or
+.Fa tokens
 does not contain a matching string.
 does not contain a matching string.
-.PP
+.Pp
 If the token is of the form ``name=value'', the location referenced by
 If the token is of the form ``name=value'', the location referenced by
-.I valuep
+.Fa valuep
 will be set to point to the start of the ``value'' portion of the token.
 will be set to point to the start of the ``value'' portion of the token.
-.PP
+.Pp
 On return from
 On return from
-.IR getsubopt ,
-.I optionp
+.Fn getsubopt ,
+.Fa optionp
 will be set to point to the start of the next token in the string,
 or the null at the end of the string if no more tokens are present.
 The external variable
 will be set to point to the start of the next token in the string,
 or the null at the end of the string if no more tokens are present.
 The external variable
-.I suboptarg
-will be set to point to the start of the current token, or NULL if no
+.Fa suboptarg
+will be set to point to the start of the current token, or
+.Dv NULL
+if no
 tokens were present.
 tokens were present.
-.I Valuep
-will be set to point to the ``value'' portion of the token, or NULL
+The argument
+.Fa valuep
+will be set to point to the ``value'' portion of the token, or
+.Dv NULL
 if no ``value'' portion was present.
 if no ``value'' portion was present.
-.SH EXAMPLE
-.nf
-.RS
+.Sh EXAMPLE
+.Bd -literal -offset indent -compact
 char *tokens[] = {
        #define ONE     0
                "one",
 char *tokens[] = {
        #define ONE     0
                "one",
@@ -67,7 +79,7 @@ char *tokens[] = {
 extern char *optarg, *suboptarg;
 char *options, *value;
 
 extern char *optarg, *suboptarg;
 char *options, *value;
 
-while ((ch = getopt(argc, argv, "ab:")) != -1) {
+while ((ch = getopt(argc, argv, "ab:")) != \-1) {
        switch(ch) {
        case 'a':
                /* process ``a'' option */
        switch(ch) {
        case 'a':
                /* process ``a'' option */
@@ -85,16 +97,22 @@ while ((ch = getopt(argc, argv, "ab:")) != -1) {
                                        error("no value for two");
                                i = atoi(value);
                                break;
                                        error("no value for two");
                                i = atoi(value);
                                break;
-                       case -1:
+                       case \-1:
                                if (suboptarg)
                                        error("illegal sub option %s",
                                if (suboptarg)
                                        error("illegal sub option %s",
-                                           suboptarg);
+                                         suboptarg);
                                else
                                        error("missing sub option");
                                break;
                }
                break;
        }
                                else
                                        error("missing sub option");
                                break;
                }
                break;
        }
-.fi
-.SH SEE\ ALSO
-getopt(3), strsep(3)
+.Ed
+.Sh SEE ALSO
+.Xr getopt 3 ,
+.Xr strsep 3
+.Sh HISTORY
+The
+.Fn getsubopt
+function is
+.Ud .
index e308079..a029de9 100644 (file)
@@ -1,31 +1,36 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)labs.3      5.1 (Berkeley) %G%
+.\"     @(#)labs.3     5.2 (Berkeley) %G%
 .\"
 .\"
-.TH LABS 3 ""
-.UC 7
-.SH NAME
-labs \- return the absolute value of a long integer
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-long
-labs(long j);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Labs
+.Dd 
+.Dt LABS 3
+.Os
+.Sh NAME
+.Nm labs
+.Nd return the absolute value of a long integer
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft long
+.Fn labs "long j"
+.Sh DESCRIPTION
+The
+.Fn labs
+function
 returns the absolute value of the long integer
 returns the absolute value of the long integer
-.IR n .
-.SH SEE ALSO
-abs(3), floor(3)
-.SH STANDARDS
-.B Labs
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Ar j .
+.Sh SEE ALSO
+.Xr abs 3 ,
+.Xr floor 3 ,
+.Xr cabs 3 ,
+.Xr math 3
+.Sh STANDARDS
+The
+.Fn labs
+function
+conforms to
+.St -ansiC .
+.Sh BUGS
 The absolute value of the most negative integer remains negative.
 The absolute value of the most negative integer remains negative.
index 5779b0d..d9f499c 100644 (file)
@@ -1,40 +1,42 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ldiv.3      5.1 (Berkeley) %G%
+.\"     @(#)ldiv.3     5.2 (Berkeley) %G%
 .\"
 .\"
-.TH LDIV 3 ""
-.UC 7
-.SH NAME
-ldiv \- return quotient and remainder from division
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-ldiv_t
-ldiv(int num, int denom)
-.ft R
-.fi
-.SH DESCRIPTION
-.B Ldiv
+.Dd 
+.Dt LDIV 3
+.Os
+.Sh NAME
+.Nm ldiv
+.Nd return quotient and remainder from division
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft ldiv_t
+.Fn ldiv "int num" "int denom"
+.Sh DESCRIPTION
+The
+.Fn ldiv
+function
 computes the value
 computes the value
-.I num/denom
+.Ar num/denom
 and returns the quotient and remainder in a structure named
 and returns the quotient and remainder in a structure named
-.B ldiv_t
+.Ar ldiv_t
 that contains two
 that contains two
-.B "long integer"
+.Em long integer
 members named
 members named
-.B quot
+.Ar quot
 and
 and
-.BR rem .
-.SH SEE ALSO
-div(3)
-.SH STANDARDS
-.B Ldiv
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Ar rem .
+.Sh SEE ALSO
+.Xr div 3 ,
+.Xr math 3
+.Sh STANDARDS
+The
+.Fn ldiv
+function
+conforms to
+.St -ansiC .
index 268b0e5..eadb58e 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)malloc.3    6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH MALLOC 3  ""
-.UC 4
-.SH NAME
-malloc, free, realloc, calloc, alloca \- memory allocator
-.SH SYNOPSIS
-.nf
-.B char *malloc(size)
-.B unsigned size;
-.PP
-.B free(ptr)
-.B char *ptr;
-.PP
-.B char *realloc(ptr, size)
-.B char *ptr;
-.B unsigned size;
-.PP
-.B char *calloc(nelem, elsize)
-.B unsigned nelem, elsize;
-.PP
-.B char *alloca(size)
-.B int size;
-.fi
-.SH DESCRIPTION
-.I Malloc
-and
-.I free
-provide a general-purpose memory allocation package.
-.I Malloc
-returns a pointer to a block of at least
-.I size
-bytes beginning on a word boundary.
-.PP
-The argument to
-.I free
-is a pointer to a block previously allocated by
-.IR malloc ;
-this space is made available for further allocation,
-but its contents are left undisturbed.
-.PP
-Needless to say, grave disorder will result if the space assigned by
-.I malloc
-is overrun or if some random number is handed to
-.IR free .
-.PP
-.I Malloc
-maintains multiple lists of free blocks according to size,
-allocating space from the appropriate list.
-It calls
-.I sbrk
-(see
-.IR brk (2))
-to get more memory from the system when there is no
-suitable space already free.
-.PP
-.I Realloc
-changes the size of the block pointed to by
-.I ptr
-to
-.I size
-bytes and returns a pointer to the (possibly moved) block.
-The contents will be unchanged up to the lesser of the new and old sizes.
-If
-.I ptr
-is null,
-.I realloc
-simply returns the value of
-.I malloc
-called with an argument of
-.IR size .
-.PP
-In order to be compatible with older versions,
-.I realloc
-also works if
-.I ptr
-points to a block freed since the last call of
-.I malloc, realloc
-or
-.IR calloc ;
-sequences of
-.I free, malloc
-and
-.I realloc
-were previously used to attempt storage compaction.
-This procedure is no longer recommended.
-.PP
-.I Calloc
-allocates space for an array of
-.I nelem
-elements of size
-.I elsize.
-The space is initialized to zeros.
-.PP
-.I Alloca
-allocates 
-.I size
-bytes of space in the stack frame of the caller.
-This temporary space is automatically freed on
-return.
-.PP
-Each of the allocation routines returns a pointer
-to space suitably aligned (after possible pointer coercion)
-for storage of any type of object.
-If the space is of
-.I pagesize
+.\"     @(#)malloc.3   6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt MALLOC 3
+.Os BSD 4
+.Sh NAME
+.Nm malloc ,
+.Nd general memory allocation function
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft void *
+.Fn malloc "size_t size"
+.Sh DESCRIPTION
+The
+.Fn malloc
+function allocates uninitialized space for an object whose
+size is specified by
+.Fa size .
+The
+.Fn malloc
+function maintains multiple lists of free blocks according to size, allocating
+space from the appropriate list.
+.Pp
+The allocated space is
+suitably aligned (after possible pointer
+coercion) for storage of any type of object. If the space is of
+.Em pagesize
 or larger, the memory returned will be page-aligned.
 or larger, the memory returned will be page-aligned.
-.SH SEE ALSO
-brk(2),
-pagesize(2)
-.SH DIAGNOSTICS
-.I Malloc, realloc
-and
-.I calloc
-return a null pointer (0) if there is no available memory or if the arena
-has been detectably corrupted by storing outside the bounds of a block.
-.I Malloc
-may be recompiled to check the arena very stringently on every transaction;
-those sites with a source code license may check the source code to see
-how this can be done.
-.SH BUGS
-When
-.I realloc
-returns 0, the block pointed to by
-.I ptr
-may be destroyed.
-.PP
+.Sh RETURN VALUES
+The
+.Fn malloc
+function returns
+a pointer to the allocated space if successful; otherwise
+a null pointer is returned.
+.Sh SEE ALSO
+.Xr brk 2 ,
+.Xr pagesize 2
+.Xr free 3 ,
+.Xr calloc 3 ,
+.Xr alloca 3 ,
+.Xr realloc 3 ,
+.Xr memory 3
+.Sh STANDARDS
+The
+.Fn malloc
+function conforms to
+.St -ansiC .
+.Sh BUGS
 The current implementation of
 The current implementation of
-.I malloc
+.Xr malloc
 does not always fail gracefully when system
 memory limits are approached.
 It may fail to allocate memory when larger free blocks could be broken
 up, or when limits are exceeded because the size is rounded up.
 It is optimized for sizes that are powers of two.
 does not always fail gracefully when system
 memory limits are approached.
 It may fail to allocate memory when larger free blocks could be broken
 up, or when limits are exceeded because the size is rounded up.
 It is optimized for sizes that are powers of two.
-.PP
-.I Alloca
-is machine dependent; its use is discouraged.
index 132571b..9d78fb5 100644 (file)
@@ -1,78 +1,93 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)qsort.3     6.4 (Berkeley) %G%
+.\"     @(#)qsort.3    6.5 (Berkeley) %G%
 .\"
 .\"
-.TH QSORT 3  ""
-.UC 4
-.SH NAME
-qsort \- quicker sort
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-void
-qsort(void *base, size_t nmemb, size_t size,
-.RS
-.\" have to reset bold font
-.ft B
-int (*compar)(const void *, const void *));
-.RE
-.ft R
-.fi
-.SH DESCRIPTION
-.I Qsort
+.Dd 
+.Dt QSORT 3
+.Os
+.Sh NAME
+.Nm qsort
+.Nd quicker sort
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft void
+.Fn qsort "void *base" "size_t nmemb" "size_t size" "int (*compar)(const void *, const void *)"
+.Sh DESCRIPTION
+The
+.Fn qsort
+function
 is a modified partition-exchange sort, or quicksort.
 is a modified partition-exchange sort, or quicksort.
-.PP
+.Pp
 The
 The
-.I qsort 
+.Fn qsort
 function sorts an array of
 function sorts an array of
-.I nmemb
+.Fa nmemb
 objects, the initial member of which is pointed to by
 objects, the initial member of which is pointed to by
-.IR base .
+.Fa base .
 The size of each object is specified by
 The size of each object is specified by
-.IR size .
-.PP
+.Fa size .
+.Pp
 The contents of the array are sorted in ascending order according to
 a comparison function pointed to by
 The contents of the array are sorted in ascending order according to
 a comparison function pointed to by
-.IR compar ,
+.Fa compar ,
 which is called with two arguments that point to the objects being
 compared.
 which is called with two arguments that point to the objects being
 compared.
-.PP
+.Pp
 The comparison function must return an integer less than, equal to, or
 greater than zero if the first argument is considered to be respectively
 less than, equal to, or greater than the second.
 The comparison function must return an integer less than, equal to, or
 greater than zero if the first argument is considered to be respectively
 less than, equal to, or greater than the second.
-.PP
-.I Qsort
+.Pp
+The
+.Fn qsort
+function
 is
 is
-.B not
+.Em not
 stable, that is, if two members compare as equal, their order in
 the sorted array is undefined.
 stable, that is, if two members compare as equal, their order in
 the sorted array is undefined.
-.PP
-.I Qsort
+.Pp
+The
+.Fn qsort
+function
 is an implementation of C.A.R. Hoare's ``quicksort'' algorithm, a variant
 of partition-exchange sorting; in particular, see D.E. Knuth's Algorithm Q.
 is an implementation of C.A.R. Hoare's ``quicksort'' algorithm, a variant
 of partition-exchange sorting; in particular, see D.E. Knuth's Algorithm Q.
-.I Qsort
+.Fn Qsort
 takes O N lg N average time.
 takes O N lg N average time.
-.SH "RETURN VALUES"
-.I Qsort 
+.Sh RETURN VALUES
+The
+.Fn qsort
+function
 returns no value.
 returns no value.
-.SH COMPATIBILITY
+.Sh COMPATIBILITY
 Previous versions of
 Previous versions of
-.I qsort
+.Fn qsort
 did not permit the comparison routine to itself call
 did not permit the comparison routine to itself call
-.IR qsort (3).
+.Fn qsort 3 .
 This is no longer true.
 This is no longer true.
-.SH "SEE ALSO"
-sort(1), radixsort(3)
-.sp
-Hoare, C.A.R. [1962]. "Quicksort", The Computer Journal, 5:1, pp. 10-15.
-.br
-Knuth, D.E. [1968]. "The Art of Computer Programming Vol. 3: Sorting and
-Searching", pp. 114-123.
-.SH STANDARDS
-.I Qsort
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr sort 1 ,
+.Xr radixsort 3
+.Rs
+.%A Hoare, C.A.R.
+.%D 1962
+.%T "Quicksort"
+.%J "The Computer Journal"
+.%V 5:1
+.%P pp. 10-15
+.Re
+.Rs
+.%A Knuth, D.E.
+.%D 1968
+.%B "The Art of Computer Programming"
+.%V Vol. 3
+.%T "Sorting and Searching"
+.%P pp. 114-123
+.Re
+.Sh STANDARDS
+The
+.Fn qsort
+function
+conforms to
+.St -ansiC .
index 3746084..4b60991 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)radixsort.3 5.4 (Berkeley) %G%
+.\"     @(#)radixsort.3        5.5 (Berkeley) %G%
 .\"
 .\"
-.TH radixsort 3 ""
-.SH NAME
-radixsort \- radix sort
-.SH SYNOPSIS
-.nf
-.ft B
-#include <limits.h>
-#include <stdlib.h>
-
-radixsort(u_char **base, int nmemb, u_char *table, u_char endbyte);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Radixsort
+.Dd 
+.Dt RADIXSORT 3
+.Os
+.Sh NAME
+.Nm radixsort
+.Nd radix sort
+.Sh SYNOPSIS
+.Fd #include <limits.h>
+.Fd #include <stdlib.h>
+.Ft int
+.Fn radixsort "u_char **base" "int nmemb" "u_char *table" "u_char endbyte"
+.Sh DESCRIPTION
+The
+.Fn radixsort
+function
 is a modified radix sort.
 is a modified radix sort.
-.PP
+.Pp
 The
 The
-.I radixsort
+.Fn radixsort
 function sorts an array of
 function sorts an array of
-.I nmemb
+.Fa nmemb
 pointers to byte strings, the initial member of which is referenced
 by
 pointers to byte strings, the initial member of which is referenced
 by
-.IR base .
+.Fa base .
 The byte strings may contain any values; the end of each string
 is denoted by the user-specified value
 The byte strings may contain any values; the end of each string
 is denoted by the user-specified value
-.IR endbyte .
+.Fa endbyte .
 The contents of the array are sorted in ascending order according
 The contents of the array are sorted in ascending order according
-to the ASCII order of the byte strings they reference.
-.PP
+to the
+.Tn ASCII
+order of the byte strings they reference.
+.Pp
 Applications may specify a sort order by providing the
 Applications may specify a sort order by providing the
-.IR table
+.Fa table
 argument.
 argument.
-If non-NULL,
-.I table
-must reference an array of UCHAR_MAX + 1 bytes which contains the sort
+If
+.Pf non- Dv NULL , 
+.Fa table
+must reference an array of
+.Dv UCHAR_MAX
++ 1 bytes which contains the sort
 weight of each possible byte value.
 The end-of-string byte must have a sort weight of 0.
 More than one byte may have the same sort weight.
 weight of each possible byte value.
 The end-of-string byte must have a sort weight of 0.
 More than one byte may have the same sort weight.
-.I Table
+The
+.Fa table
+argument
 is useful for applications which wish to sort different characters
 equally; for example, providing a table with the same weights
 for A-Z as for a-z will result in a case-insensitive sort.
 is useful for applications which wish to sort different characters
 equally; for example, providing a table with the same weights
 for A-Z as for a-z will result in a case-insensitive sort.
-.PP
-.I Radixsort
+.Pp
+The
+.Fn radixsort
+function
 is stable, that is, if two elements compare as equal, their order in
 the sorted array is unchanged.
 is stable, that is, if two elements compare as equal, their order in
 the sorted array is unchanged.
-.PP
-.I Radixsort
+.Pp
+The
+.Fn radixsort
+function
 is a variant of most-significant-byte radix sorting; in particular, see
 D.E. Knuth's Algorithm R and section 5.2.5, exercise 10.
 is a variant of most-significant-byte radix sorting; in particular, see
 D.E. Knuth's Algorithm R and section 5.2.5, exercise 10.
-.I Radixsort
+The
+.Fn radixsort
+function
 takes linear time relative to the number of bytes in the strings.
 takes linear time relative to the number of bytes in the strings.
-.SH SEE ALSO
-sort(1), qsort(3)
-.sp
-Knuth, D.E. [1968]. "The Art of Computer Programming Vol. 3:
-Sorting and Searching", pp. 170-178.
-.br
-Paige, R. [1987]. "Three Partition Refinement Algorithms", 
-SIAM J. Comput. Vol. 16, No. 6.
-.SH "RETURN VALUES"
+.Sh RETURN VALUES
 Upon successful completion 0 is returned.
 Otherwise, \-1 is returned and the global variable 
 Upon successful completion 0 is returned.
 Otherwise, \-1 is returned and the global variable 
-.I errno
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Radixsort
+.Sh ERRORS
+The
+.Fn radixsort
+function
 may fail and set
 may fail and set
-.I errno
+.Va errno
 for any of the errors specified for the library routine
 for any of the errors specified for the library routine
-.IR malloc (3).
-.SH BUGS
-.I Nmemb
-must be less than the maximum integer, INT_MAX.
+.Xr malloc 3 .
+.Sh SEE ALSO
+.Xr sort 1 ,
+.Xr qsort 3
+.Pp
+.Rs
+.%A Knuth, D.E.
+.%D 1968
+.%B "The Art of Computer Programming"
+.%T "Sorting and Searching"
+.%V Vol. 3
+.%P pp. 170-178
+.Re
+.Rs
+.%A Paige, R.
+.%D 1987
+.%T "Three Partition Refinement Algorithms"
+.%J "SIAM J. Comput."
+.%V Vol. 16
+.%N No. 6
+.Re
+.Sh HISTORY
+The
+.Fn radixsort
+function is
+.Ud .
+.Sh BUGS
+The
+.Fa nmemb
+argument
+must be less than the maximum integer,
+.Dv INT_MAX .
index c6ca9e4..a461f19 100644 (file)
@@ -1,50 +1,54 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)rand.3      6.5 (Berkeley) %G%
+.\"     @(#)rand.3     6.6 (Berkeley) %G%
 .\"
 .\"
-.TH RAND 3 ""
-.AT 3
-.SH NAME
-rand, srand \- bad random number generator
-.SH SYNOPSIS
-.nf
-.ft B
-void
-srand(seed)
-unsigned int seed;
-
-rand()
-.fi
-.SH DESCRIPTION
-.ft B
+.Dd 
+.Dt RAND 3
+.Os
+.Sh NAME
+.Nm rand ,
+.Nm srand
+.Nd bad random number generator
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft void
+.Fn srand "unsigned seed"
+.Ft int
+.Fn rand void
+.Sh DESCRIPTION
+.Bf -symbolic
 These interfaces are obsoleted by random(3).
 These interfaces are obsoleted by random(3).
-.ft R
-.PP
+.Ef
+.Pp
 The
 The
-.I rand
+.Fn rand
 function computes a sequence of pseudo-random integers in the range
 of 0 to
 function computes a sequence of pseudo-random integers in the range
 of 0 to
-.I RAND_MAX
-(as defined by the header file <stdlib.h>).
-.PP
+.Dv RAND_MAX
+(as defined by the header file
+.Aq Pa stdlib.h ) .
+.Pp
 The
 The
-.I srand
+.Fn srand
 function sets its argument as the seed for a new sequence of
 pseudo-random numbers to be returned by
 function sets its argument as the seed for a new sequence of
 pseudo-random numbers to be returned by
-.IR rand .
+.Fn rand .
 These sequences are repeatable by calling
 These sequences are repeatable by calling
-.I srand
+.Fn srand
 with the same seed value.
 with the same seed value.
-.PP
+.Pp
 If no seed value is provided, the functions are automatically
 seeded with a value of 1.
 If no seed value is provided, the functions are automatically
 seeded with a value of 1.
-.SH STANDARDS
-.B Rand
+.Sh SEE ALSO
+.Xr random 3
+.Sh STANDARDS
+The
+.Fn rand
 and
 and
-.B srand
-conform to ANSI X3.159-1989 (``ANSI C'').
-.SH "SEE ALSO"
-random(3)
+.Fn srand
+functions
+conform to
+.St -ansiC .
index 23d5bbe..cf888b0 100644 (file)
@@ -1,33 +1,33 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)random.3    6.4 (Berkeley) %G%
+.\"     @(#)random.3   6.5 (Berkeley) %G%
 .\"
 .\"
-.UC 7
-.TH RANDOM 3 ""
-.UC 5
-.SH NAME
-random, srandom, initstate, setstate \- better random number generator; routines for changing generators
-.SH SYNOPSIS
-.nf
-.B long  random()
-.PP
-.B srandom(seed)
-.B int  seed;
-.PP
-.B char  *initstate(seed, state, n)
-.B unsigned  seed;
-.B char  *state;
-.B int  n;
-.PP
-.B char  *setstate(state)
-.B char  *state;
-.fi
-.SH DESCRIPTION
-.PP
-.I Random
+.Dd 
+.Dt RANDOM 3
+.Os BSD 4.2
+.Sh NAME
+.Nm random ,
+.Nm srandom ,
+.Nm initstate ,
+.Nm setstate
+.Nd better random number generator; routines for changing generators
+.Sh SYNOPSIS
+.Fd #include <stdlib>
+.Ft long 
+.Fn random void
+.Ft void
+.Fn srandom "unsigned seed"
+.Ft char *
+.Fn initstate "unsigned seed" "char *state" "int n"
+.Ft char *
+.Fn setstate "char *state"
+.Sh DESCRIPTION
+The
+.Fn random
+function
 uses a non-linear additive feedback random number generator employing a
 default table of size 31 long integers to return successive pseudo-random
 numbers in the range from 0 to
 uses a non-linear additive feedback random number generator employing a
 default table of size 31 long integers to return successive pseudo-random
 numbers in the range from 0 to
@@ -36,95 +36,105 @@ numbers in the range from 0 to
 The period of this random number generator is very large, approximately
 .if t 16\(mu(2\u\s731\s10\d\(mi1).
 .if n 16*((2**31)\(mi1).
 The period of this random number generator is very large, approximately
 .if t 16\(mu(2\u\s731\s10\d\(mi1).
 .if n 16*((2**31)\(mi1).
-.PP
-.I Random/srandom
+.Pp
+The
+.Fn random Ns / Fn srandom
 have (almost) the same calling sequence and initialization properties as
 have (almost) the same calling sequence and initialization properties as
-.I rand/srand.
+.Xr rand 3 Ns / Xr srand 3 .
 The difference is that
 The difference is that
-.IR rand (3)
+.Xr rand
 produces a much less random sequence \(em in fact, the low dozen bits
 generated by rand go through a cyclic pattern.  All the bits generated by
 produces a much less random sequence \(em in fact, the low dozen bits
 generated by rand go through a cyclic pattern.  All the bits generated by
-.I random
-are usable.  For example, ``random()&01'' will produce a random binary
+.Fn random
+are usable.  For example,
+.Sq Li random()&01
+will produce a random binary
 value.
 value.
-.PP
+.Pp
 Unlike
 Unlike
-.IR srand ,
-.I srandom
+.Xr srand ,
+.Fn srandom
 does not return the old seed; the reason for this is that the amount of
 state information used is much more than a single word.  (Two other
 routines are provided to deal with restarting/changing random
 number generators).  Like
 does not return the old seed; the reason for this is that the amount of
 state information used is much more than a single word.  (Two other
 routines are provided to deal with restarting/changing random
 number generators).  Like
-.IR rand (3),
+.Xr rand 3 ,
 however,
 however,
-.I random
+.Fn random
 will by default produce a sequence of numbers that can be duplicated
 by calling
 will by default produce a sequence of numbers that can be duplicated
 by calling
-.I srandom
+.Fn srandom
 with 
 with 
-.I 1
+.Ql 1
 as the seed.
 as the seed.
-.PP
+.Pp
 The
 The
-.I initstate
+.Fn initstate
 routine allows a state array, passed in as an argument, to be initialized
 for future use.  The size of the state array (in bytes) is used by
 routine allows a state array, passed in as an argument, to be initialized
 for future use.  The size of the state array (in bytes) is used by
-.I initstate
-to decide how sophisticated a random number generator it should use -- the
+.Fn initstate
+to decide how sophisticated a random number generator it should use \(em the
 more state, the better the random numbers will be.
 (Current "optimal" values for the amount of state information are
 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to
 more state, the better the random numbers will be.
 (Current "optimal" values for the amount of state information are
 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to
-the nearest known amount.  Using less than 8 bytes will cause an error).
+the nearest known amount.  Using less than 8 bytes will cause an error.)
 The seed for the initialization (which specifies a starting point for
 the random number sequence, and provides for restarting at the same
 point) is also an argument.
 The seed for the initialization (which specifies a starting point for
 the random number sequence, and provides for restarting at the same
 point) is also an argument.
-.I Initstate
+The
+.Fn initstate
+function
 returns a pointer to the previous state information array.
 returns a pointer to the previous state information array.
-.PP
+.Pp
 Once a state has been initialized, the
 Once a state has been initialized, the
-.I setstate
+.Fn setstate
 routine provides for rapid switching between states.
 routine provides for rapid switching between states.
-.I Setstate
+The
+.Fn setstate
+function
 returns a pointer to the previous state array; its
 argument state array is used for further random number generation
 until the next call to
 returns a pointer to the previous state array; its
 argument state array is used for further random number generation
 until the next call to
-.I initstate
+.Fn initstate
 or
 or
-.I setstate.
-.PP
+.Fn setstate .
+.Pp
 Once a state array has been initialized, it may be restarted at a
 different point either by calling
 Once a state array has been initialized, it may be restarted at a
 different point either by calling
-.I initstate
+.Fn initstate
 (with the desired seed, the state array, and its size) or by calling
 both
 (with the desired seed, the state array, and its size) or by calling
 both
-.I setstate
+.Fn setstate
 (with the state array) and
 (with the state array) and
-.I srandom
+.Fn srandom
 (with the desired seed).
 The advantage of calling both
 (with the desired seed).
 The advantage of calling both
-.I setstate
+.Fn setstate
 and
 and
-.I srandom
+.Fn srandom
 is that the size of the state array does not have to be remembered after
 it is initialized.
 is that the size of the state array does not have to be remembered after
 it is initialized.
-.PP
+.Pp
 With 256 bytes of state information, the period of the random number
 generator is greater than
 .if t 2\u\s769\s10\d,
 .if n 2**69
 which should be sufficient for most purposes.
 With 256 bytes of state information, the period of the random number
 generator is greater than
 .if t 2\u\s769\s10\d,
 .if n 2**69
 which should be sufficient for most purposes.
-.SH AUTHOR
+.Sh AUTHOR
 Earl T. Cohen
 Earl T. Cohen
-.SH DIAGNOSTICS
-.PP
+.Sh DIAGNOSTICS
 If
 If
-.I initstate
+.Fn initstate
 is called with less than 8 bytes of state information, or if
 is called with less than 8 bytes of state information, or if
-.I setstate
+.Fn setstate
 detects that the state information has been garbled, error
 messages are printed on the standard error output.
 detects that the state information has been garbled, error
 messages are printed on the standard error output.
-.SH "SEE ALSO"
-rand(3)
-.SH BUGS
+.Sh SEE ALSO
+.Xr rand 3
+.Sh HISTORY
+These
+functions appeared in 
+.Bx 4.2 .
+.Sh BUGS
 About 2/3 the speed of
 About 2/3 the speed of
-.IR rand (3C).
+.Xr rand 3 .
index ee0a2b8..d0dfa03 100644 (file)
@@ -1,80 +1,88 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strtod.3    5.1 (Berkeley) %G%
+.\"     @(#)strtod.3   5.2 (Berkeley) %G%
 .\"
 .\"
-.TH STRTOD 3 ""
-.UC 7
-.SH NAME
-strtod \- convert ASCII string to double
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-double
-strtod(const char *nptr, char **endptr);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt STRTOD 3
+.Os
+.Sh NAME
+.Nm strtod
+.Nd convert
+.Tn ASCII
+string to double
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft double
+.Fn strtod "const char *nptr" "char **endptr"
+.Sh DESCRIPTION
 The
 The
-.I strtod
+.Fn strtod
 function converts the initial portion of the string 
 pointed to by
 function converts the initial portion of the string 
 pointed to by
-.I nptr
+.Fa nptr
 to
 to
-.I double
+.Em double
 representation.
 representation.
-.PP
+.Pp
 The expected form of the string is an optional plus (``+'') or minus
 The expected form of the string is an optional plus (``+'') or minus
-sign (``-''), followed by a sequence of digits optionally containing
+sign (``-'') followed by a sequence of digits optionally containing
 a decimal-point character, optionally followed by an exponent.
 An exponent consists of an ``E'' or ``e'', followed by an optional plus
 or minus sign, followed by a sequence of digits.
 a decimal-point character, optionally followed by an exponent.
 An exponent consists of an ``E'' or ``e'', followed by an optional plus
 or minus sign, followed by a sequence of digits.
-.PP
+.Pp
 Leading white-space characters in the string (as defined by the
 Leading white-space characters in the string (as defined by the
-.IR isspace (3)
+.Xr isspace 3
 function) are skipped.
 function) are skipped.
-.PP
+.Sh RETURN VALUES
 The
 The
-.I strtod
+.Fn strtod
 function returns the converted value, if any.
 function returns the converted value, if any.
-.PP
+.Pp
 If
 If
-.I endptr
-is not NULL, a pointer to the character after the last character used
+.Fa endptr
+is not
+.Dv NULL ,
+a pointer to the character after the last character used
 in the conversion is stored in the location referenced by
 in the conversion is stored in the location referenced by
-.IR endptr .
-.PP
+.Fa endptr .
+.Pp
 If no conversion is performed, zero is returned and the value of
 If no conversion is performed, zero is returned and the value of
-.I nptr
+.Fa nptr
 is stored in the location referenced by
 is stored in the location referenced by
-.IR endptr .
-.PP
+.Fa endptr .
+.Pp
 If the correct value would cause overflow, plus or minus
 If the correct value would cause overflow, plus or minus
-.I HUGE_VAL
+.Dv HUGE_VAL
 is returned (according to the sign of the value), and
 is returned (according to the sign of the value), and
-.I ERANGE
+.Dv ERANGE
 is stored in
 is stored in
-.IR errno .
+.Va errno .
 If the correct value would cause underflow, zero is
 returned and
 If the correct value would cause underflow, zero is
 returned and
-.I ERANGE
+.Dv ERANGE
 is stored in 
 is stored in 
-.IR errno .
-.SH ERRORS
-.TP
-[ERANGE]
+.Va errno .
+.Sh ERRORS
+.Bl -tag -width [ERANGE]
+.It Bq Er ERANGE
 Overflow or underflow occurred.
 Overflow or underflow occurred.
-.SH "SEE ALSO"
-atof(3), atoi(3), atol(3), strtol(3), strtoul(3)
-.SH STANDARDS
-.B Strtod
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Sh SEE ALSO
+.Xr atof 3 ,
+.Xr atoi 3 ,
+.Xr atol 3 ,
+.Xr strtol 3 ,
+.Xr strtoul 3
+.Sh STANDARDS
+The
+.Fn strtod
+function
+conforms to
+.St -ansiC .
+.Sh BUGS
 This manual page represents intent instead of actual practice.
 The
 This manual page represents intent instead of actual practice.
 The
-.IR strtod (3)
+.Fn strtod
 function is not currently available.
 function is not currently available.
index 3974bc9..2938e32 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strtol.3    5.1 (Berkeley) %G%
+.\"     @(#)strtol.3   5.2 (Berkeley) %G%
 .\"
 .\"
-.TH STRTOL 3 ""
-.UC 7
-.SH NAME
-strtol \- convert a string to a long integer
-.SH SYNOPSIS
-.B #include <stdlib.h>
-.br
-.B #include <limits.h>
-.PP
-.B "long strtol(char *nptr, char **endptr, int base);
-.SH DESCRIPTION
-.B Strtol
+.Dd 
+.Dt STRTOL 3
+.Os
+.Sh NAME
+.Nm strtol
+.Nd convert string value to a long integer
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Fd #include <limits.h>
+.Ft long
+.Fn strtol "char *nptr" "char **endptr" "int base"
+.Sh DESCRIPTION
+The
+.Fn strtol
+function
 converts the string in
 converts the string in
-.I nptr
+.Fa nptr
 to a
 to a
-.B long
+.Em long
 value according to the given
 value according to the given
-.IR base ,
+.Fa base ,
 which must be between 2 and 36 inclusive,
 or be the special value 0.
 which must be between 2 and 36 inclusive,
 or be the special value 0.
-.PP
+.Pp
 The string may begin with an arbitrary amount of white space
 (as determined by
 The string may begin with an arbitrary amount of white space
 (as determined by
-.BR isspace ;
-see
-.IR ctype (3)),
-followed by a single optional `+' or `-' sign.
+.Xr isspace 3 )
+followed by a single optional
+.Ql +
+or
+.Ql -
+sign.
 If
 If
-.I base
+.Fa base
 is zero or 16,
 is zero or 16,
-the string may then include a `0x' prefix,
+the string may then include a
+.Ql 0x
+prefix,
 and the number will be read in base 16; otherwise, a zero
 and the number will be read in base 16; otherwise, a zero
-.I base
-is taken as 10 (decimal) unless the next character is `0',
+.Fa base
+is taken as 10 (decimal) unless the next character is
+.Ql 0 ,
 in which case it is taken as 8 (octal).
 in which case it is taken as 8 (octal).
-.PP
+.Pp
 The remainder of the string is converted to a
 The remainder of the string is converted to a
-.B long
+.Em long
 value in the obvious manner,
 stopping at the first character which is not a valid digit
 in the given base.
 value in the obvious manner,
 stopping at the first character which is not a valid digit
 in the given base.
-(In bases above 10, the letter `A' in either upper or lower case
-represents 10, `B' represents 11, and so forth, with `Z' representing 35.)
-.PP
+(In bases above 10, the letter
+.Ql A
+in either upper or lower case
+represents 10,
+.Ql B
+represents 11, and so forth, with
+.Ql Z
+representing 35.)
+.Pp
 If
 If
-.I endptr
+.Fa endptr
 is non nil,
 is non nil,
-.B strtol
+.Fn strtol
 stores the address of the first invalid character in
 stores the address of the first invalid character in
-.IR *endptr .
+.Fa *endptr .
 If there were no digits at all, however,
 If there were no digits at all, however,
-.B strtol
+.Fn strtol
 stores the original value of
 stores the original value of
-.I nptr
+.Fa nptr
 in
 in
-.IR *endptr .
+.Fa *endptr .
 (Thus, if
 (Thus, if
-.I *nptr
-is not '\e0' but
-.IR **endptr
-is '\e0' on return, the entire string was valid.)
-.SH RETURN VALUE
-.B Strtol
+.Fa *nptr
+is not
+.Ql \e0
+but
+.Fa **endptr
+is
+.Ql \e0
+on return, the entire string was valid.)
+.Sh RETURN VALUES
+The
+.Fn strtol
+function
 returns the result of the conversion,
 unless the value would underflow or overflow.
 If an underflow occurs,
 returns the result of the conversion,
 unless the value would underflow or overflow.
 If an underflow occurs,
-.B strtol
+.Fn strtol
 returns
 returns
-.BR LONG_MIN .
+.Dv LONG_MIN .
 If an overflow occurs,
 If an overflow occurs,
-.B strtol
+.Fn strtol
 returns
 returns
-.BR LONG_MAX .
+.Dv LONG_MAX .
 In both cases,
 In both cases,
-.B errno
+.Va errno
 is set to
 is set to
-.BR ERANGE .
-.SH ERRORS
-.TP
-[ERANGE]
+.Er ERANGE .
+.Sh ERRORS
+.Bl -tag -width [ERANGE]
+.It Bq Er ERANGE
 The given string was out of range; the value converted has been clamped.
 The given string was out of range; the value converted has been clamped.
-.SH SEE ALSO
-atof(3), atoi(3), atol(3), strtod(3), strtoul(3)
-.SH STANDARDS
-.B Strtol
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr atof 3 ,
+.Xr atoi 3 ,
+.Xr atol 3 ,
+.Xr strtod 3 ,
+.Xr strtoul 3
+.Sh STANDARDS
+The
+.Fn strtol
+function
+conforms to
+.St -ansiC .
+.Sh BUGS
 Ignores the current locale.
 Ignores the current locale.
index 0dd6b9c..0379a54 100644 (file)
@@ -1,47 +1,63 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)system.3    6.3 (Berkeley) %G%
+.\"     @(#)system.3   6.4 (Berkeley) %G%
 .\"
 .\"
-.TH SYSTEM 3 ""
-.AT 3
-.SH NAME
-system \- issue a shell command
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdlib.h>
-
-system(const char *string);
-.ft R
-.fi
-.SH DESCRIPTION
-.I System
-hands
-.I string
+.Dd 
+.Dt SYSTEM 3
+.Os
+.Sh NAME
+.Nm system
+.Nd pass a command to the shell
+.Sh SYNOPSIS
+.Fd #include <stdlib.h>
+.Ft int
+.Fn system "const char *string"
+.Sh DESCRIPTION
+The
+.Fn system
+function
+hands the argument
+.Fa string
 to the command interpreter
 to the command interpreter
-.IR sh (1).
-The calling process waits until the shell has completed,
-ignoring SIGINT and SIGQUIT, and blocking SIGCHLD.
-.PP
+.Xr sh 1 .
+The calling process waits for the shell
+to finish executing the command,
+ignoring
+.Dv SIGINT
+and
+.Dv SIGQUIT ,
+and blocking
+.Dv SIGCHLD .
+.Pp
 If
 If
-.I string
-is a NULL pointer,
-.I system
+.Fa string
+is a
+.Dv NULL
+pointer,
+.Fn system
 will return non-zero if the command interpreter
 will return non-zero if the command interpreter
-.IR sh (1)
+.Xr sh 1
 is available, and zero if it is not.
 is available, and zero if it is not.
-.PP
-.I System
+.Pp
+The
+.Fn system
+function
 returns the exit status of the shell, or \-1 if the
 returns the exit status of the shell, or \-1 if the
-.IR wait (3)
+.Xr wait 3
 for the shell failed.
 for the shell failed.
-A return status of 127 indicates that the execution of the shell
+A return value of 127 means the execution of the shell
 failed.
 failed.
-.SH "SEE ALSO"
-sh(1), execve(2), wait(2), popen(3)
-.SH STANDARDS
-.B System
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr sh 1 ,
+.Xr execve 2 ,
+.Xr wait 2 ,
+.Xr popen 3
+.Sh STANDARDS
+The
+.Fn system
+function
+conforms to
+.St -ansiC .
index d1df37b..e2228b2 100644 (file)
@@ -1,38 +1,46 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bcmp.3      5.2 (Berkeley) %G%
+.\"     @(#)bcmp.3     5.4 (Berkeley) %G%
 .\"
 .\"
-.TH BCMP 3 ""
-.UC 7
-.SH NAME
-bcmp \- compare byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-bcmp(const char *b1, const char *b2, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Bcmp
+.Dd 
+.Dt BCMP 3
+.Os BSD 4.2
+.Sh NAME
+.Nm bcmp
+.Nd compare byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn bcmp "const void *b1" "const void *b2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn bcmp
+function
 compares byte string
 compares byte string
-.I b1
+.Fa b1
 against byte string
 against byte string
-.IR b2 ,
+.Fa b2 ,
 returning zero if they are identical, non-zero otherwise.
 Both strings are assumed to be
 returning zero if they are identical, non-zero otherwise.
 Both strings are assumed to be
-.I len
+.Fa len
 bytes long.
 Zero-length strings are always identical.
 bytes long.
 Zero-length strings are always identical.
-.PP
+.Pp
 The strings may overlap.
 The strings may overlap.
-.SH SEE ALSO
-bcmp(3), memcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3)
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr memcmp 3 ,
+.Xr strcasecmp 3 ,
+.Xr strcmp 3 ,
+.Xr strcoll 3 ,
+.Xr strxfrm 3
+.Sh HISTORY
+A
+.Fn bcmp
+function first appeared in 
+.Bx 4.2 .
index 0014391..305ad92 100644 (file)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
@@ -6,32 +6,40 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bcopy.3     5.1 (Berkeley) %G%
+.\"     @(#)bcopy.3    5.3 (Berkeley) %G%
 .\"
 .\"
-.TH BCOPY 3 ""
-.UC 7
-.SH NAME
-bcopy \- copy byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void
-bcopy(const char *src, char *dst, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Bcopy
+.Dd 
+.Dt BCOPY 3
+.Os BSD 4.2
+.Sh NAME
+.Nm bcopy
+.Nd copy byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void
+.Fn bcopy "const void *src" "void *dst" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn bcopy
+function
 copies
 copies
-.I len
+.Fa len
 bytes from string
 bytes from string
-.I src
+.Fa src
 to string
 to string
-.IR dst .
+.Fa dst .
 The two strings may overlap.
 If
 The two strings may overlap.
 If
-.I len
+.Fa len
 is zero, no bytes are copied.
 is zero, no bytes are copied.
-.SH SEE ALSO
-memccpy(3), memcpy(3), memmove(3), strcpy(3), strncpy(3)
+.Sh SEE ALSO
+.Xr memccpy 3 ,
+.Xr memcpy 3 ,
+.Xr memmove 3 ,
+.Xr strcpy 3 ,
+.Xr strncpy 3
+.Sh HISTORY
+A
+.Fn bcopy
+function appeared in 
+.Bx 4.2 .
index e35c6b8..4f5e3c1 100644 (file)
@@ -1,67 +1,83 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bstring.3   6.6 (Berkeley) %G%
+.\"     @(#)bstring.3  6.8 (Berkeley) %G%
 .\"
 .\"
-.TH BSTRING 3 ""
-.UC
-.SH NAME
-bcmp, bcopy, bzero, memccpy, memchr, memcmp, memcpy, memmove,
-memset \- byte string operations
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-bcmp(const char *b1, const char *b2, size_t len);
-
-void
-bcopy(const char *src, char *dst, size_t len);
-
-void
-bzero(char *b, size_t len);
-
-void *
-memchr(const void *b, int c, size_t len);
-
-int
-memcmp(const void *b1, const void *b2, size_t len);
-
-char *
-memccpy(char *dst, const char *src, int c, size_t len);
-
-void *
-memcpy(void *dst, const void *src, size_t len);
-
-void *
-memmove(void *dst, const void *src, size_t len);
-
-void *
-memset(void *b, int c, size_t len)
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt BSTRING 3
+.Os
+.Sh NAME
+.Nm bcmp ,
+.Nm bcopy ,
+.Nm bzero ,
+.Nm memccpy ,
+.Nm memchr ,
+.Nm memcmp ,
+.Nm memcpy ,
+.Nm memmove,
+.Nm memset
+.Nd byte string operations
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn bcmp "const void *b1" "const void *b2" "size_t len"
+.Ft void
+.Fn bcopy "const void *src" "void *dst" "size_t len"
+.Ft void
+.Fn bzero "void *b" "size_t len"
+.Ft void *
+.Fn memchr "const void *b" "int c" "size_t len"
+.Ft int
+.Fn memcmp "const void *b1" "const void *b2" "size_t len"
+.Ft void *
+.Fn memccpy "void *dst" "const void *src" "int c" "size_t len"
+.Ft void *
+.Fn memcpy "void *dst" "const void *src" "size_t len"
+.Ft void *
+.Fn memmove "void *dst" "const void *src" "size_t len"
+.Ft void *
+.Fn memset "void *b" "int c" "size_t len"
+.Sh DESCRIPTION
 These functions operate on variable length strings of bytes.
 They do not check for terminating null bytes as the routines
 listed in
 These functions operate on variable length strings of bytes.
 They do not check for terminating null bytes as the routines
 listed in
-.IR string (3)
+.Xr string 3
 do.
 do.
-.PP
+.Pp
 See the specific manual pages for more information.
 See the specific manual pages for more information.
-.SH SEE\ ALSO
-bcmp(3), bcopy(3), bzero(3), memccpy(3), memchr(3), memcmp(3), memcpy(3),
-memmove(3), memset(3)
-.SH STANDARDS
-.IR Memchr ,
-.IR memcmp ,
-.IR memcpy ,
-.IR memmove ,
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr bcopy 3 ,
+.Xr bzero 3 ,
+.Xr memccpy 3 ,
+.Xr memchr 3 ,
+.Xr memcmp 3 ,
+.Xr memcpy 3 ,
+.Xr memmove 3 ,
+.Xr memset 3
+.Sh STANDARDS
+The functions
+.Fn memchr ,
+.Fn memcmp ,
+.Fn memcpy ,
+.Fn memmove ,
+and
+.Fn memset
+conform to
+.St -ansiC .
+.Sh HISTORY
+The functions
+.Fn bzero
 and
 and
-.I memset
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn memccpy
+appeared in
+.Bx 4.3 ;
+the functions
+.Fn bcmp ,
+.Fn bcopy ,
+appeared in
+.Bx 4.2 .
index 8aaade7..7da8d88 100644 (file)
@@ -1,36 +1,41 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bzero.3     5.1 (Berkeley) %G%
+.\"     @(#)bzero.3    5.3 (Berkeley) %G%
 .\"
 .\"
-.TH BZERO 3 ""
-.UC 7
-.SH NAME
-bzero \- write zeroes to a byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void
-bzero(char *b, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Bzero
+.Dd 
+.Dt BZERO 3
+.Os BDS 4.3
+.Sh NAME
+.Nm bzero
+.Nd write zeroes to a byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void
+.Fn bzero "void *b" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn bzero
+function
 writes
 writes
-.I len
+.Fa len
 zero bytes to the string
 zero bytes to the string
-.IR b .
+.Fa b .
 If
 If
-.I len
+.Fa len
 is zero,
 is zero,
-.B bzero
+.Fn bzero
 does nothing.
 does nothing.
-.SH SEE ALSO
-memset(3), swab(3)
+.Sh SEE ALSO
+.Xr memset 3 ,
+.Xr swab 3
+.Sh HISTORY
+A
+.Fn bzero
+function
+appeared in 
+.Bx 4.3 .
index ad92ce7..605b558 100644 (file)
@@ -1,33 +1,36 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)ffs.3       5.1 (Berkeley) %G%
+.\"     @(#)ffs.3      5.3 (Berkeley) %G%
 .\"
 .\"
-.TH FFS 3  ""
-.UC 7
-.SH NAME
-ffs \- find first bit set in a bit string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-ffs(int value);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Ffs
+.Dd 
+.Dt FFS 3
+.Os
+.Sh NAME
+.Nm ffs
+.Nd find first bit set in a bit string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn ffs "int value"
+.Sh DESCRIPTION
+The
+.Fn ffs
+fucntion
 finds the first bit set in
 finds the first bit set in
-.I value
+.Fa value
 and returns the index of that bit.
 Bits are numbered starting from 1, starting at the right-most
 bit.
 A return value of 0 means that the argument was zero.
 and returns the index of that bit.
 Bits are numbered starting from 1, starting at the right-most
 bit.
 A return value of 0 means that the argument was zero.
-.SH SEE\ ALSO
-bitstring(3)
+.Sh SEE ALSO
+.Xr bitstring 3
+.Sh HISTORY
+The
+.Fn ffs
+function appeared in
+.Bx 4.3 .
index 6a23175..1ca5e9a 100644 (file)
@@ -1,43 +1,56 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)index.3     5.1 (Berkeley) %G%
+.\"     @(#)index.3    5.3 (Berkeley) %G%
 .\"
 .\"
-.TH INDEX 3 ""
-.AT
-.SH NAME
-index \- locate character in string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-index(const char *s, int c);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Index
-returns a pointer to the first occurrence of
-.I c
+.Dd 
+.Dt INDEX 3
+.Os
+.Sh NAME
+.Nm index
+.Nd locate character in string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn index "const char *s" "int c"
+.Sh DESCRIPTION
+The
+.Fn index
+function
+locates the first character matching
+.Fa c
 (converted to a
 (converted to a
-.BR char )
+.Em char )
 in the null-terminated string
 in the null-terminated string
-.IR s ,
-or NULL if
-.I c
-does not occur anywhere in
-.IR s .
+.Fa s .
+.Sh RETURN VALUES
+The character
+.Fa c
+is returned if it is found; otherwise
+.Dv NULL
+is returned.
 If
 If
-.I c
+.Fa c
 is '\e0',
 is '\e0',
-.B index
+.Fn index
 locates the terminating '\e0'.
 locates the terminating '\e0'.
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3),
-strsep(3), strspn(3), strstr(3), strtok(3)
+.Sh SEE ALSO
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh HISTORY
+A
+.Fn index
+function appeared in 
+.At v6 .
index e4d10ac..c71b60f 100644 (file)
@@ -1,40 +1,47 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)memccpy.3   5.2 (Berkeley) %G%
+.\"     @(#)memccpy.3  5.4 (Berkeley) %G%
 .\"
 .\"
-.TH MEMCCPY 3 ""
-.UC 7
-.SH NAME
-memccpy
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void *
-memccpy(void *dst, const void *src, int c, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Memccpy
+.Dd 
+.Dt MEMCCPY 3
+.Os
+.Sh NAME
+.Nm memccpy
+.Nd copy string until character found
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void *
+.Fn memccpy "void *dst" "const void *src" "int c" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn memccpy
+function
 copies bytes from string
 copies bytes from string
-.I src
+.Fa src
 to string
 to string
-.I dst.
+.Fa dst .
 If the character
 If the character
-.I c
+.Fa c
 (as converted to an unsigned char) occurs in the string
 (as converted to an unsigned char) occurs in the string
-.IR src ,
+.Fa src ,
 the copy stops and a pointer to the byte after the copy of
 the copy stops and a pointer to the byte after the copy of
-.I c
+.Fa c
 in the string
 in the string
-.I dst
+.Fa dst
 is returned.
 Otherwise,
 is returned.
 Otherwise,
-.I len
+.Fa len
 bytes are copied, and a NULL pointer is returned.
 bytes are copied, and a NULL pointer is returned.
-.SH SEE ALSO
-bcopy(3), memcpy(3), memmove(3), strcpy(3)
+.Sh SEE ALSO
+.Xr bcopy 3 ,
+.Xr memcpy 3 ,
+.Xr memmove 3 ,
+.Xr strcpy 3
+.Sh HISTORY
+The
+.Fn memccpy
+function is
+.Ud .
index dba954d..706ec33 100644 (file)
@@ -1,40 +1,53 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)memchr.3    5.1 (Berkeley) %G%
+.\"     @(#)memchr.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH MEMCHR 3 ""
-.UC 7
-.SH NAME
-memchr \- locate byte in byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-memchr(const void *b, int c, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Memchr
+.Dd 
+.Dt MEMCHR 3
+.Os
+.Sh NAME
+.Nm memchr
+.Nd locate byte in byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void *
+.Fn memchr "const void *b" "int c" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn memchr
+function
 locates the first occurrence of
 locates the first occurrence of
-.I c
+.Fa c
 (converted to an unsigned char)
 in string
 (converted to an unsigned char)
 in string
-.IR b .
-It returns a pointer to the byte located,
+.Fa b .
+.Sh RETURN VALUES
+The
+.Fn memchr
+function
+returns a pointer to the byte located,
 or NULL if no such byte exists within
 or NULL if no such byte exists within
-.I len
+.Fa len
 bytes.
 bytes.
-.SH SEE ALSO
-index(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3),
-strsep(3), strspn(3), strstr(3), strtok(3)
-.SH STANDARDS
-.I Memchr
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh STANDARDS
+The
+.Fn memchr
+function
+conforms to
+.St -ansiC .
index 16cb27b..13fb480 100644 (file)
@@ -1,42 +1,54 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)memcmp.3    5.2 (Berkeley) %G%
+.\"     @(#)memcmp.3   5.4 (Berkeley) %G%
 .\"
 .\"
-.TH MEMCMP 3 ""
-.UC 7
-.SH NAME
-memcmp \- compare byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-memcmp(const void *b1, const void *b2, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Memcmp
+.Dd 
+.Dt MEMCMP 3
+.Os
+.Sh NAME
+.Nm memcmp
+.Nd compare byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn memcmp "const void *b1" "const void *b2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn memcmp
+function
 compares byte string
 compares byte string
-.I b1
+.Fa b1
 against byte string
 against byte string
-.IR b2 ,
-returning zero if they are identical,
-otherwise returning the difference between the first two differing bytes
-(treated as unsigned char values, so that '\e200' is greater than \&'\e0',
-e.g.).
+.Fa b2 .
 Both strings are assumed to be
 Both strings are assumed to be
-.I len
+.Fa len
 bytes long.
 bytes long.
+.Sh RETURN VALUES
+The
+.Fn memcmp
+function
+returns zero if the the two strings are identical,
+otherwise returns the difference between the first two differing bytes
+(treated as unsigned char values, so that
+.Sq Li \e200
+is greater than
+.Sq Li \&\e0 ,
+for example).
 Zero-length strings are always identical.
 Zero-length strings are always identical.
-.SH SEE ALSO
-bcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3)
-.SH STANDARDS
-.I Memcmp
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr strcasecmp 3 ,
+.Xr strcmp 3 ,
+.Xr strcoll 3 ,
+.Xr strxfrm 3
+.Sh STANDARDS
+The
+.Fn memcmp
+function
+conforms to
+.St -ansiC .
index 33f8a42..6791ec3 100644 (file)
@@ -1,47 +1,55 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)memcpy.3    5.2 (Berkeley) %G%
+.\"     @(#)memcpy.3   5.4 (Berkeley) %G%
 .\"
 .\"
-.TH MEMCPY 3 ""
-.UC 7
-.SH NAME
-memcpy \- copy byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void *
-memcpy(void *dst, const void *src, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Memcpy
+.Dd 
+.Dt MEMCPY 3
+.Os
+.Sh NAME
+.Nm memcpy
+.Nd copy byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void *
+.Fn memcpy "void *dst" "const void *src" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn memcpy
+function
 copies
 copies
-.I len
+.Fa len
 bytes from string
 bytes from string
-.I src
+.Fa src
 to string
 to string
-.I dst
-and returns the original value of
-.IR dst .
-.SH SEE ALSO
-bcopy(3), memccpy(3), memmove(3), strcpy(3)
-.SH STANDARDS
-.IR Memcpy
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Fa dst .
+.Sh RETURN VALUES
+The
+.Fn memcpy
+function
+returns the original value of
+.Fa dst .
+.Sh SEE ALSO
+.Xr bcopy 3 ,
+.Xr memccpy 3 ,
+.Xr memmove 3 ,
+.Xr strcpy 3
+.Sh STANDARDS
+The
+.Fn memcpy
+function
+conforms to
+.St -ansiC .
+.Sh BUGS
 In this implementation
 In this implementation
-.B memcpy
+.Fn memcpy
 is implemented using
 is implemented using
-.IR bcopy (3),
+.Xr bcopy 3 ,
 and therefore the strings may overlap.
 On other systems, copying overlapping strings may produce surprises.
 A simpler solution is to not use
 and therefore the strings may overlap.
 On other systems, copying overlapping strings may produce surprises.
 A simpler solution is to not use
-.IR memcpy .
+.Fn memcpy .
index 8165c2c..3516799 100644 (file)
@@ -1,40 +1,47 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)memmove.3   5.2 (Berkeley) %G%
+.\"     @(#)memmove.3  5.4 (Berkeley) %G%
 .\"
 .\"
-.TH MEMMOVE 3 ""
-.UC 7
-.SH NAME
-memmove \- copy byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void *
-memmove(void *dst, const void *src, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Memmove
+.Dd 
+.Dt MEMMOVE 3
+.Os
+.Sh NAME
+.Nm memmove
+.Nd copy byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void *
+.Fn memmove "void *dst" "const void *src" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn memmove
+function
 copies
 copies
-.I len
+.Fa len
 bytes from string
 bytes from string
-.I src
+.Fa src
 to string
 to string
-.I dst
-and returns the original value of
-.IR dst .
+.Fa dst .
 The two strings may overlap;
 the copy is always done in a non-destructive manner.
 The two strings may overlap;
 the copy is always done in a non-destructive manner.
-.SH SEE ALSO
-bcopy(3), memccpy(3), memcpy(3), strcpy(3)
-.SH STANDARDS
-.IR Memmove
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh RETURN VALUES
+The
+.Fn memmove
+function returns the original value of
+.Fa dst .
+.Sh SEE ALSO
+.Xr bcopy 3 ,
+.Xr memccpy 3 ,
+.Xr memcpy 3 ,
+.Xr strcpy 3
+.Sh STANDARDS
+The
+.Fn memmove
+function
+conforms to
+.St -ansiC .
index 8248286..6073f10 100644 (file)
@@ -1,36 +1,38 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)memset.3    5.1 (Berkeley) %G%
+.\"     @(#)memset.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH MEMSET 3 ""
-.UC 7
-.SH NAME
-memset \- write a byte to byte string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void *
-memset(void *b, int c, size_t len);
-.ft R
-.nf
-.SH DESCRIPTION
-.B Memset
+.Dd 
+.Dt MEMSET 3
+.Os
+.Sh NAME
+.Nm memset
+.Nd write a byte to byte string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void *
+.Fn memset "void *b" "int c" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn memset
+function
 writes
 writes
-.I len
+.Fa len
 bytes of value
 bytes of value
-.I c
+.Fa c
 (converted to an unsigned char) to the string
 (converted to an unsigned char) to the string
-.IR b .
-.SH SEE ALSO
-bzero(3), swab(3)
-.SH STANDARDS
-.B Memset
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Fa b .
+.Sh SEE ALSO
+.Xr bzero 3 ,
+.Xr swab 3
+.Sh STANDARDS
+The
+.Fn memset
+function
+conforms to
+.St -ansiC .
index 466f822..2d38101 100644 (file)
@@ -1,43 +1,54 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)rindex.3    5.1 (Berkeley) %G%
+.\"     @(#)rindex.3   5.2 (Berkeley) %G%
 .\"
 .\"
-.TH RINDEX 3 ""
-.AT
-.SH NAME
-rindex \- locate character in string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-rindex(const char *s, int c);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Rindex
-returns a pointer to the last occurrence of character 
-.I c
+.Dd 
+.Dt RINDEX 3
+.Os
+.Sh NAME
+.Nm rindex
+.Nd locate character in string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn rindex "const char *s" "int c"
+.Sh DESCRIPTION
+The
+.Fn rindex
+function
+locates the last character
+matching
+.Fa c
 (converted to a
 (converted to a
-.BR char )
+.Em char )
 in the null-terminated string
 in the null-terminated string
-.IR s ,
-or NULL if
-.I c
-does not occur anywhere in
-.IR s .
+.Fa s .
+The character c is returned if it is found; otherwise NULL is returned.
 If
 If
-.I c
-is '\e0',
-.B rindex
-locates the terminating '\e0'.
-.SH SEE ALSO
-index(3), memchr(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3),
-strsep(3), strspn(3), strstr(3), strtok(3)
+.Fa c
+is
+.Ql \e0 ,
+.Fn rindex
+locates the terminating
+.Ql \e0 .
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh HISTORY
+A
+.Fn rindex
+function appeared in 
+.At v6 .
index 1213386..b99fcd9 100644 (file)
@@ -1,50 +1,61 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strcasecmp.3        5.2 (Berkeley) %G%
+.\"     @(#)strcasecmp.3       5.4 (Berkeley) %G%
 .\"
 .\"
-.TH STRCASECMP 3 ""
-.UC 7
-.SH NAME
-strcasecmp \- compare strings, ignoring case
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-strcasecmp(const char *s1, const char *s2);
-
-int
-strncasecmp(const char *s1, const char *s2, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcasecmp
+.Dd 
+.Dt STRCASECMP 3
+.Os
+.Sh NAME
+.Nm strcasecmp
+.Nd compare strings, ignoring case
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn strcasecmp "const char *s1" "const char *s2"
+.Ft int
+.Fn strncasecmp "const char *s1" "const char *s2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn strcasecmp
 and
 and
-.B strncasecmp
+.Fn strncasecmp
+functions
 compare the null-terminated strings
 compare the null-terminated strings
-.I s1
+.Fa s1
 and
 and
-.I s2
+.Fa s2
 and return an integer greater than, equal to, or less than 0,
 according as
 and return an integer greater than, equal to, or less than 0,
 according as
-.I s1
+.Fa s1
 is lexicographically greater than, equal to, or less than
 is lexicographically greater than, equal to, or less than
-.IR s2
+.Fa s2
 after translation of each corresponding character to lower-case.
 The strings themselves are not modified.
 after translation of each corresponding character to lower-case.
 The strings themselves are not modified.
-The comparison is done using unsigned characters, so that '\e200'
-is greater than '\e0'.
-.PP
-.B Strncasecmp
+The comparison is done using unsigned characters, so that
+.Sq Li \e200
+is greater than
+.Ql \e0 .
+.Pp
+The
+.Fn strncasecmp
 compares at most
 compares at most
-.I len
+.Fa len
 characters.
 characters.
-.SH SEE ALSO
-bcmp(3), memcmp(3), strcmp(3), strcoll(3), strxfrm(3)
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr memcmp 3 ,
+.Xr strcmp 3 ,
+.Xr strcoll 3 ,
+.Xr strxfrm 3
+.Sh HISTORY
+The
+.Fn strcasecmp
+and
+.Fn strncasecmp
+functions are
+.Ud .
index 5bcdd3c..2e220e8 100644 (file)
@@ -1,56 +1,65 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strcat.3    5.3 (Berkeley) %G%
+.\"     @(#)strcat.3   5.5 (Berkeley) %G%
 .\"
 .\"
-.TH STRCAT 3 ""
-.UC 4
-.SH NAME
-strcat \- concatenate strings
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strcat(char *s, const char *append);
-
-char *
-strncat(char *s, const char *append, size_t count);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcat
+.Dd 
+.Dt STRCAT 3
+.Os
+.Sh NAME
+.Nm strcat
+.Nd concatenate strings
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strcat "char *s" "const char *append"
+.Ft char *
+.Fn strncat "char *s" "const char *append" "size_t count"
+.Sh DESCRIPTION
+The
+.Fn strcat
 and
 and
-.B strncat
+.Fn strncat
+functions
 append a copy of the null-terminated string
 append a copy of the null-terminated string
-.I append
+.Fa append
 to the end of the null-terminated string
 to the end of the null-terminated string
-.IR s ,
-then add a terminating '\e0'.
+.Fa s ,
+then add a terminating
+.Ql \e0 .
 The string
 The string
-.I s
+.Fa s
 must have sufficient space to hold the result.
 must have sufficient space to hold the result.
-.PP
-.B Strncat
-appends at most
-.I count
+.Pp
+The
+.Fn strncat
+function
+appends not more than
+.Fa count
 characters.
 characters.
-.PP
-.B Strcat
+.Sh RETURN VALUES
+The
+.Fn strcat
 and
 and
-.B strncat
+.Fn strncat
+functions
 return the pointer
 return the pointer
-.IR s .
-.SH SEE ALSO
-bcopy(3), memccpy(3), memcpy(3), memmove(3), strcpy(3)
-.SH STANDARDS
-.B Strcat
+.Fa s .
+.Sh SEE ALSO
+.Xr bcopy 3 ,
+.Xr memccpy 3 ,
+.Xr memcpy 3 ,
+.Xr memmove 3 ,
+.Xr strcpy 3
+.Sh STANDARDS
+The
+.Fn strcat
 and
 and
-.B strncat
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn strncat
+functions
+conform to
+.St -ansiC .
index d6d2d1d..e360e67 100644 (file)
@@ -6,7 +6,7 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strchr.3    5.1 (Berkeley) %G%
+.\"    @(#)strchr.3    5.2 (Berkeley) %G%
 .\"
 .TH STRCHR 3 ""
 .UC 7
 .\"
 .TH STRCHR 3 ""
 .UC 7
index d8b9f2a..9f79298 100644 (file)
@@ -1,53 +1,65 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strcmp.3    5.3 (Berkeley) %G%
+.\"     @(#)strcmp.3   5.5 (Berkeley) %G%
 .\"
 .\"
-.TH STRCMP 3 ""
-.UC 4
-.SH NAME
-strcmp \- compare strings
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-strcmp(const char *s1, const char *s2);
-
-int
-strncmp(const char *s1, const char *s2, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcmp
+.Dd 
+.Dt STRCMP 3
+.Os
+.Sh NAME
+.Nm strcmp
+.Nd compare strings
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn strcmp "const char *s1" "const char *s2"
+.Ft int
+.Fn strncmp "const char *s1" "const char *s2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn strcmp
+and
+.Fn strncmp
+functions
+lexicographically compare the null-terminated strings
+.Fa s1
 and
 and
-.B strncmp
-compare null-terminated strings
-.I s1
+.Fa s2 .
+.Sh RETURN VALUES
+The
+.Fn strcmp
 and
 and
-.I s2
-and return an integer greater than, equal to, or less than 0,
-according as
-.I s1
-is lexicographically greater than, equal to, or less than
-.IR s2 .
-The comparison is done using unsigned characters, so that '\e200'
-is greater than '\e0'.
-.PP
-.I Strncmp
-compares at most
-.I len
+.Fn strncmp
+return an integer greater than, equal to, or less than 0, according
+as the string
+.Fa s1
+is greater than, equal to, or less than the string
+.Fa s2 .
+The comparison is done using unsigned characters, so that
+.Ql \e200
+is greater than
+.Ql \e0 .
+.Pp
+The
+.Fn strncmp
+compares not more than
+.Fa len
 characters.
 characters.
-.SH SEE ALSO
-bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strxfrm(3)
-.SH STANDARDS
-.B Strcmp
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr memcmp 3 ,
+.Xr strcasecmp 3 ,
+.Xr strcoll 3 ,
+.Xr strxfrm 3
+.Sh STANDARDS
+The
+.Fn strcmp
 and
 and
-.B strncmp
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn strncmp
+functions
+conform to
+.St -ansiC .
index 0554297..00a0be6 100644 (file)
@@ -1,41 +1,46 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strcoll.3   5.3 (Berkeley) %G%
+.\"     @(#)strcoll.3  5.5 (Berkeley) %G%
 .\"
 .\"
-.TH STRCOLL 3 ""
-.UC 4
-.SH NAME
-strcoll \- compare strings according to current collation
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-int
-strcoll(const char *s1, const char *s2);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcoll
-compares null-terminated strings
-.I s1
+.Dd 
+.Dt STRCOLL 3
+.Os
+.Sh NAME
+.Nm strcoll
+.Nd compare strings according to current collation
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft int
+.Fn strcoll "const char *s1" "const char *s2"
+.Sh DESCRIPTION
+The
+.Fn strcoll
+function
+lexicographically compares the null-terminated strings
+.Fa s1
 and
 and
-.I s2
+.Fa s2
 according to the current locale collation
 and returns an integer greater than, equal to, or less than 0,
 according as
 according to the current locale collation
 and returns an integer greater than, equal to, or less than 0,
 according as
-.I s1
-is lexicographically greater than, equal to, or less than
-.IR s2 .
-.SH SEE ALSO
-bcmp(3), memcmp(3), setlocale(3), strcasecmp(3), strcmp(3), strcoll(3),
-strxfrm(3)
-.SH STANDARDS
-.B Strcoll
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Fa s1
+is greater than, equal to, or less than
+.Fa s2 .
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr memcmp 3 ,
+.Xr setlocale 3 ,
+.Xr strcasecmp 3 ,
+.Xr strcmp 3 ,
+.Xr strxfrm 3
+.Sh STANDARDS
+The
+.Fn strcoll
+function
+conforms to
+.St -ansiC .
index dbd262f..6a857cc 100644 (file)
@@ -1,78 +1,93 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strcpy.3    5.2 (Berkeley) %G%
+.\"     @(#)strcpy.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRCPY 3 ""
-.UC 4
-.SH NAME
-strcpy \- copy strings
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strcpy(char *dst, const char *src);
-
-char *
-strncpy(char *dst, const char *src, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcpy
+.Dd 
+.Dt STRCPY 3
+.Os BSD 4
+.Sh NAME
+.Nm strcpy
+.Nd copy strings
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strcpy "char *dst" "const char *src"
+.Ft char *
+.Fn strncpy "char *dst" "const char *src" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn strcpy
 and
 and
-.B strncpy
-copy string
-.I src
+.Fn strncpy
+functions
+copy the string
+.Fa src
 to
 to
-.IR dst ,
-stopping after the terminating '\e0' has been moved.
-.PP
-.B Strncpy
-writes exactly
-.I len
+.Fa dst
+(including the terminating
+.Ql \e0
+character).
+.Pp
+The
+.Fn strncpy
+copies not more than
+.Fa len
 characters into
 characters into
-.IR dst ,
-appending '\e0' characters if
-.I src
+.Fa dst ,
+appending
+.Ql \e0
+characters if
+.Fa src
 is less than
 is less than
-.I len
+.Fa len
 characters long, and
 characters long, and
-.I not
+.Em not
 terminating
 terminating
-.I dst
+.Fa dst
 if
 if
-.I src
+.Fa src
 is more than
 is more than
-.I len
+.Fa len
 characters long.
 characters long.
-.PP
-.B Strcpy
+.Sh RETURN VALUES
+The
+.Fn strcpy
 and
 and
-.B strncpy
+.Fn strncpy
+functions
 return
 return
-.IR dst .
-.SH EXAMPLES
-The following sets ``chararray'' to ``abc\e0\e0\e0'':
-.sp
-.ti +0.5i
+.Fa dst .
+.Sh EXAMPLES
+The following sets
+.Dq Li chararray
+to
+.Dq Li abc\e0\e0\e0 :
+.Bd -literal -offset indent
 (void)strncpy(chararray, "abc", 6).
 (void)strncpy(chararray, "abc", 6).
-.PP
-The following sets ``chararray'' to ``abcdef'':
-.sp
-.RS
+.Ed
+.Pp
+The following sets
+.Dq Li chararray
+to
+.Dq Li abcdef :
+.Bd -literal -offset indent
 (void)strncpy(chararray, "abcdefgh", 6);
 (void)strncpy(chararray, "abcdefgh", 6);
-.RE
-.SH SEE ALSO
-bcopy(3), memccpy(3), memcpy(3), memmove(3)
-.SH STANDARDS
-.B Strcpy
+.Ed
+.Sh SEE ALSO
+.Xr bcopy 3 ,
+.Xr memccpy 3 ,
+.Xr memcpy 3 ,
+.Xr memmove 3
+.Sh STANDARDS
+The
+.Fn strcpy
 and
 and
-.B strncpy
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn strncpy
+functions
+conform to
+.St -ansiC .
index 4ddea9c..59e78de 100644 (file)
@@ -1,45 +1,56 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strcspn.3   5.1 (Berkeley) %G%
+.\"     @(#)strcspn.3  5.2 (Berkeley) %G%
 .\"
 .\"
-.TH STRCSPN 3 ""
-.UC 7
-.SH NAME
-strcspn \- span the complement of a string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-size_t
-strcspn(const char *s, const char *charset);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcspn
+.Dd 
+.Dt STRCSPN 3
+.Os
+.Sh NAME
+.Nm strcspn
+.Nd span the complement of a string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft size_t
+.Fn strcspn "const char *s" "const char *charset"
+.Sh DESCRIPTION
+The
+.Fn strcspn
+function
 spans the initial part of the null-terminated string
 spans the initial part of the null-terminated string
-.I s
+.Fa s
 as long as the characters from
 as long as the characters from
-.I s
+.Fa s
 do not occur in string
 do not occur in string
-.I charset
-(i.e.,
-.I strcspn
+.Fa charset
+(it
 spans the
 spans the
-.I complement
+.Em complement
 of
 of
-.IR charset ).
-.B Strcspn
+.Fa charset ) .
+.Sh RETURN VALUES
+The
+.Fn strcspn
+function
 returns the number of characters spanned.
 returns the number of characters spanned.
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strrchr(3),
-strsep(3), strspn(3), strstr(3), strtok(3)
-.SH STANDARDS
-.B Strcspn
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh STANDARDS
+The
+.Fn strcspn
+function
+conforms to
+.St -ansiC .
index 3992d5c..f13f473 100644 (file)
@@ -1,32 +1,38 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strdup.3    5.1 (Berkeley) %G%
+.\"     @(#)strdup.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRDUP 3 ""
-.UC 7
-.SH NAME
-strdup \- save a copy of a string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strdup(const char *str);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Strdup
-allocates sufficient memory for a copy of the string
-.IR str ,
+.Dd 
+.Dt STRDUP 3
+.Os
+.Sh NAME
+.Nm strdup
+.Nd save a copy of a string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strdup "const char *str"
+.Sh DESCRIPTION
+The
+.Fn strdup
+function
+allocates sufficient memory for a copy
+of the string
+.Fa str ,
 does the copy, and returns a pointer to it.
 does the copy, and returns a pointer to it.
-The pointer may subsequently be used as an argument to the function
-.IR free (3).
-.PP
-.I Strdup
-returns NULL if unable to allocate the necessary memory.
-.SH SEE ALSO
-malloc(3)
+The pointer may subsequently be used as an
+argument to the function
+.Xr free 3 .
+.Sh SEE ALSO
+.Xr calloc 3
+.Xr malloc 3
+.Xr realloc 3
+.Xr free 3
+.Sh HISTORY
+The
+.Fn strdup
+function
+.Ud .
index daadbab..e646a49 100644 (file)
@@ -1,56 +1,81 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)strerror.3  6.6 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH STRERROR 3  ""
-.UC 4
-.SH NAME
-perror, strerror, sys_errlist, sys_nerr \- system error messages
-.SH SYNOPSIS
-.nf
-.ft B
-extern int errno, sys_nerr;
-extern char *sys_errlist[];
-
-#include <stdio.h>
-
-void perror(const char *string);
-
-char *strerror(int errnum);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Perror
-produces a short error message on the standard error file
-describing the last error encountered during a call
-to the system from a C program.  If
-.I string
-is non-NULL, it is printed, followed by a colon, followed by a space,
-followed by the message and a new-line.  Otherwise, just the
-message and the new-line are printed.  Most usefully, the argument
-string is the name of the program which incurred the error.
-The error number is taken from the external variable
-.I errno
-(see
-.IR intro (2)),
-which is set when errors occur but not cleared when
-non-erroneous calls are made.
-.PP
-To simplify variant formatting of messages, the
-.I strerror
-function returns a pointer to the error message string mapped
-to the error number
-.IR errnum .
-.PP
+.\"     @(#)strerror.3 6.8 (Berkeley) %G%
+.\"
+.Dd 
+.Dt STRERROR 3
+.Os BSD 4
+.Sh NAME
+.Nm perror ,
+.Nm strerror ,
+.Nm sys_errlist ,
+.Nm sys_nerr
+.Nd system error messages
+.Sh SYNOPSIS
+.Vt extern int errno;
+.Vt extern char *sys_errlist[];
+.Fd #include <stdio.h>
+.Ft void
+.Fn perror "const char *string"
+.Ft char *
+.Fn strerror "int errnum"
+.Sh DESCRIPTION
+The
+.Fn strerror
+and
+.Fn perror
+functions lookup the error message string affiliated with an
+error number.
+.Pp
+The
+.Fn sterror
+function accepts an error number argument
+.Fa errnum
+and
+returns a pointer to the corresponding
+message string.
+.Pp
+The
+.Fn perror
+function finds the error message corresponding to the current
+value of the global variable
+.Va errno
+and writes it, followed by a new-line, to the
+.Em stderr .
+If the argument
+.Fa string
+is
+.Pf non- Dv NULL
+it is pre-appended to the message
+string and separated from it by
+a colon and space
+.Pq Ql \&:\ \& .
+If
+.Fa string
+is
+.Dv NULL
+only the error message string is printed.
+.Pp
 The message strings can be accessed directly using the external
 character array
 The message strings can be accessed directly using the external
 character array
-.IR sys_errlist .
-.I Sys_nerr
-is the total number of messages in the array.
+.Fa sys_errlist .
+The external value
+.Fa sys_nerr
+contains a count of the messages in
+.Fa sys_errlist .
 The use of these variables is deprecated;
 The use of these variables is deprecated;
-.I strerror
+.Fn strerror
 should be used instead.
 should be used instead.
-.SH "SEE ALSO"
-intro(2), psignal(3)
+.Sh SEE ALSO
+.Xr intro 2 ,
+.Xr psignal 3
+.Sh HISTORY
+The
+.Fn strerror
+and
+.Fn perror
+functions are
+.Ud .
index cd4f908..34b4c91 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strftime.3  5.9 (Berkeley) %G%
+.\"     @(#)strftime.3 5.11 (Berkeley) %G%
 .\"
 .\"
-.TH STRFTIME 3 "%Q"
-.AT 3
-.SH NAME
-strftime \- format date and time
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <time.h>
-#include <string.h>
-
-size_t
-strftime(char *s, size_t maxsize, const char *format,
-       const struct tm *timeptr);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt STRFTIME 3
+.Os
+.Sh NAME
+.Nm strftime
+.Nd format date and time
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <time.h>
+.Fd #include <string.h>
+.Ft size_t
+.Fn strftime "char *buf" "size_t maxsize" "const char *format" "const struct tm *timeptr"
+.Sh DESCRIPTION
 The
 The
-.I strftime
+.Fn strftime
 function formats the information from
 function formats the information from
-.I timeptr
+.Fa timeptr
 into the buffer
 into the buffer
-.I buf
+.Fa buf
 according to the string pointed to by
 according to the string pointed to by
-.IR format .
-.PP
+.Fa format .
+.Pp
 The
 The
-.I format
+.Fa format
 string consists of zero or more conversion specifications and
 ordinary characters.
 All ordinary characters are copied directly into the buffer.
 string consists of zero or more conversion specifications and
 ordinary characters.
 All ordinary characters are copied directly into the buffer.
-A conversion specification consists of a percent sign (``%'')
+A conversion specification consists of a percent sign
+.Dq Ql %
 and one other character.
 and one other character.
-.PP
+.Pp
 No more than
 No more than
-.I maxsize
+.Fa maxsize
 characters will be placed into the array.
 If the total number of resulting characters, including the terminating
 null character, is not more than
 characters will be placed into the array.
 If the total number of resulting characters, including the terminating
 null character, is not more than
-.IR maxsize ,
-.I strftime
+.Fa maxsize ,
+.Fn strftime
 returns the number of characters in the array, not counting the
 terminating null.
 Otherwise, zero is returned.
 returns the number of characters in the array, not counting the
 terminating null.
 Otherwise, zero is returned.
-.PP
+.Pp
 Each conversion specification is replaced by the characters as
 follows which are then copied into the buffer.
 Each conversion specification is replaced by the characters as
 follows which are then copied into the buffer.
-.TP
-.%A
+.Bl -tag -width "xxxx"
+.It Cm \&%A
 is replaced by the full weekday name.
 is replaced by the full weekday name.
-.TP
-.B %a
+.It Cm %a
 is replaced by the abbreviated weekday name, where the abbreviation
 is the first three characters.
 is replaced by the abbreviated weekday name, where the abbreviation
 is the first three characters.
-.TP
-.B %B
+.It Cm \&%B
 is replaced by the full month name.
 is replaced by the full month name.
-.TP
-.B %b or %h
+.It Cm %b  or  %h
 is replaced by the abbreviated month name, where the abbreviation is
 the first three characters.
 is replaced by the abbreviated month name, where the abbreviation is
 the first three characters.
-.TP
-.B %C
-is equivalent to ``%a %b %e %H:%M:%S %Y'' (the format produced by
-.IR asctime (3).
-.TP
-.B %c
-is equivalent to ``%m/%d/%y''.
-.TP
-.%D
-is replaced by the date in the format ``mm/dd/yy''.
-.TP
-.B %d
+.It Cm \&%C
+is equivalent to
+.Dq Li %a %b %e %H:%M:%S %Y
+(the format produced by
+.Xr asctime 3 .
+.It Cm %c
+is equivalent to
+.Dq Li %m/%d/%y .
+.It Cm \&%D
+is replaced by the date in the format
+.Dq Ql mm/dd/yy .
+.It Cm %d
 is replaced by the day of the month as a decimal number (01-31).
 is replaced by the day of the month as a decimal number (01-31).
-.TP
-.B %e
+.It Cm %e
 is replaced by the day of month as a decimal number (1-31); single
 digits are preceded by a blank.
 is replaced by the day of month as a decimal number (1-31); single
 digits are preceded by a blank.
-.TP
-.B %H
+.It Cm \&%H
 is replaced by the hour (24-hour clock) as a decimal number (00-23).
 is replaced by the hour (24-hour clock) as a decimal number (00-23).
-.TP
-.B %I
+.It Cm \&%I
 is replaced by the hour (12-hour clock) as a decimal number (01-12).
 is replaced by the hour (12-hour clock) as a decimal number (01-12).
-.TP
-.B %j
+.It Cm %j
 is replaced by the day of the year as a decimal number (001-366).
 is replaced by the day of the year as a decimal number (001-366).
-.TP
-.B %k
+.It Cm %k
 is replaced by the hour (24-hour clock) as a decimal number (0-23);
 single digits are preceded by a blank.
 is replaced by the hour (24-hour clock) as a decimal number (0-23);
 single digits are preceded by a blank.
-.TP
-.B %l
+.It Cm %l
 is replaced by the hour (12-hour clock) as a decimal number (1-12);
 single digits are preceded by a blank.
 is replaced by the hour (12-hour clock) as a decimal number (1-12);
 single digits are preceded by a blank.
-.TP
-.B %M
+.It Cm \&%M
 is replaced by the minute as a decimal number (00-59).
 is replaced by the minute as a decimal number (00-59).
-.TP
-.B %m
+.It Cm %m
 is replaced by the month as a decimal number (01-12).
 is replaced by the month as a decimal number (01-12).
-.TP
-.B %n
+.It Cm %n
 is replaced by a newline.
 is replaced by a newline.
-.TP
-.B %p
-is replaced by either ``AM'' or ``PM'' as appropriate.
-.TP
-.B %R
-is equivalent to ``%H:%M''.
-.TP
-.B %r
-is equivalent to ``%I:%M:%S %p''.
-.TP
-.B %t
+.It Cm %p
+is replaced by either
+.Dq Tn AM
+or
+.Dq Tn PM
+as appropriate.
+.It Cm \&%R
+is equivalent to
+.Dq Li %H:%M
+.It Cm %r
+is equivalent to
+.Dq Li %I:%M:%S %p .
+.It Cm %t
 is replaced by a tab.
 is replaced by a tab.
-.TP
-.B %S
+.It Cm \&%S
 is replaced by the second as a decimal number (00-60).
 is replaced by the second as a decimal number (00-60).
-.TP
-.B %s
+.It Cm %s
 is replaced by the number of seconds since the Epoch, UCT (see
 is replaced by the number of seconds since the Epoch, UCT (see
-.IR mktime (3)).
-.TP
-.B %T or %X
-is equivalent to ``%H:%M:%S''.
-.TP
-.B %U
+.Xr mktime 3 ) .
+.It Cm \&%T No or Cm \&%X
+is equivalent to
+.Dq Li %H:%M:%S .
+.It Cm \&%U
 is replaced by the week number of the year (Sunday as the first day of
 the week) as a decimal number (00-53).
 is replaced by the week number of the year (Sunday as the first day of
 the week) as a decimal number (00-53).
-.TP
-.B %W
+.It Cm \&%W
 is replaced by the week number of the year (Monday as the first day of
 the week) as a decimal number (00-53).
 is replaced by the week number of the year (Monday as the first day of
 the week) as a decimal number (00-53).
-.TP
-.B %w
+.It Cm %w
 is replaced by the weekday (Sunday as the first day of the week)
 as a decimal number (0-6).
 is replaced by the weekday (Sunday as the first day of the week)
 as a decimal number (0-6).
-.TP
-.B %x
-is equivalent to ``%m/%d/%y %H:%M:%S''.
-.TP
-.B %Y
+.It Cm %x
+is equivalent to
+.Dq Li %m/%d/%y %H:%M:%S .
+.It Cm \&%Y
 is replaced by the year with century as a decimal number.
 is replaced by the year with century as a decimal number.
-.TP
-.B %y
+.It Cm %y
 is replaced by the year without century as a decimal number (00-99).
 is replaced by the year without century as a decimal number (00-99).
-.TP
-.B %Z
+.It Cm \&%Z
 is replaced by the time zone name.
 is replaced by the time zone name.
-.TP
-.B %%
-is replaced by ``%''.
-.SH "SEE ALSO"
-date(1), ctime(3), printf(1), printf(3)
-.SH BUGS
+.It Cm %%
+is replaced by
+.Ql % .
+.El
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr ctime 3 ,
+.Xr printf 1 ,
+.Xr printf 3
+.Sh STANDARDS
+The
+.Fn strftime
+function
+conforms to
+.St -ansiC .
+The
+.Ql %s
+conversion specification is an extension.
+.Sh BUGS
 There is no conversion specification for the phase of the moon.
 There is no conversion specification for the phase of the moon.
-.SH STANDARDS
-.B Strftime
-conforms to ANSI X3.159-1989 (``ANSI C'').
-The ``%s'' conversion specification is an extension.
index 33a8994..b333512 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)string.3    6.8 (Berkeley) %G%
+.\"     @(#)string.3   6.9 (Berkeley) %G%
 .\"
 .\"
-.TH STRING 3 ""
-.UC 4
-.SH NAME
-strcat, strncat, strchr, strrchr, strcmp, strncmp, strcasecmp,
-strncasecmp, strcpy, strncpy, strerror, strlen, strpbrk, strsep,
-strspn, strcspn, strstr, strtok, index, rindex \- string operations
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strcat(char *s, const char * append);
-
-char *
-strncat(char *s, const char *append, size_t count);
-
-char *
-strchr(const char *s, int c);
-
-char *
-strrchr(const char *s, int c);
-
-strcmp(const char *s1, const char *s2);
-
-strncmp(const char *s1, const char *s2, size_t count);
-
-strcasecmp(const char *s1, const char *s2);
-
-strncasecmp(const char *s1, const char *s2, size_t count);
-
-char *
-strcpy(char *dst, const char *src);
-
-char *
-strncpy(char *dst, const char *src, size_t count);
-
-char *
-strerror(int errno);
-
-size_t
-strlen(const char *s);
-
-char *
-strpbrk(const char *s, const char *charset);
-
-char *
-strsep(char **stringp, const char *delim);
-
-size_t
-strspn(const char *s, const char *charset);
-
-size_t
-strcspn(const char *s, const char *charset);
-
-char *
-strstr(const char *big, const char *little);
-
-char *
-strtok(char *s, const char *delim);
-
-char *
-index(const char *s, int c);
-
-char *
-rindex(const char *s, int c);
-.ft R
-.fi
-.SH DESCRIPTION
-These functions operate on null-terminated strings.
-.PP
+.Dd 
+.Dt STRING 3
+.Os BSD 4
+.Sh NAME
+.Nm strcat ,
+.Nm strncat ,
+.Nm strchr ,
+.Nm strrchr ,
+.Nm strcmp ,
+.Nm strncmp ,
+.Nm strcasecmp,
+.Nm strncasecmp ,
+.Nm strcpy ,
+.Nm strncpy ,
+.Nm strerror ,
+.Nm strlen ,
+.Nm strpbrk ,
+.Nm strsep,
+.Nm strspn ,
+.Nm strcspn ,
+.Nm strstr ,
+.Nm strtok ,
+.Nm index ,
+.Nm rindex
+.Nd string specific functions
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strcat "char *s" "const char * append"
+.Ft char *
+.Fn strncat "char *s" "const char *append" "size_t count"
+.Ft char *
+.Fn strchr "const char *s" "int c"
+.Ft char *
+.Fn strrchr "const char *s" "int c"
+.Ft int
+.Fn strcmp "const char *s1" "const char *s2"
+.Ft int
+.Fn strncmp "const char *s1" "const char *s2" "size_t count"
+.Ft int
+.Fn strcasecmp "const char *s1" "const char *s2"
+.Ft int
+.Fn strncasecmp "const char *s1" "const char *s2" "size_t count"
+.Ft char *
+.Fn strcpy "char *dst" "const char *src"
+.Ft char *
+.Fn strncpy "char *dst" "const char *src" "size_t count"
+.Ft char *
+.Fn strerror "int errno"
+.Ft size_t
+.Fn strlen "const char *s"
+.Ft char *
+.Fn strpbrk "const char *s" "const char *charset"
+.Ft char *
+.Fn strsep "char **stringp" "const char *delim"
+.Ft size_t
+.Fn strspn "const char *s" "const char *charset"
+.Ft size_t
+.Fn strcspn "const char *s" "const char *charset"
+.Ft char *
+.Fn strstr "const char *big" "const char *little"
+.Ft char *
+.Fn strtok "char *s" "const char *delim"
+.Ft char *
+.Fn index "const char *s" "int c"
+.Ft char *
+.Fn rindex "const char *s" "int c"
+.Sh DESCRIPTION
+The string functions
+functions manipulate strings terminated by a
+null byte.
+.Pp
 See the specific manual pages for more information.
 See the specific manual pages for more information.
-.PP
+For manipulating variable length generic objects as byte
+strings (without the null byte check), see
+.Xr bstring 3 .
+.Pp
 Except as noted in their specific manual pages,
 Except as noted in their specific manual pages,
-they do not check for overflow of any destination
-string.
-.SH SEE\ ALSO
-index(3), strcat(3), strchr(3), strrchr(3), strcmp(3), strcasecmp(3),
-strcpy(3), strerror(3), strlen(3), strpbrk(3), strsep(3), strspn(3),
-strcspn(3), strstr(3), strtok(3), rindex(3)
-.SH STANDARDS
-.IR Strcat ,
-.IR strncat ,
-.IR strchr ,
-.IR strrchr ,
-.IR strcmp ,
-.IR strncmp ,
-.IR strcpy ,
-.IR strncpy ,
-.IR strerror ,
-.IR strlen ,
-.IR strpbrk ,
-.IR strsep ,
-.IR strspn ,
-.IR strcspn ,
-.IR strstr ,
+the string functions do not test the destination
+for size limitations.
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr strcat 3 ,
+.Xr strchr 3 ,
+.Xr strrchr 3 ,
+.Xr strcmp 3 ,
+.Xr strcasecmp 3 ,
+.Xr strcpy 3 ,
+.Xr strerror 3 ,
+.Xr strlen 3 ,
+.Xr strpbrk 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strcspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3 ,
+.Xr rindex 3
+.Xr bstring 3
+.Sh STANDARDS
+The
+.Fn strcat ,
+.Fn strncat ,
+.Fn strchr ,
+.Fn strrchr ,
+.Fn strcmp ,
+.Fn strncmp ,
+.Fn strcpy ,
+.Fn strncpy ,
+.Fn strerror ,
+.Fn strlen ,
+.Fn strpbrk ,
+.Fn strsep ,
+.Fn strspn ,
+.Fn strcspn ,
+.Fn strstr ,
 and
 and
-.IR strtok
-conform to ANSI X3.159-1989 (``ANSI C'').
+.Fn strtok
+functions
+conform to
+.St -ansiC .
index a9bd7f2..3a233c7 100644 (file)
@@ -1,32 +1,42 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strlen.3    5.1 (Berkeley) %G%
+.\"     @(#)strlen.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRLEN 3 ""
-.UC 4
-.SH NAME
-strlen \- find length of string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-size_t
-strlen(const char *s);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strlen
-returns the number of non-null characters in
-.IR s .
-.SH SEE ALSO
-string(3)
-.SH STANDARDS
-.B Strlen
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Dd 
+.Dt STRLEN 3
+.Os
+.Sh NAME
+.Nm strlen
+.Nd find length of string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft size_t
+.Fn strlen "const char *s"
+.Sh DESCRIPTION
+The
+.Fn strlen
+function
+computes the length of the string
+.Fa s .
+.Sh RETURN VALUES
+The
+.Fn strlen
+function
+returns
+the number of characters that precede the
+terminating
+.Dv NUL
+character.
+.Sh SEE ALSO
+.Xr string 3
+.Sh STANDARDS
+The
+.Fn strlen
+function
+conforms to
+.St -ansiC .
index f7b1f5d..c1aa924 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strmode.3   5.1 (Berkeley) %G%
+.\"     @(#)strmode.3  5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRMODE 3 ""
-.UC 7
-.SH NAME
-strmode \- convert inode status information into a symbolic string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void
-strmode(mode_t mode, char *bp);
-.ft R
-.fi
-.SH DESCRIPTION
-.I Strmode
+.Dd 
+.Dt STRMODE 3
+.Os
+.Sh NAME
+.Nm strmode
+.Nd convert inode status information into a symbolic string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void
+.Fn strmode "mode_t mode" "char *bp"
+.Sh DESCRIPTION
+The
+.Fn strmode
+function
 converts a file
 converts a file
-.I mode
+.Fa mode
 (the type and permission information associated with an inode, see
 (the type and permission information associated with an inode, see
-.IR stat (2))
+.Xr stat 2 )
 into a symbolic string which is stored in the location referenced by
 into a symbolic string which is stored in the location referenced by
-.IR bp .
+.Fa bp .
 This stored string is eleven characters in length plus a trailing NULL.
 This stored string is eleven characters in length plus a trailing NULL.
-.PP
+.Pp
 The first character is the inode type, and will be one of the following:
 The first character is the inode type, and will be one of the following:
-.TP
-\-
+.Bl -tag -width xxxx
+.It \-
 regular file
 regular file
-.br
-.ns
-.TP
-b
+.It b
 block special
 block special
-.br
-.ns
-.TP
-c
+.It c
 character special
 character special
-.br
-.ns
-.TP
-d
+.It d
 directory
 directory
-.br
-.ns
-.TP
-l
+.It l
 symbolic link
 symbolic link
-.br
-.ns
-.TP
-p
+.It p
 fifo
 fifo
-.br
-.ns
-.TP
-s
+.It s
 socket
 socket
-.br
-.ns
-.TP
-?
+.It ?
 unknown inode type
 unknown inode type
-.PP
+.El
+.Pp
 The next nine characters encode three sets of permissions, in three
 characters each.
 The first three characters are the permissions for the owner of the
 file, the second three for the group the file belongs to, and the
 third for the ``other'', or default, set of users.
 The next nine characters encode three sets of permissions, in three
 characters each.
 The first three characters are the permissions for the owner of the
 file, the second three for the group the file belongs to, and the
 third for the ``other'', or default, set of users.
-.PP
+.Pp
 Permission checking is done as specifically as possible.
 If read permission is denied to the owner of a file in the first set
 of permssions, the owner of the file will not be able to read the file.
 This is true even if the owner is in the file's group and the group
 permissions allow reading or the ``other'' permissions allow reading.
 Permission checking is done as specifically as possible.
 If read permission is denied to the owner of a file in the first set
 of permssions, the owner of the file will not be able to read the file.
 This is true even if the owner is in the file's group and the group
 permissions allow reading or the ``other'' permissions allow reading.
-.PP
+.Pp
 If the first character of the three character set is an ``r'', the file is
 readable for that set of users; if a dash ``\-'', it is not readable.
 If the first character of the three character set is an ``r'', the file is
 readable for that set of users; if a dash ``\-'', it is not readable.
-.PP
+.Pp
 If the second character of the three character set is a ``w'', the file is
 writable for that set of users; if a dash ``\-'', it is not writable.
 If the second character of the three character set is a ``w'', the file is
 writable for that set of users; if a dash ``\-'', it is not writable.
-.PP
+.Pp
 The third character is the first of the following characters that apply:
 The third character is the first of the following characters that apply:
-.TP
-S
+.Bl -tag -width xxxx
+.It S
 If the character is part of the owner permissions and the file is not
 executable or the directory is not searchable, by the owner, and the
 set-user-id bit is set.
 If the character is part of the owner permissions and the file is not
 executable or the directory is not searchable, by the owner, and the
 set-user-id bit is set.
-.TP
-S
+.It S
 If the character is part of the group permissions and the file is not
 executable or the directory is not searchable, by the group, and the
 set-group-id bit is set.
 If the character is part of the group permissions and the file is not
 executable or the directory is not searchable, by the group, and the
 set-group-id bit is set.
-.TP
-T
+.It T
 If the character is part of the other permissions and the file is not
 executable or the directory is not searchable, by others, and the ``sticky''
 If the character is part of the other permissions and the file is not
 executable or the directory is not searchable, by others, and the ``sticky''
-(S_ISVTX) bit is set.
-.TP
-s
+.Pq Dv S_ISVTX
+bit is set.
+.It s
 If the character is part of the owner permissions and the file is
 executable or the directory searchable, by the owner, and the set-user-id
 bit is set.
 If the character is part of the owner permissions and the file is
 executable or the directory searchable, by the owner, and the set-user-id
 bit is set.
-.TP
-s
+.It s
 If the character is part of the group permissions and the file is
 executable or the directory searchable, by the group, and the set-group-id
 bit is set.
 If the character is part of the group permissions and the file is
 executable or the directory searchable, by the group, and the set-group-id
 bit is set.
-.TP
-t
+.It t
 If the character is part of the other permissions and the file is
 executable or the directory searchable, by others, and the ``sticky''
 If the character is part of the other permissions and the file is
 executable or the directory searchable, by others, and the ``sticky''
-(S_ISVTX) bit is set.
-.TP
-x
+.Pq Dv S_ISVTX
+bit is set.
+.It x
 The file is executable or the directory is searchable.
 The file is executable or the directory is searchable.
-.TP
-\-
+.It \-
 None of the above apply.
 None of the above apply.
-.PP
+.El
+.Pp
 The last character is a plus sign ``+'' if any there are any alternate
 or additional access control methods associated with the inode, otherwise
 it will be a space.
 The last character is a plus sign ``+'' if any there are any alternate
 or additional access control methods associated with the inode, otherwise
 it will be a space.
-.SH RETURN VALUE
-.I Strmode
+.Sh RETURN VALUES
+The
+.Fn strmode
+function
 always returns 0.
 always returns 0.
-.SH SEE ALSO
-chmod(1), find(1), stat(2), getmode(3), setmode(3)
+.Sh SEE ALSO
+.Xr chmod 1 ,
+.Xr find 1 ,
+.Xr stat 2 ,
+.Xr getmode 3 ,
+.Xr setmode 3
+.Sh HISTORY
+The
+.Fn strmode
+function
+.Ud .
index 1973ca2..3d4e989 100644 (file)
@@ -1,42 +1,51 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strpbrk.3   5.1 (Berkeley) %G%
+.\"     @(#)strpbrk.3  5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRPBRK 3 ""
-.UC 7
-.SH NAME
-strpbrk \- locate multiple characters in string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strpbrk(const char *s, const char *charset);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strpbrk
+.Dd 
+.Dt STRPBRK 3
+.Os
+.Sh NAME
+.Nm strpbrk
+.Nd locate multiple characters in string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strpbrk "const char *s" "const char *charset"
+.Sh DESCRIPTION
+The
+.Fn strpbrk
+function
 locates in the null-terminated string
 locates in the null-terminated string
-.I s
+.Fa s
 the first occurrence of any character in the string
 the first occurrence of any character in the string
-.I charset
+.Fa charset
 and returns a pointer to this character.
 If no characters from
 and returns a pointer to this character.
 If no characters from
-.I charset
+.Fa charset
 occur anywhere in
 occur anywhere in
-.IR s ,
-.I strpbrk
+.Fa s
+.Fn strpbrk
 returns NULL.
 returns NULL.
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strrchr(3),
-strsep(3), strspn(3), strstr(3), strtok(3)
-.SH STANDARDS
-.B Strpbrk
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh STANDARDS
+The
+.Fn strpbrk
+function
+conforms to
+.St -ansiC .
index 70edbc5..1fb729d 100644 (file)
@@ -1,46 +1,62 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strrchr.3   5.1 (Berkeley) %G%
+.\"     @(#)strrchr.3  5.2 (Berkeley) %G%
 .\"
 .\"
-.TH STRRCHR 3 ""
-.UC 7
-.SH NAME
-strrchr \- locate character in string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strrchr(const char *s, int c);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strrchr
-returns a pointer to the last occurrence of character 
-.I c
-(converted to a
-.BR char )
-in the null-terminated string
-.IR s ,
-or NULL if
-.I c
-does not occur anywhere in
-.IR s .
+.Dd 
+.Dt STRRCHR 3
+.Os
+.Sh NAME
+.Nm strrchr
+.Nd locate character in string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strrchr "const char *s" "int c"
+.Sh DESCRIPTION
+The
+.Fn strrchr
+function
+locates the last occurrence of
+.Fa c
+(converted to a char)
+in the string
+.Fa s .
 If
 If
-.I c
-is '\e0',
-.B strrchr
-locates the terminating '\e0'.
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), 
-strsep(3), strspn(3), strstr(3), strtok(3)
-.SH STANDARDS
-.B Strrchr
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Fa c
+is
+.Ql \e0 ,
+.Fn strrchr
+locates the terminating
+.Ql \e0 .
+.Sh RETURN VALUES
+The
+.Fn strrchr
+function
+returns a pointer to the character,
+or a null
+pointer if
+.Fa c
+does not occur anywhere in
+.Fa s .
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh STANDARDS
+The
+.Fn strrchr
+function
+conforms to
+.St -ansiC .
index 68b4e84..5f9c2fc 100644 (file)
@@ -1,61 +1,65 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strsep.3    5.1 (Berkeley) %G%
+.\"     @(#)strsep.3   5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRSEP 3 ""
-.UC 7
-.SH NAME
-strsep \- separate strings
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strsep(char **stringp, char *delim);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strsep
+.Dd 
+.Dt STRSEP 3
+.Os
+.Sh NAME
+.Nm strsep
+.Nd separate strings
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strsep "char **stringp" "char *delim"
+.Sh DESCRIPTION
+The
+.Fn strsep
 locates in the null-terminated string at
 locates in the null-terminated string at
-.I *stringp
+.Fa *stringp
 the first occurence of any character in
 the first occurence of any character in
-.I delim
-and replaces this with a '\e0',
+.Fa delim
+and replaces this with a
+.Ql \e0 ,
 records the location of the immediate following character in
 records the location of the immediate following character in
-.IR *stringp ,
+.Fa *stringp ,
 then returns the original value of
 then returns the original value of
-.IR *stringp .
+.Fa *stringp .
 If no delimiter characters are found,
 If no delimiter characters are found,
-.B strsep
+.Fn strsep
 sets
 sets
-.I *stringp
-to NULL;
+.Fa *stringp
+to
+.Dv NULL ;
 if
 if
-.I *stringp
-is initially NULL,
-.B strsep
-returns NULL.
-.SH EXAMPLES
+.Fa *stringp
+is initially
+.Dv NULL ,
+.Fn strsep
+returns
+.Dv NULL .
+.Sh EXAMPLES
 The following uses
 The following uses
-.I strsep
+.Fn strsep
 to parse strings containing runs of white space,
 making up an argument vector:
 to parse strings containing runs of white space,
 making up an argument vector:
-.sp
-.nf
-.RS
+.Bd -literal -offset indent
 char inputstring[100];
 char **argv[51], **ap = argv, *p, *val;
 char inputstring[100];
 char **argv[51], **ap = argv, *p, *val;
-.I "/* set up inputstring */"
+/* set up inputstring */
 for (p = inputstring; p != NULL; ) {
 for (p = inputstring; p != NULL; ) {
-    while ((val = strsep(&p, " \et")) != NULL && *val == '\e0');
-    *ap++ = val;
+       while ((val = strsep(&p, " \et")) != NULL && *val == '\e0');
+       *ap++ = val;
 }
 *ap = 0;
 }
 *ap = 0;
-.RE
+.Ed
+.Sh HISTORY
+The
+.Fn strsep
+function is
+.Ud .
index 57c357f..135864c 100644 (file)
@@ -1,39 +1,51 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strspn.3    5.1 (Berkeley) %G%
+.\"     @(#)strspn.3   5.2 (Berkeley) %G%
 .\"
 .\"
-.TH STRSPN 3 ""
-.UC 7
-.SH NAME
-strspn \- span a string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-size_t
-strspn(const char *s, const char *charset);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strcspn
+.Dd 
+.Dt STRSPN 3
+.Os
+.Sh NAME
+.Nm strspn
+.Nd span a string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft size_t
+.Fn strspn "const char *s" "const char *charset"
+.Sh DESCRIPTION
+The
+.Xr strcspn
+function
 spans the initial part of the null-terminated string
 spans the initial part of the null-terminated string
-.I s
+.Fa s
 as long as the characters from
 as long as the characters from
-.I s
+.Fa s
 occur in string
 occur in string
-.IR charset .
-.B Strspn
+.Fa charset .
+.Sh RETURN VALUES
+The
+.Fn strspn
+function
 returns the number of characters spanned.
 returns the number of characters spanned.
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3),
-strsep(3), strstr(3), strtok(3)
-.SH STANDARDS
-.B Strspn
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strstr 3 ,
+.Xr strtok 3
+.Sh STANDARDS
+The
+.Fn strspn
+function
+conforms to
+.St -ansiC .
index a8d67ea..b852128 100644 (file)
@@ -1,51 +1,60 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strstr.3    5.1 (Berkeley) %G%
+.\"     @(#)strstr.3   5.2 (Berkeley) %G%
 .\"
 .\"
-.TH STRSTR 3 ""
-.UC 7
-.SH NAME
-strstr \- locate a substring in a string
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strstr(const char *big, const char *little);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strstr
+.Dd 
+.Dt STRSTR 3
+.Os
+.Sh NAME
+.Nm strstr
+.Nd locate a substring in a string
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strstr "const char *big" "const char *little"
+.Sh DESCRIPTION
+The
+.Fn strstr
+function
 locates the first occurrence of the null-terminated string
 locates the first occurrence of the null-terminated string
-.I little
+.Fa little
 in the null-terminated string
 in the null-terminated string
-.IR big .
+.Fa big .
 If
 If
-.I little
+.Fa little
 is the empty string,
 is the empty string,
-.B strstr
+.Fn strstr
 returns
 returns
-.IR big ;
+.Fa big ;
 if
 if
-.I little
+.Fa little
 occurs nowhere in
 occurs nowhere in
-.IR big ,
-.B strstr
+.Fa big ,
+.Fn strstr
 returns NULL;
 otherwise
 returns NULL;
 otherwise
-.B strstr
+.Fn strstr
 returns a pointer to the first character of the first occurrence of
 returns a pointer to the first character of the first occurrence of
-.IR little .
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3),
-strsep(3), strspn(3), strtok(3)
-.SH STANDARDS
-.B Strstr
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Fa little .
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strtok 3
+.Sh STANDARDS
+The
+.Fn strstr
+function
+conforms to
+.St -ansiC .
index 92be92c..aff556c 100644 (file)
@@ -1,64 +1,81 @@
-.\" Copyright (c) 1988 The Regents of the University of California.
+.\" Copyright (c) 1988, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strtok.3    5.5 (Berkeley) %G%
+.\"     @(#)strtok.3   5.7 (Berkeley) %G%
 .\"
 .\"
-.TH STRTOK 3 ""
-.UC 3
-.SH NAME
-strtok, strsep \- string token operations
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-char *
-strtok(char *str, const char *sep);
-.ft R
-.fi
-.SH DESCRIPTION
-.ft B
+.Dd 
+.Dt STRTOK 3
+.Os BSD 3
+.Sh NAME
+.Nm strtok ,
+.Nm strsep
+.Nd string token operations
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft char *
+.Fn strtok "char *str" "const char *sep"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is obsoleted by strsep(3).
 This interface is obsoleted by strsep(3).
-.ft R
-.PP
-.I Strtok
+.Ef
+.Pp
+The
+.Fn strtok
+function
 is used to isolate sequential tokens in a null-terminated string,
 is used to isolate sequential tokens in a null-terminated string,
-.IR str .
-These tokens are separated in the string by
-.B "one or more"
-of the characters in
-.IR sep .
+.Fa str .
+These tokens are separated in the string by at least one of the
+characters in
+.Fa sep .
 The first time that
 The first time that
-.I strtok
+.Fn strtok
 is called,
 is called,
-.I str
+.Fa str
 should be specified; subsequent calls, wishing to obtain further tokens
 from the same string, should pass a null pointer instead.
 The separator string,
 should be specified; subsequent calls, wishing to obtain further tokens
 from the same string, should pass a null pointer instead.
 The separator string,
-.IR sep ,
+.Fa sep ,
 must be supplied each time, and may change between calls.
 must be supplied each time, and may change between calls.
-.PP
-.I Strtok
-returns a pointer to the start of each subsequent token in the string,
-after replacing the token itself with a NUL character.
+.Pp
+The
+.Fn strtok
+function
+returns a pointer to the beginning of each subsequent token in the string,
+after replacing the token itself with a
+.Dv NUL
+character.
 When no more tokens remain, a null pointer is returned.
 When no more tokens remain, a null pointer is returned.
-.SH SEE ALSO
-index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3),
-strsep(3), strspn(3), strstr(3)
-.SH STANDARDS
-.B Strtok
-conforms to ANSI X3.159-1989 (``ANSI C'').
-.SH BUGS
+.Sh SEE ALSO
+.Xr index 3 ,
+.Xr memchr 3 ,
+.Xr rindex 3 ,
+.Xr strchr 3 ,
+.Xr strcspn 3 ,
+.Xr strpbrk 3 ,
+.Xr strrchr 3 ,
+.Xr strsep 3 ,
+.Xr strspn 3 ,
+.Xr strstr 3
+.Sh STANDARDS
+The
+.Fn strtok
+function
+conforms to
+.St -ansiC .
+.Sh BUGS
 There is no way to get tokens from multiple strings simultaneously.
 There is no way to get tokens from multiple strings simultaneously.
-.PP
+.Pp
 The System V
 The System V
-.B strtok
-will, if handed a string containing only delimiter characters,
-not alter the next starting point, so that a call to
-.B strtok
+.Fn strtok ,
+if handed a string containing only delimiter characters,
+will not alter the next starting point, so that a call to
+.Fn strtok
 with a different (or empty) delimiter string
 with a different (or empty) delimiter string
-may return a non-NULL value.
+may return a
+.Pf non- Dv NULL
+value.
 Since this implementation always alters the next starting point,
 Since this implementation always alters the next starting point,
-such a sequence of calls would always return NULL.
+such a sequence of calls would always return
+.Dv NULL .
index e60ed23..fc2c4b0 100644 (file)
@@ -1,31 +1,40 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Chris Torek.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)strxfrm.3   5.2 (Berkeley) %G%
+.\"     @(#)strxfrm.3  5.3 (Berkeley) %G%
 .\"
 .\"
-.TH STRXFRM 3 ""
-.UC 7
-strxfrm \- transform a string under locale
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-size_t
-strxfrm(char *dst, const char *src, size_t n);
-.ft R
-.fi
-.SH DESCRIPTION
-.B Strxfrm
-does something horrible (see ANSI standard).
+.Dd 
+.Dt STRXFRM 3
+.Os
+.Sh NAME
+.Nm strxfrm
+.Nd transform a string under locale
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft size_t
+.Fn strxfrm "char *dst" "const char *src" "size_t n"
+.Sh DESCRIPTION
+The
+.Fn strxfrm
+function
+does something horrible (see
+.Tn ANSI
+standard).
 In this implementation it just copies.
 In this implementation it just copies.
-.SH SEE ALSO
-bcmp(3), memcmp(3), setlocale(3), strcasecmp(3), strcmp(3), strcoll(3)
-.SH STANDARDS
-.B Strxfrm
-conforms to ANSI X3.159-1989 (``ANSI C'').
+.Sh SEE ALSO
+.Xr bcmp 3 ,
+.Xr memcmp 3 ,
+.\" .Xr setlocale 3 ,
+.Xr strcasecmp 3 ,
+.Xr strcmp 3 ,
+.Xr strcoll 3
+.Sh STANDARDS
+The
+.Fn strxfrm
+function
+conforms to
+.St -ansiC .
index 38d7ae8..5f688fa 100644 (file)
@@ -1,36 +1,39 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)swab.3      6.3 (Berkeley) %G%
+.\"     @(#)swab.3     6.5 (Berkeley) %G%
 .\"
 .\"
-.TH SWAB 3  ""
-.AT 3
-.nf
-.SH NAME
-swab \- swap bytes
-.SH SYNOPSIS
-.nf
-.ft B
-#include <string.h>
-
-void
-swab(const char *src, char *dst, size_t len);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt SWAB 3
+.Os
+.Sh NAME
+.Nm swab
+.Nd swap adjacent bytes
+.Sh SYNOPSIS
+.Fd #include <string.h>
+.Ft void
+.Fn swab "const char *src" "char *dst" "size_t len"
+.Sh DESCRIPTION
 The function
 The function
-.I swab
+.Fn swab
 copies
 copies
-.I len
+.Fa len
 bytes from the location referenced by
 bytes from the location referenced by
-.I src
+.Fa src
 to the location referenced by
 to the location referenced by
-.IR dst ,
+.Fa dst ,
 swapping adjacent bytes.
 swapping adjacent bytes.
-.PP
-.I Len
-should be even.
-.SH SEE ALSO
-bzero(3), memset(3)
+.Pp
+The argument
+.Fa len
+must be even number.
+.Sh SEE ALSO
+.Xr bzero 3 ,
+.Xr memset 3
+.Sh HISTORY
+A
+.Fn swab
+function appeared in
+.At v7 .
index 6bf84a4..b0eccc3 100644 (file)
@@ -1,53 +1,73 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)setuid.2    6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SETUID 3 "" 
-.UC 5
-.SH NAME
-setuid, seteuid, setruid, setgid, setegid, setrgid \- set user and group ID
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-.PP
-.ft B
-.nf
-setuid(uid)
-seteuid(euid)
-setruid(ruid)
-uid_t uid, euid, ruid;
-.PP
-.ft B
-.nf
-setgid(gid)
-setegid(egid)
-setrgid(rgid)
-gid_t gid, egid, rgid;
-.fi
-.SH DESCRIPTION
-.I Setuid
-.RI ( setgid )
+.\"     @(#)setuid.2   6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SETUID 3
+.Os BSD 4.2
+.Sh NAME
+.Nm setuid ,
+.Nm seteuid ,
+.Nm setruid ,
+.Nm setgid ,
+.Nm setegid ,
+.Nm setrgid
+.Nd set user and group ID
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft int
+.Fn setuid "uid_t uid"
+.Ft int
+.Fn seteuid "uid_t euid"
+.Ft int
+.Fn setruid "uid_t ruid"
+.Ft int
+.Fn setgid "gid_t gid"
+.Ft int
+.Fn setegid "gid_t egid"
+.Ft int
+.Fn setrgid "gid_t rgid"
+.Sh DESCRIPTION
+The
+.Fn setuid
+function
+.Pq Fn setgid
 sets both the real and effective
 sets both the real and effective
-user ID (group ID) of the current process to
+user ID (group ID) of the current process
 as specified.
 as specified.
-.PP
-.I Seteuid
-.RI ( setegid )
+.Pp
+The
+.Fn seteuid
+function
+.Pq Fn setegid
 sets the effective user ID (group ID) of the
 current process.
 sets the effective user ID (group ID) of the
 current process.
-.PP
-.I Setruid
-.RI ( setrgid )
+.Pp
+The
+.Fn setruid
+function
+.Pq Fn setrgid
 sets the real user ID (group ID) of the
 current process.
 sets the real user ID (group ID) of the
 current process.
-.PP
-These calls are only permitted to the super-user
-or if the argument is the real or effective ID.
-.SH "SEE ALSO"
-setreuid(2), setregid(2), getuid(2), getgid(2)
-.SH DIAGNOSTICS
-Zero is returned if the user (group) ID is set;
-\-1 is returned otherwise.
+.Sh RETURN VALUES
+Upon success, these functions return 0;
+otherwise \-1 is returned.
+.Pp
+If the user is not the super user, or the uid
+specified is not the real or effective ID, these
+functions return \-1.
+.Sh SEE ALSO
+.Xr setreuid 2 ,
+.Xr setregid 2 ,
+.Xr getuid 2 ,
+.Xr getgid 2
+.Sh HISTORY
+A
+.Fn setuid
+and
+.Fn setgid
+syscall appeared in 
+.At v6 .
index bb86fb6..15334d2 100644 (file)
@@ -1,43 +1,58 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)ftime.3     6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH FTIME 3C ""
-.UC 4
-.SH NAME
-ftime \- get date and time
-.SH SYNOPSIS
-.nf
-.B #include <sys/types.h>
-.B #include <sys/timeb.h>
-
-.B ftime(tp)
-.B struct timeb *tp;
-.fi
-.SH DESCRIPTION
-.ft B
+.\"     @(#)ftime.3    6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt FTIME 3
+.Os BSD 4
+.Sh NAME
+.Nm ftime
+.Nd get date and time
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/timeb.h>
+.Ft struct timeb *
+.Fn ftime "struct timeb *tp"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is obsoleted by gettimeofday(2).
 This interface is obsoleted by gettimeofday(2).
-.br
+.Pp
 It is available from the compatibility library, libcompat.
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
+.Ef
+.Pp
 The
 The
-.I ftime
+.Fn ftime
 routine fills in a structure pointed to by its argument,
 as defined by
 routine fills in a structure pointed to by its argument,
 as defined by
-.RI < sys/timeb.h >:
-.PP
-.ta .5i +\w'unsigned 'u
-.nf
-.so /usr/include/sys/timeb.h
-.fi
-.PP
+.Aq Pa sys/timeb.h :
+.Bd -literal -offset indent
+/*
+ * Structure returned by ftime system call
+ */
+struct timeb
+{
+         time_t  time;
+         unsigned short millitm;
+         short   timezone;
+         short   dstflag;
+};
+.Ed
+.Pp
 The structure contains the time since the epoch in seconds,
 up to 1000 milliseconds of more-precise interval,
 the local time zone (measured in minutes of time westward from Greenwich),
 and a flag that, if nonzero, indicates that
 Daylight Saving time applies locally during the appropriate part of the year.
 The structure contains the time since the epoch in seconds,
 up to 1000 milliseconds of more-precise interval,
 the local time zone (measured in minutes of time westward from Greenwich),
 and a flag that, if nonzero, indicates that
 Daylight Saving time applies locally during the appropriate part of the year.
-.SH "SEE ALSO"
-gettimeofday(2), settimeofday(2), time(2), ctime(3)
+.Sh SEE ALSO
+.Xr gettimeofday 2 ,
+.Xr settimeofday 2 ,
+.Xr time 2 ,
+.Xr ctime 3
+.Sh HISTORY
+The
+.Nm
+function appeared in 
+.Bx 4.2 .
index 5c2402d..b85f25b 100644 (file)
@@ -1,36 +1,52 @@
-.\"    @(#)getpw.3     6.3 (Berkeley) %G%
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH GETPW 3  ""
-.AT 3
-.SH NAME
-getpw \- get name from uid
-.SH SYNOPSIS
-.nf
-.B getpw(uid, buf)
-.B char *buf;
-.fi
-.SH DESCRIPTION
-.ft B
-Getpw is made obsolete by getpwuid(3).
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)getpw.3    6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETPW 3
+.Os
+.Sh NAME
+.Nm getpw
+.Nd get name from uid
+.Sh SYNOPSIS
+.Fn getpw uid "char *buf"
+.Sh DESCRIPTION
+.Bf -symbolic
+The getpw function is made obsolete by getpwuid(3).
 .br
 It is available from the compatibility library, libcompat.
 .br
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
-.I Getpw
-searches the password file for
-the (numerical)
-.IR uid ", and fills in " "buf"
-with the corresponding line;
-it returns non-zero if
-.IR uid ""
-could not
-be found.
-The line is null-terminated.
-.SH FILES
-/etc/passwd
-.SH "SEE ALSO"
-getpwent(3),
-passwd(5)
-.SH DIAGNOSTICS
-Non-zero
-return on error.
+.Ef
+.Pp
+The
+.Fn getpw
+function reads the file
+.Pa /etc/passwd ,
+and if it finds
+the specified
+.Fa uid ,
+copies the password entry line into the string pointed to by
+.Fa buf .
+the null terminated entry line from the password database,
+and appends the
+.Dv NUL
+character.
+.Sh RETURN VALUES
+The
+.Fn getpw
+function returns the zero if successful, otherwise 
+a non-zero if the entry does not exist.
+.Sh FILES
+.Bl -tag -width /etc/passwd - compact
+.It Pa /etc/passwd
+.El
+.Sh SEE ALSO
+.Xr getpwent 3 ,
+.Xr passwd 5
+.Sh HISTORY
+A
+.Fn getpw
+function appeared in
+.At v6 .
index d63e632..83d3ec8 100644 (file)
@@ -1,58 +1,67 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)stty.3      6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH STTY 3C ""
-.UC 5
-.SH NAME
-stty, gtty \- set and get terminal state (defunct)
-.SH SYNOPSIS
-.nf
-.B #include <sgtty.h>
-.sp
-.B stty(fd, buf)
-.B int fd;
-.B struct sgttyb *buf;
-.sp
-.B gtty(fd, buf)
-.B int fd;
-.B struct sgttyb *buf;
-.fi
-.SH DESCRIPTION
-.ft B
+.\"     @(#)stty.3     6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt STTY 3
+.Os BSD 4.2
+.Sh NAME
+.Nm stty ,
+.Nm gtty
+.Nd set and get terminal state (defunct)
+.Sh SYNOPSIS
+.Fd #include <sgtty.h>
+.Fn stty "int fd" "struct sgttyb *buf"
+.Fn gtty "int fd" "struct sgttyb *buf"
+.Sh DESCRIPTION
+.Bf -symbolic
 These interfaces are obsoleted by ioctl(2).
 These interfaces are obsoleted by ioctl(2).
-.br
 They are available from the compatibility library, libcompat.
 They are available from the compatibility library, libcompat.
-.ft R
-.PP
-.I Stty
+.Ef
+.Pp
+The
+.Fn stty
+function
 sets the state of the terminal associated with
 sets the state of the terminal associated with
-.IR fd .
-.I Gtty
+.Fa fd .
+The
+.Fn gtty
+function
 retrieves the state of the terminal associated
 with
 retrieves the state of the terminal associated
 with
-.IR fd .
+.Fa fd .
 To set the state of a terminal the call must have
 write permission.
 To set the state of a terminal the call must have
 write permission.
-.PP
+.Pp
 The
 The
-.I stty
-call is actually ``ioctl(fd, TIOCSETP, buf)'', while
+.Fn stty
+call is actually
+.Ql ioctl(fd, TIOCSETP, buf) ,
+while
 the
 the
-.I gtty
-call is ``ioctl(fd, TIOCGETP, buf)''.
+.Fn gtty
+call is
+.Ql ioctl(fd, TIOCGETP, buf) .
 See 
 See 
-.IR ioctl (2)
+.Xr ioctl 2
 and
 and
-.IR tty (4)
+.Xr tty 4
 for an explanation.
 for an explanation.
-.SH DIAGNOSTICS
+.Sh DIAGNOSTICS
 If the call is successful 0 is returned, otherwise \-1 is
 returned and the global variable
 If the call is successful 0 is returned, otherwise \-1 is
 returned and the global variable
-.I errno
+.Va errno
 contains the reason for the failure.
 contains the reason for the failure.
-.SH SEE ALSO
-ioctl(2),
-tty(4)
+.Sh SEE ALSO
+.Xr ioctl 2 ,
+.Xr tty 4
+.Sh HISTORY
+The
+.Fn stty
+and
+.Fn gtty
+functions appeared in 
+.Bx 4.2 .
index e3982eb..1ef1fd3 100644 (file)
@@ -1,84 +1,97 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)vlimit.3    6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH VLIMIT 3C ""
-.UC 4
-.SH NAME
-vlimit \- control maximum system resource consumption
-.SH SYNOPSIS
-.B "#include <sys/vlimit.h>"
-.PP
-.B vlimit(resource, value)
-.SH DESCRIPTION
-.ft B
+.\"     @(#)vlimit.3   6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt VLIMIT 3
+.Os BSD 4
+.Sh NAME
+.Nm vlimit
+.Nd control maximum system resource consumption
+.Sh SYNOPSIS
+.Fd #include <sys/vlimit.h>
+.Fn vlimit resource value
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is obsoleted by getrlimit(2).
 This interface is obsoleted by getrlimit(2).
-.br
 It is available from the compatibility library, libcompat.
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
+.Ef
+.Pp
 Limits the consumption by the current process and each process
 it creates to not individually exceed 
 Limits the consumption by the current process and each process
 it creates to not individually exceed 
-.I value
+.Fa value
 on the specified
 on the specified
-.I resource.
+.Fa resource .
 If
 If
-.I value
+.Fa value
 is specified as \-1, then the current limit is returned and the
 limit is unchanged.
 The resources which are currently controllable are:
 is specified as \-1, then the current limit is returned and the
 limit is unchanged.
 The resources which are currently controllable are:
-.TP 15
-LIM_NORAISE
+.Bl -tag -width LIM_NORAISE
+.It Dv LIM_NORAISE
 A pseudo-limit; if set non-zero then the limits may not be raised.
 A pseudo-limit; if set non-zero then the limits may not be raised.
-Only the super-user may remove the \fInoraise\fR restriction.
-.TP 15
-LIM_CPU
+Only the super-user may remove the
+.Em noraise
+restriction.
+.It Dv LIM_CPU
 the maximum
 number of cpu-seconds to be used by each process
 the maximum
 number of cpu-seconds to be used by each process
-.TP 15
-LIM_FSIZE
+.It Dv LIM_FSIZE
 the largest single file which can be created
 the largest single file which can be created
-.TP 15
-LIM_DATA
+.It Dv LIM_DATA
 the maximum growth of the data+stack region via
 the maximum growth of the data+stack region via
-.IR sbrk (2)
+.Xr sbrk 2
 beyond the end of the program text
 beyond the end of the program text
-.TP 15
-LIM_STACK
+.It Dv LIM_STACK
 the maximum
 size of the automatically-extended stack region
 the maximum
 size of the automatically-extended stack region
-.TP 15
-LIM_CORE
+.It Dv LIM_CORE
 the size of the largest core dump that will be created.
 the size of the largest core dump that will be created.
-.TP 15
-LIM_MAXRSS
+.It Dv LIM_MAXRSS
 a soft limit for the amount of physical memory (in bytes) to be given
 to the program.  If memory is tight, the system will prefer to take memory
 a soft limit for the amount of physical memory (in bytes) to be given
 to the program.  If memory is tight, the system will prefer to take memory
-from processes which are exceeding their declared LIM_MAXRSS.
-.PP
+from processes which are exceeding their declared
+.Dv LIM_MAXRSS.
+.El
+.Pp
 Because this information is stored in the per-process information
 this system call must be executed directly by the shell if it
 is to affect all future processes created by the shell;
 Because this information is stored in the per-process information
 this system call must be executed directly by the shell if it
 is to affect all future processes created by the shell;
-.I limit
+.Xr limit
 is thus a built-in command to
 is thus a built-in command to
-.IR csh (1).
-.PP
+.Xr csh 1 .
+.Pp
 The system refuses to extend the data or stack space when the limits
 would be exceeded in the normal way; a
 The system refuses to extend the data or stack space when the limits
 would be exceeded in the normal way; a
-.I break
+.Xr break 2
 call fails if the data space limit is reached, or the process is
 killed when the stack limit is reached (since the stack cannot be
 extended, there is no way to send a signal!).
 call fails if the data space limit is reached, or the process is
 killed when the stack limit is reached (since the stack cannot be
 extended, there is no way to send a signal!).
-.PP
-A file i/o operation which would create a file which is too large
-will cause a signal SIGXFSZ to be generated, this normally terminates
+.Pp
+A file
+.Tn I/O
+operation which would create a file which is too large
+will cause a signal
+.Dv SIGXFSZ
+to be generated, this normally terminates
 the process, but may be caught.
 the process, but may be caught.
-When the cpu time limit is exceeded, a signal SIGXCPU is sent to the
+When the cpu time limit is exceeded, a signal
+.Dv SIGXCPU
+is sent to the
 offending process; to allow it time to process the signal it is
 offending process; to allow it time to process the signal it is
-given 5 seconds grace by raising the cpu time limit.
-.SH SEE ALSO
-csh(1)
-.SH BUGS
-LIM_NORAISE no longer exists.
+given 5 seconds grace by raising the
+.Tn CPU
+time limit.
+.Sh SEE ALSO
+.Xr csh 1
+.Sh HISTORY
+The
+.Fn vlimit
+function appeared in 
+.Bx 4.2 .
+.Sh BUGS
+.Dv LIM_NORAISE
+no longer exists.
index 873a2e8..40e5dc6 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)vtimes.3    6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH VTIMES 3C ""
-.UC 4
-.SH NAME
-vtimes \- get information about resource utilization
-.SH SYNOPSIS
-.nf
-.PP
-.B "#include <sys/vtimes.h>"
-.PP
-.B "vtimes(par_vm, ch_vm)"
-.B "struct vtimes *par_vm, *ch_vm;"
-.fi
-.SH DESCRIPTION
-.ft B
+.\"     @(#)vtimes.3   6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt VTIMES 3
+.Os BSD 4
+.Sh NAME
+.Nm vtimes
+.Nd get information about resource utilization
+.Sh SYNOPSIS
+.Fd #include <sys/vtimes.h>
+.Fn vtimes "struct vtimes *par_vm" "struct vtimes *ch_vm"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is obsoleted by getrusage(2).
 This interface is obsoleted by getrusage(2).
-.br
 It is available from the compatibility library, libcompat.
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
-.I Vtimes
+.Ef
+.Pp
+The
+.Fn vtimes
+function
 returns accounting information for the current process and for
 the terminated child processes of the current
 process.  Either
 returns accounting information for the current process and for
 the terminated child processes of the current
 process.  Either
-.I par_vm
+.Fa par_vm
 or 
 or 
-.I ch_vm
+.Fa ch_vm
 or both may be 0, in which case only the information for the pointers
 which are non-zero is returned.
 or both may be 0, in which case only the information for the pointers
 which are non-zero is returned.
-.PP
+.Pp
 After the call, each buffer contains information as defined by the
 contents of the include file
 After the call, each buffer contains information as defined by the
 contents of the include file
-.I /usr/include/sys/vtimes.h:
-.LP
-.nf
+.Pa /usr/include/sys/vtimes.h :
+.Bd -literal -offset indent
 struct vtimes {
 struct vtimes {
-       int     vm_utime;               /* user time (*HZ) */
-       int     vm_stime;               /* system time (*HZ) */
+       int     vm_utime;       /* user time (*HZ) */
+       int     vm_stime;       /* system time (*HZ) */
        /* divide next two by utime+stime to get averages */
        /* divide next two by utime+stime to get averages */
-       unsigned vm_idsrss;             /* integral of d+s rss */
-       unsigned vm_ixrss;              /* integral of text rss */
-       int     vm_maxrss;              /* maximum rss */
-       int     vm_majflt;              /* major page faults */
-       int     vm_minflt;              /* minor page faults */
-       int     vm_nswap;               /* number of swaps */
-       int     vm_inblk;               /* block reads */
-       int     vm_oublk;               /* block writes */
+       unsigned vm_idsrss;     /* integral of d+s rss */
+       unsigned vm_ixrss;      /* integral of text rss */
+       int     vm_maxrss;      /* maximum rss */
+       int     vm_majflt;      /* major page faults */
+       int     vm_minflt;      /* minor page faults */
+       int     vm_nswap;       /* number of swaps */
+       int     vm_inblk;       /* block reads */
+       int     vm_oublk;       /* block writes */
 };
 };
-.fi
-.PP
+.Ed
+.Pp
 The
 The
-.I vm_utime
+.Fa vm_utime
 and
 and
-.I vm_stime
+.Fa vm_stime
 fields give the user and system
 time respectively in 60ths of a second (or 50ths if that
 is the frequency of wall current in your locality.) The
 fields give the user and system
 time respectively in 60ths of a second (or 50ths if that
 is the frequency of wall current in your locality.) The
-.I vm_idrss
+.Fa vm_idrss
 and
 and
-.I vm_ixrss
+.Fa vm_ixrss
 measure memory usage.  They are computed by integrating the number of
 memory pages in use each
 measure memory usage.  They are computed by integrating the number of
 memory pages in use each
-over cpu time.  They are reported as though computed
+over
+.Tn CPU
+time.  They are reported as though computed
 discretely, adding the current memory usage (in 512 byte
 pages) each time the clock ticks.  If a process used 5 core
 pages over 1 cpu-second for its data and stack, then
 discretely, adding the current memory usage (in 512 byte
 pages) each time the clock ticks.  If a process used 5 core
 pages over 1 cpu-second for its data and stack, then
-.I vm_idsrss
+.Fa vm_idsrss
 would have the value 5*60, where
 would have the value 5*60, where
-.I vm_utime+vm_stime
+.Fa vm_utime+vm_stime
 would be the 60.  
 would be the 60.  
-.I Vm_idsrss
+The
+.Fa Vm_idsrss
+argument
 integrates data and stack segment
 usage, while
 integrates data and stack segment
 usage, while
-.I vm_ixrss
+.Fa vm_ixrss
 integrates text segment usage.
 integrates text segment usage.
-.I Vm_maxrss
+The
+.Fa Vm_maxrss
+function
 reports the maximum instantaneous sum of the
 text+data+stack core-resident page count.
 reports the maximum instantaneous sum of the
 text+data+stack core-resident page count.
-.PP
+.Pp
 The 
 The 
-.I vm_majflt
+.Fa vm_majflt
 field gives the number of page faults which
 resulted in disk activity; the
 field gives the number of page faults which
 resulted in disk activity; the
-.I vm_minflt
+.Fa vm_minflt
 field gives the
 number of page faults incurred in simulation of reference
 bits;
 field gives the
 number of page faults incurred in simulation of reference
 bits;
-.I vm_nswap
+.Fa vm_nswap
 is the number of swaps which occurred.  The
 number of file system input/output events are reported in
 is the number of swaps which occurred.  The
 number of file system input/output events are reported in
-.I vm_inblk
+.Fa vm_inblk
 and
 and
-.I vm_oublk
+.Fa vm_oublk
 These numbers account only for real
 These numbers account only for real
-i/o; data supplied by the caching mechanism is charged only
+.Tn I/O ;
+data supplied by the caching mechanism is charged only
 to the first process to read or write the data.
 to the first process to read or write the data.
-.SH SEE ALSO
-time(2), wait3(2), getrusage(2)
+.Sh SEE ALSO
+.Xr time 2 ,
+.Xr wait3 2 ,
+.Xr getrusage 2
+.Sh HISTORY
+The
+.Fn vlimit
+function appeared in 
+.Bx 4.2 .
index 08e4bec..10cc41b 100644 (file)
@@ -1,45 +1,54 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)insque.3    6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH INSQUE 3 ""
-.UC 5
-.SH NAME
-insque, remque \- insert/remove element from a queue
-.SH SYNOPSIS
-.nf
-.DT
-.ft B
+.\"     @(#)insque.3   6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt INSQUE 3
+.Os BSD 4.2
+.Sh NAME
+.Nm insque ,
+.Nm remque
+.Nd insert/remove element from a queue
+.Sh SYNOPSIS
+.Bd -literal
 struct qelem {
        struct  qelem *q_forw;
        struct  qelem *q_back;
        char    q_data[];
 };
 struct qelem {
        struct  qelem *q_forw;
        struct  qelem *q_back;
        char    q_data[];
 };
-.PP
-.ft B
-insque(elem, pred)
-struct qelem *elem, *pred;
-.PP
-.ft B
-remque(elem)
-struct qelem *elem;
-.ft R
-.SH DESCRIPTION
-.I Insque
+.Ed
+
+.Fn insque "(caddr_t) struct qelem *elem" "(caddr_t) struct qelem *pred"
+.Fn remque "(caddr_t) struct qelem *elem"
+.Sh DESCRIPTION
+The
+.Fn insque
 and 
 and 
-.I remque
+.Fn remque
+functions
 manipulate queues built from doubly linked lists.  Each
 manipulate queues built from doubly linked lists.  Each
-element in the queue must in the form of ``struct qelem''.
-.I Insque
+element in the queue must in the form of
+.Dq Li struct qelem .
+The function
+.Fn insque
 inserts 
 inserts 
-.I elem
+.Fa elem
 in a queue immediately after 
 in a queue immediately after 
-.IR pred ;
-.I remque
+.Fa pred ;
+.Fn remque
 removes an entry
 removes an entry
-.I elem 
+.Fa elem
 from a queue.
 from a queue.
-.SH "SEE ALSO
-``VAX Architecture Handbook'', pp. 228-235.
+.Sh SEE ALSO
+.%T "VAX Architecture Handbook" ,
+pp. 228-235.
+.Sh HISTORY
+The
+.Fn insque
+and
+.Fn remque
+functions appeared in 
+.Bx 4.2 .
index a36144d..609b7ff 100644 (file)
@@ -1,75 +1,77 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)lsearch.3   5.4 (Berkeley) %G%
+.\"     @(#)lsearch.3  5.5 (Berkeley) %G%
 .\"
 .\"
-.TH LSEARCH 3 ""
-.UC 7
-.SH NAME
-lsearch, lfind, \- linear searching routines
-.SH SYNOPSIS
-.ft B
-.nf
-char *
-lsearch(const void *key, const void *base,
-size_t *nelp, size_t width, 
-int (*compar) (void *, void *));
-.sp
-char *
-lfind(const void *key, const void *base,
-size_t *nelp, size_t width,
-int (*compar) (void *, void *));
-.ft R
-.SH DESCRIPTION
-.ft B
+.Dd 
+.Dt LSEARCH 3
+.Os
+.Sh NAME
+.Nm lsearch ,
+.Nm lfind,
+.Nd linear searching routines
+.Sh SYNOPSIS
+.Ft char *
+.Fn lsearch "const void *key" "const void *base" "size_t *nelp" "size_t width" "int (*compar)(void *, void *)"
+.Ft char *
+.Fn lfind "const void *key" "const void *base" "size_t *nelp" "size_t width" "int (*compar)(void *, void *)"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface was obsolete before it was written.
 It is available from the compatibility library, libcompat.
 This interface was obsolete before it was written.
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
+.Ef
+.Pp
 The functions
 The functions
-.IR lsearch ,
+.Fn lsearch ,
 and
 and
-.IR lfind
+.Fn lfind
 provide basic linear searching functionality.
 provide basic linear searching functionality.
-.PP
-.I Base
+.Pp
+.Fa Base
 is the pointer to the beginning of an array.
 is the pointer to the beginning of an array.
-.I Nelp
+The argument
+.Fa nelp
 is the current number of elements in the array, where each element
 is
 is the current number of elements in the array, where each element
 is
-.I width
+.Fa width
 bytes long.
 bytes long.
-.I Compar
+The
+.Fa compar
+function
 is a comparison routine which is used to compare two elements.
 is a comparison routine which is used to compare two elements.
-It is called with two arguments that point to the 
-.I key
+It takes two arguments which point to the
+.Fa key
 object and to an array member, in that order, and must return an integer
 object and to an array member, in that order, and must return an integer
-less than, equal to, or greater than zero if the 
-.I key
+less than, equivalent to, or greater than zero if the 
+.Fa key
 object is considered, respectively, to be less than, equal to, or greater
 than the array member.
 object is considered, respectively, to be less than, equal to, or greater
 than the array member.
-.PP
-.I Lsearch
+.Pp
+The
+.Fn lsearch
 and
 and
-.I lfind
+.Fn lfind
+functions
 return a pointer into the array referenced by
 return a pointer into the array referenced by
-.I base
+.Fa base
 where
 where
-.I key
+.Fa key
 is located.
 If
 is located.
 If
-.I key
+.Fa key
 does not exist,
 does not exist,
-.I lfind
-will return a NULL pointer and
-.I lsearch
+.Fn lfind
+will return a null pointer and
+.Fn lsearch
 will add it to the array.
 When an element is added to the array by
 will add it to the array.
 When an element is added to the array by
-.I lsearch
+.Fn lsearch
 the location referenced by the argument
 the location referenced by the argument
-.I nelp
+.Fa nelp
 is incremented by one.
 is incremented by one.
-.SH "SEE ALSO"
-bsearch(3), db(3)
+.Sh SEE ALSO
+.Xr bsearch 3 ,
+.Xr hsearch 3 ,
+.\" .Xr tsearch 3
index 4ab1848..4163baa 100644 (file)
@@ -1,70 +1,94 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)re_comp.3   6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH REGEX 3 ""
-.UC
-.SH NAME
-re_comp, re_exec \- regular expression handler
-.SH SYNOPSIS
-.B char *re_comp(s)
-.br
-.B char *s;
-.PP
-.B re_exec(s)
-.br
-.B char *s;
-.SH DESCRIPTION
-.I Re_comp
+.\"     @(#)re_comp.3  6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt REGEX 3
+.Os
+.Sh NAME
+.Nm re_comp ,
+.Nm re_exec
+.Nd regular expression handler
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft char *
+.Fn re_comp "const char *s"
+.Ft int
+.Fn re_exec "const char *s"
+.Sh DESCRIPTION
+The
+.Fn re_comp
+function
 compiles a string into an internal form suitable for pattern matching. 
 compiles a string into an internal form suitable for pattern matching. 
-.I Re_exec 
+The
+.Fn re_exec
+function
 checks the argument string against the last string passed to
 checks the argument string against the last string passed to
-.I re_comp.
-.PP
-.I Re_comp
+.Fn re_comp .
+.Pp
+The
+.Fn re_comp
+function
 returns 0 if the string
 returns 0 if the string
-.I s
+.Fa s
 was compiled successfully; otherwise a string containing an
 error message is returned. If 
 was compiled successfully; otherwise a string containing an
 error message is returned. If 
-.I re_comp
+.Fn re_comp
 is passed 0 or a null string, it returns without changing the currently
 compiled regular expression.
 is passed 0 or a null string, it returns without changing the currently
 compiled regular expression.
-.PP
-.I Re_exec
+.Pp
+The
+.Fn re_exec
+function
 returns 1 if the string
 returns 1 if the string
-.I s
+.Fa s
 matches the last compiled regular expression, 0 if the string
 matches the last compiled regular expression, 0 if the string
-.I s
+.Fa s
 failed to match the last compiled regular expression, and \-1 if the compiled
 regular expression was invalid (indicating an internal error).
 failed to match the last compiled regular expression, and \-1 if the compiled
 regular expression was invalid (indicating an internal error).
-.PP
+.Pp
 The strings passed to both
 The strings passed to both
-.I re_comp
+.Fn re_comp
 and
 and
-.I re_exec
+.Fn re_exec
 may have trailing or embedded newline characters; 
 may have trailing or embedded newline characters; 
-they are terminated by nulls.
+they are terminated by
+.Dv NUL Ns s.
 The regular expressions recognized are described in the manual entry for 
 The regular expressions recognized are described in the manual entry for 
-.IR ed (1),
+.Xr ed 1 ,
 given the above difference.
 given the above difference.
-.SH "SEE ALSO"
-ed(1), ex(1), egrep(1), fgrep(1), grep(1), regexp(3)
-.SH DIAGNOSTICS
-.I Re_exec
+.Sh DIAGNOSTICS
+The
+.Fn re_exec
+function
 returns \-1 for an internal error.
 returns \-1 for an internal error.
-.PP
-.I Re_comp
+.Pp
+The
+.Fn re_comp
+function
 returns one of the following strings if an error occurs:
 returns one of the following strings if an error occurs:
-.PP
-.nf
-.in +0.5i
-\fINo previous regular expression,
+.Bd -unfilled -offset indent
+No previous regular expression,
 Regular expression too long,
 unmatched \e(,
 missing ],
 too many \e(\e) pairs,
 Regular expression too long,
 unmatched \e(,
 missing ],
 too many \e(\e) pairs,
-unmatched \e).\fP
-.in -0.5i
-.fi
+unmatched \e).
+.Ed
+.Sh SEE ALSO
+.Xr ed 1 ,
+.Xr ex 1 ,
+.Xr egrep 1 ,
+.Xr fgrep 1 ,
+.Xr grep 1 ,
+.Xr regexp 3
+.Sh HISTORY
+The
+.Fn re_comp
+and
+.Fn re_exec
+functions appeared in 
+.Bx 4.0 .
index a68aa56..8e250dd 100644 (file)
@@ -1,85 +1,96 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)rexec.3     6.8 (Berkeley) %G%
+.\"     @(#)rexec.3    6.9 (Berkeley) %G%
 .\"
 .\"
-.TH REXEC 3 ""
-.UC 5
-.SH NAME
-rexec \- return stream to a remote command
-.SH SYNOPSIS
-.nf
-.PP
-.B "rem = rexec(ahost, inport, user, passwd, cmd, fd2p);"
-.B char **ahost;
-.B int inport;
-.B "char *user, *passwd, *cmd;"
-.B int *fd2p;
-.fi
-.SH DESCRIPTION
-.ft B
+.Dd 
+.Dt REXEC 3
+.Os BSD 4.2
+.Sh NAME
+.Nm rexec
+.Nd return stream to a remote command
+.Sh SYNOPSIS
+.Ft int
+.Fn rexec ahost "int inport" "char *user" "char *passwd" "char *cmd" "int *fd2p"
+.Sh DESCRIPTION
+.Bf -symbolic
 This interface is obsoleted by krcmd(3).
 This interface is obsoleted by krcmd(3).
-.br
 It is available from the compatibility library, libcompat.
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
-.I Rexec
+.Ef
+.Pp
+The
+.Fn rexec
+function
 looks up the host
 looks up the host
-.I *ahost
+.Fa *ahost
 using
 using
-.IR gethostbyname (3),
+.Xr gethostbyname 3 ,
 returning \-1 if the host does not exist.
 Otherwise
 returning \-1 if the host does not exist.
 Otherwise
-.I *ahost
+.Fa *ahost
 is set to the standard name of the host.
 If a username and password are both specified, then these
 are used to authenticate to the foreign host; otherwise
 the environment and then the user's
 is set to the standard name of the host.
 If a username and password are both specified, then these
 are used to authenticate to the foreign host; otherwise
 the environment and then the user's
-.I .netrc
+.Pa .netrc
 file in his
 home directory are searched for appropriate information.
 If all this fails, the user is prompted for the information.
 file in his
 home directory are searched for appropriate information.
 If all this fails, the user is prompted for the information.
-.PP
+.Pp
 The port
 The port
-.I inport
-specifies which well-known DARPA Internet port to use for
-the connection; the call ``getservbyname("exec", "tcp")'' (see 
-.IR getservent (3))
+.Fa inport
+specifies which well-known
+.Tn DARPA
+Internet port to use for
+the connection; the call
+.Ql getservbyname(\\*qexec\\*q, \\*qtcp\\*q)
+(see 
+.Xr getservent 3 )
 will return a pointer to a structure, which contains the
 necessary port.
 The protocol for connection is described in detail in
 will return a pointer to a structure, which contains the
 necessary port.
 The protocol for connection is described in detail in
-.IR rexecd (8).
-.PP
+.Xr rexecd 8 .
+.Pp
 If the connection succeeds,
 If the connection succeeds,
-a socket in the Internet domain of type SOCK_STREAM is returned to
+a socket in the Internet domain of type
+.Dv SOCK_STREAM
+is returned to
 the caller, and given to the remote command as
 the caller, and given to the remote command as
-.B stdin
+.Em stdin
 and
 and
-.BR stdout .
+.Em stdout .
 If
 If
-.I fd2p
+.Fa fd2p
 is non-zero, then an auxiliary channel to a control
 process will be setup, and a descriptor for it will be placed
 in
 is non-zero, then an auxiliary channel to a control
 process will be setup, and a descriptor for it will be placed
 in
-.IR *fd2p .
+.Fa *fd2p .
 The control process will return diagnostic
 output from the command (unit 2) on this channel, and will also
 The control process will return diagnostic
 output from the command (unit 2) on this channel, and will also
-accept bytes on this channel as being UNIX signal numbers, to be
+accept bytes on this channel as being
+.Tn UNIX
+signal numbers, to be
 forwarded to the process group of the command.  The diagnostic
 information returned does not include remote authorization failure,
 as the secondary connection is set up after authorization has been
 verified.
 If
 forwarded to the process group of the command.  The diagnostic
 information returned does not include remote authorization failure,
 as the secondary connection is set up after authorization has been
 verified.
 If
-.I fd2p
+.Fa fd2p
 is 0, then the 
 is 0, then the 
-.B stderr
+.Em stderr
 (unit 2 of the remote
 command) will be made the same as the 
 (unit 2 of the remote
 command) will be made the same as the 
-.B stdout
+.Em stdout
 and no
 provision is made for sending arbitrary signals to the remote process,
 although you may be able to get its attention by using out-of-band data.
 and no
 provision is made for sending arbitrary signals to the remote process,
 although you may be able to get its attention by using out-of-band data.
-.SH SEE ALSO
-rcmd(3), rexecd(8)
+.Sh SEE ALSO
+.Xr rcmd 3 ,
+.Xr rexecd 8
+.Sh HISTORY
+The
+.Fn rexec
+function appeared in 
+.Bx 4.2 .
index 4086e96..0aa3e52 100644 (file)
-.\" Copyright (c) 1985 The Regents of the University of California.
+.\" Copyright (c) 1985, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)curses.3    6.5 (Berkeley) %G%
+.\"     @(#)curses.3   6.6 (Berkeley) %G%
 .\"
 .\"
-.TH CURSES 3 ""
-.UC 4
-.SH NAME
-curses \- screen functions with ``optimal'' cursor motion
-.SH SYNOPSIS
-.B cc
-[ flags ] files
-.B \-lcurses \-ltermcap
-[ libraries ]
-.SH DESCRIPTION
+.Dd 
+.Dt CURSES 3
+.Os BSD 4
+.Sh NAME
+.Nm curses
+.Nd screen functions with ``optimal'' cursor motion
+.Sh SYNOPSIS
+.Nm cc
+.Op Ar flags
+.Ar files
+.Fl lcurses ltermcap
+.Op Ar libraries
+.Sh DESCRIPTION
 These routines give the user a method of updating screens with reasonable
 optimization.  They keep an image of the current screen,
 and the user sets up an image of a new one.  Then the
 These routines give the user a method of updating screens with reasonable
 optimization.  They keep an image of the current screen,
 and the user sets up an image of a new one.  Then the
-.I refresh()
+.Fn refresh
 tells the routines to make the current screen look like the new one.
 In order to initialize the routines, the routine
 tells the routines to make the current screen look like the new one.
 In order to initialize the routines, the routine
-.I initscr()
+.Fn initscr
 must be called before any of the other routines that deal with windows and
 screens are used.  The routine
 must be called before any of the other routines that deal with windows and
 screens are used.  The routine
-.I endwin()
+.Fn endwin
 should be called before exiting.
 should be called before exiting.
-.SH SEE ALSO
-.I "Screen Updating and Cursor Movement Optimization: A Library Package,"
-Ken Arnold,
-.br
-ioctl(2),
-getenv(3),
-tty(4),
-termcap(5)
-.SH AUTHOR
-Ken Arnold
-.SH FUNCTIONS
-.nf
-.ds w \fIwin\fP
-.ds s \fIstdscr\fP
-.ta 3i
-addch(ch)      add a character to \*s
-addstr(str)    add a string to \*s
-box(win,vert,hor)      draw a box around a window
-cbreak()       set cbreak mode
-clear()        clear \*s
-clearok(scr,boolf)     set clear flag for \fIscr\fP
-clrtobot()     clear to bottom on \*s
-clrtoeol()     clear to end of line on \*s
-delch()        delete a character
-deleteln()     delete a line
-delwin(win)    delete \*w
-echo() set echo mode
-endwin()       end window modes
-erase()        erase \*s
-flusok(win,boolf)      set flush-on-refresh flag for \fIwin\fP
-getch()        get a char through \*s
-getcap(name)   get terminal capability \fIname\fP
-getstr(str)    get a string through \*s
-gettmode()     get tty modes
-getyx(win,y,x) get (y,x) co-ordinates
-inch() get char at current (y,x) co-ordinates
-initscr()      initialize screens
-insch(c)       insert a char
-insertln()     insert a line
-leaveok(win,boolf)     set leave flag for \*w
-longname(termbuf,name) get long name from \fItermbuf\fP
-move(y,x)      move to (y,x) on \*s
-mvcur(lasty,lastx,newy,newx)   actually move cursor
-newwin(lines,cols,begin_y,begin_x)\    create a new window
-nl()   set newline mapping
-nocbreak()     unset cbreak mode
-noecho()       unset echo mode
-nonl() unset newline mapping
-noraw()        unset raw mode
-overlay(win1,win2)     overlay win1 on win2
-overwrite(win1,win2)   overwrite win1 on top of win2
-printw(fmt,arg1,arg2,...)      printf on \*s
-raw()  set raw mode
-refresh()      make current screen look like \*s
-resetty()      reset tty flags to stored value
-savetty()      stored current tty flags
-scanw(fmt,arg1,arg2,...)       scanf through \*s
-scroll(win)    scroll \*w one line
-scrollok(win,boolf)    set scroll flag
-setterm(name)  set term variables for name
-standend()     end standout mode
-standout()     start standout mode
-subwin(win,lines,cols,begin_y,begin_x)\        create a subwindow
-touchline(win,y,sx,ex) mark line \fIy\fP \fIsx\fP through \fIsy\fP as changed
-touchoverlap(win1,win2)        mark overlap of \fIwin1\fP on \fIwin2\fP as changed
-touchwin(win)  \*(lqchange\*(rq all of \*w
-unctrl(ch)     printable version of \fIch\fP
-waddch(win,ch) add char to \*w
-waddstr(win,str)       add string to \*w
-wclear(win)    clear \*w
-wclrtobot(win) clear to bottom of \*w
-wclrtoeol(win) clear to end of line on \*w
-wdelch(win,c)  delete char from \*w
-wdeleteln(win) delete line from \*w
-werase(win)    erase \*w
-wgetch(win)    get a char through \*w
-wgetstr(win,str)       get a string through \*w
-winch(win)     get char at current (y,x) in \*w
-winsch(win,c)  insert char into \*w
-winsertln(win) insert line into \*w
-wmove(win,y,x) set current (y,x) co-ordinates on \*w
-wprintw(win,fmt,arg1,arg2,...)\        printf on \*w
-wrefresh(win)  make screen look like \*w
-wscanw(win,fmt,arg1,arg2,...)\         scanf through \*w
-wstandend(win) end standout mode on \*w
-wstandout(win) start standout mode on \*w
+.Sh SEE ALSO
+.Xr ioctl 2 ,
+.Xr getenv 3 ,
+.Xr tty 4 ,
+.Xr termcap 5
+.Rs
+.%T Screen Updating and Cursor Movement Optimization: A Library Package
+.%A Ken Arnold
+.Re
+.Sh AUTHOR
+.An Ken Arnold
+.Sh FUNCTIONS
+.Bl -column "subwin(win,lines,cols,begin_y,begin_x)   "
+.It addch(ch)  add a character to
+.Em stdscr
+.It addstr(str)        add a string to
+.Em stdscr
+.It box(win,vert,hor)  draw a box around a window
+.It cbreak()   set cbreak mode
+.It clear()    clear
+.Em stdscr
+.It clearok(scr,boolf) set clear flag for
+.Em scr
+.It clrtobot() clear to bottom on
+.Em stdscr
+.It clrtoeol() clear to end of line on
+.Em stdscr
+.It delch()    delete a character
+.It deleteln() delete a line
+.It delwin(win)        delete
+.Em stdscr
+.It echo()     set echo mode
+.It endwin()   end window modes
+.It erase()    erase
+.Em stdscr
+.It flusok(win,boolf)  set flush-on-refresh flag for
+.Em win
+.It getch()    get a char through
+.Em stdscr
+.It getcap(name)       get terminal capability
+.Em name
+.It getstr(str)        get a string through
+.Em stdscr
+.It gettmode() get tty modes
+.It getyx(win,y,x)     get (y,x) co-ordinates
+.It inch()     get char at current (y,x) co-ordinates
+.It initscr()  initialize screens
+.It insch(c)   insert a char
+.It insertln() insert a line
+.It leaveok(win,boolf) set leave flag for
+.Em stdscr
+.It longname(termbuf,name)     get long name from
+.Em termbuf
+.It move(y,x)  move to (y,x) on
+.Em stdscr
+.It mvcur(lasty,lastx,newy,newx)       actually move cursor
+.It newwin(lines,cols,begin_y,begin_x)\        create a new window
+.It nl()       set newline mapping
+.It nocbreak() unset cbreak mode
+.It noecho()   unset echo mode
+.It nonl()     unset newline mapping
+.It noraw()    unset raw mode
+.It overlay(win1,win2) overlay win1 on win2
+.It overwrite(win1,win2)       overwrite win1 on top of win2
+.It printw(fmt,arg1,arg2,...)  printf on
+.Em stdscr
+.It raw()      set raw mode
+.It refresh()  make current screen look like
+.Em stdscr
+.It resetty()  reset tty flags to stored value
+.It savetty()  stored current tty flags
+.It scanw(fmt,arg1,arg2,...)   scanf through
+.Em stdscr
+.It scroll(win)        scroll
+.Em win
+one line
+.It scrollok(win,boolf)        set scroll flag
+.It setterm(name)      set term variables for name
+.It standend() end standout mode
+.It standout() start standout mode
+.It subwin(win,lines,cols,begin_y,begin_x)\    create a subwindow
+.It touchline(win,y,sx,ex)     mark line
+.Em y
+.Em sx
+through
+.Em sy
+as changed
+.It touchoverlap(win1,win2)    mark overlap of
+.Em win1
+on
+.Em win2
+as changed
+.It touchwin(win)      \*(lqchange\*(rq all of
+.Em win
+.It unctrl(ch) printable version of
+.Em ch
+.It waddch(win,ch)     add char to
+.Em win
+.It waddstr(win,str)   add string to
+.Em win
+.It wclear(win)        clear
+.Em win
+.It wclrtobot(win)     clear to bottom of
+.Em win
+.It wclrtoeol(win)     clear to end of line on
+.Em win
+.It wdelch(win,c)      delete char from
+.Em win
+.It wdeleteln(win)     delete line from
+.Em win
+.It werase(win)        erase
+.Em win
+.It wgetch(win)        get a char through
+.Em win
+.It wgetstr(win,str)   get a string through
+.Em win
+.It winch(win) get char at current (y,x) in
+.Em win
+.It winsch(win,c)      insert char into
+.Em win
+.It winsertln(win)     insert line into
+.Em win
+.It wmove(win,y,x)     set current (y,x) co-ordinates on
+.Em win
+.It wprintw(win,fmt,arg1,arg2,...)\    printf on
+.Em win
+.It wrefresh(win)      make screen look like
+.Em win
+.It wscanw(win,fmt,arg1,arg2,...)\     scanf through
+.Em win
+.It wstandend(win)     end standout mode on
+.Em win
+.It wstandout(win)     start standout mode on
+.Em win
+.El
+.Sh HISTORY
+The
+.Nm
+package appeared in 
+.Bx 4.0 .
index 868dd5c..7641e8d 100644 (file)
@@ -1,42 +1,47 @@
 From Prof. Kahan at UC at Berkeley
 From Prof. Kahan at UC at Berkeley
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)asinh.3     6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH ASINH 3M  ""
-.UC 6
-.ds up \fIulp\fR
-.SH NAME
-asinh, acosh, atanh \- inverse hyperbolic functions
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double asinh(x)
-.B double x;
-.PP
-.B double acosh(x)
-.B double x;
-.PP
-.B double atanh(x)
-.B double x;
-.fi
-.SH DESCRIPTION
-These functions compute the designated inverse hyperbolic functions for real
-arguments.
-.SH ERROR (due to Roundoff etc.)
-These functions inherit much of their error from log1p described in
-exp(3M).  On a VAX, acosh is accurate to about 3 \*(ups,
-asinh and atanh to about 2 \*(ups.
-An \*(up is one \fIU\fRnit in the \fIL\fRast \fIP\fRlace carried.
-.SH DIAGNOSTICS
-Acosh returns the reserved operand on a VAX if the argument is less than 1.
-.PP
-Atanh returns the reserved operand on a VAX if the argument has absolute
-value bigger than or equal to 1.
-.SH SEE ALSO
-math(3M), exp(3M), infnan(3M)
-.SH AUTHOR
-W. Kahan, Kwok\-Choi Ng
+.\"     @(#)asinh.3    6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt ASINH 3
+.Os BSD 4.3
+.Sh NAME
+.Nm asinh
+.Nd inverse hyperbolic sine function
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn asinh "double x"
+.Sh DESCRIPTION
+The
+.Fn asinh
+function computes the inverse hyperbolic sine
+of the real
+argument
+.Ar x .
+For a discussion of error due to roundoff, see
+.Xr math 3 .
+.Sh RETURN VALUES
+The
+.Fn asinh
+function
+returns the inverse hyperbolic sine of
+.Ar x .
+.Sh SEE ALSO
+.Xr acosh 3 ,
+.Xr atanh 3 ,
+.Xr exp 3 ,
+.Xr infnan 3
+.Xr math 3 ,
+.Sh AUTHOR
+.An W. Kahan ,
+.An Kwok\-Choi Ng
+.Sh HISTORY
+The
+.Fn asinh
+function appeared in 
+.Bx 4.3 .
index 3783613..921e017 100644 (file)
@@ -1,38 +1,59 @@
 From Prof. Kahan at UC at Berkeley
 From Prof. Kahan at UC at Berkeley
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)erf.3       6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH ERF 3M  ""
-.UC 6
-.SH NAME
-erf, erfc \- error functions
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double erf(x)
-.B double x;
-.PP
-.B double erfc(x)
-.B double x;
-.fi
-.SH DESCRIPTION
-Erf\|(x) returns the error function of x; where
+.\"     @(#)erf.3      6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt ERF 3
+.Os BSD 4.3
+.Sh NAME
+.Nm erf ,
+.Nm erfc
+.Nd error function operators
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn erf "double x"
+.Ft double
+.Fn erfc "double x"
+.Sh DESCRIPTION
+These functions calculate the error function of
+.Fa x .
+.Pp
+The
+.Fn erf
+calculates the error function of x; where
+.Bd -filled -offset indent
 .if n \{\
 .if n \{\
-.PP
 erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt. \}
 .if t \{\
 erf\|(x) := 
 (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt. \}
 erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt. \}
 .if t \{\
 erf\|(x) := 
 (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt. \}
-.PP
-Erfc\|(x) returns 1.0\-erf\|(x).
-.PP
-The entry for erfc is provided because of the extreme loss
-of relative accuracy if erf\|(x) is called for large x
-and the result subtracted from 1.
-(e.g. for x = 10, 12 places are lost).
-.SH SEE ALSO
-math(3M)
+.Ed
+.Pp
+The
+.Fn erfc
+function calculates the complementary error function of
+.Fa x ;
+that is
+.Fn erfc
+subtracts the result of
+the error function
+.Fn erf x
+from 1.0.
+This is useful, since for large
+.Fa x ,
+such as x = 10, 12 places disappear.
+.Sh SEE ALSO
+.Xr math 3
+.Sh HISTORY
+The
+.Fn erf
+and
+.Fn erfc
+functions
+appeared in
+.Bx 4.3 .
index 42c59ea..e91308a 100644 (file)
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)exp.3       6.9 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH EXP 3M  ""
-.UC 4
-.ds nn \fINaN\fR
-.ds up \fIulp\fR
-.SH NAME
-exp, expm1, log, log10, log1p, pow \- exponential, logarithm, power
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double exp(x)
-.B double x;
-.PP
-.B double expm1(x)
-.B double x;
-.PP
-.B double log(x)
-.B double x;
-.PP
-.B double log10(x)
-.B double x;
-.PP
-.B double log1p(x)
-.B double x;
-.PP
-.B double pow(x,y)
-.B double x,y;
-.fi
-.SH DESCRIPTION
-.PP
-Exp returns the exponential function of x.
-.PP
-Expm1 returns exp(x)\-1 accurately even for tiny x.
-.PP
-Log returns the natural logarithm of x.
-.PP
-Log10 returns the logarithm of x to base 10.
-.PP
-Log1p returns log(1+x) accurately even for tiny x.
-.PP
-Pow(x,y) returns
-.if n \
-x**y.
-.if t \
-x\u\s8y\s10\d.
-.SH ERROR (due to Roundoff etc.)
+.\"     @(#)exp.3      6.10 (Berkeley) %G%
+.\"
+.Dd 
+.Dt EXP 3
+.Os BSD 4
+.Sh NAME
+.Nm exp ,
+.Nm expm1 ,
+.Nm log ,
+.Nm log10 ,
+.Nm log1p ,
+.Nm pow
+.Nd exponential, logarithm, power functions
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn exp "double x"
+.Ft double
+.Fn expm1 "double x"
+.Ft double
+.Fn log "double x"
+.Ft double
+.Fn log10 "double x"
+.Ft double
+.Fn log1p "double x"
+.Ft double
+.Fn pow "double x" "double y"
+.Sh DESCRIPTION
+The
+.Fn exp
+function computes the exponential value of the given argument
+.Fa x .
+.Pp
+The
+.Fn expm1
+function computes the value exp(x)\-1 accurately even for tiny argument
+.Fa x .
+.Pp
+The
+.Fn log
+function computes the value for the natural logarithm of
+the argument x.
+.Pp
+The
+.Fn log10
+function computes the value for the logarithm of
+argument
+.Fa x
+to base 10.
+.Pp
+The
+.Fn log1p
+function computes
+the value of log(1+x) accurately even for tiny argument
+.Fa x .
+.Pp
+The
+.Fn pow
+computes the value
+of
+.Ar x
+to the exponent
+.Ar y .
+.Sh ERROR (due to Roundoff etc.)
 exp(x), log(x), expm1(x) and log1p(x) are accurate to within 
 exp(x), log(x), expm1(x) and log1p(x) are accurate to within 
-an \*(up, and log10(x) to within about 2 \*(ups;
-an \*(up is one \fIU\fRnit in the \fIL\fRast \fIP\fRlace.
-The error in pow(x,y) is below about 2 \*(ups when its
-magnitude is moderate, but increases as pow(x,y) approaches
+an
+.Em up ,
+and log10(x) to within about 2
+.Em ups ;
+an
+.Em up
+is one
+.Em Unit
+in the
+.Em Last
+.Em Place .
+The error in
+.Fn pow x y
+is below about 2
+.Em ups
+when its
+magnitude is moderate, but increases as
+.Fn pow x y
+approaches
 the over/underflow thresholds until almost as many bits could be
 lost as are occupied by the floating\-point format's exponent
 the over/underflow thresholds until almost as many bits could be
 lost as are occupied by the floating\-point format's exponent
-field; that is 8 bits for VAX D and 11 bits for IEEE 754 Double.
+field; that is 8 bits for
+.Tn "VAX D"
+and 11 bits for IEEE 754 Double.
 No such drastic loss has been exposed by testing; the worst
 No such drastic loss has been exposed by testing; the worst
-errors observed have been below 20 \*(ups for VAX D,
-300 \*(ups for IEEE 754 Double.
-Moderate values of pow are accurate enough that pow(integer,integer)
-is exact until it is bigger than 2**56 on a VAX, 2**53 for IEEE 754.
-.SH DIAGNOSTICS
-Exp, expm1 and pow return the reserved operand on a VAX when the correct
-value would overflow, and they set \fIerrno\fR to ERANGE.
-Pow(x,y) returns the reserved operand on a VAX and sets \fIerrno\fR
-to EDOM when x < 0 and y is not an integer.
-.PP
-On a VAX, \fIerrno\fR is set to EDOM and the reserved operand is returned
-by log unless x > 0, by log1p unless x > \-1.
-.SH NOTES
-The functions exp(x)\-1 and log(1+x) are called expm1
-and logp1 in BASIC on the Hewlett\-Packard HP\-71B and APPLE
-Macintosh, EXP1 and LN1 in Pascal, exp1 and log1 in C
-on APPLE Macintoshes, where they have been provided to make
+errors observed have been below 20
+.Em ups
+for
+.Tn "VAX D" ,
+300
+.Em ups
+for
+.Tn IEEE
+754 Double.
+Moderate values of
+.Fn pow
+are accurate enough that
+.Fn pow integer integer
+is exact until it is bigger than 2**56 on a
+.Tn VAX ,
+2**53 for
+.Tn IEEE
+754.
+.Sh RETURN VALUES
+These functions will return the approprate computation unless an error
+occurs or an argument is out of range.
+The functions
+.Fn exp ,
+.Fn expm1
+and
+.Fn pow
+detect if the computed value will overflow,
+set the global variable
+.Va errno to
+.Er RANGE
+and cause a reserved operand fault on a
+.Tn VAX
+or
+.Tn Tahoe .
+The function
+.Fn pow x y
+checks to see if
+.Fa x
+< 0 and
+.Fa y
+is not an integer, in the event this is true,
+the global variable
+.Va errno
+is set to
+.Er EDOM
+and on the
+.Tn VAX
+and
+.Tn Tahoe
+generate a reserved operand fault.
+On a
+.Tn VAX
+and
+.Tn Tahoe ,
+.Va errno
+is set to
+.Er EDOM
+and the reserved operand is returned
+by log unless
+.Fa x
+> 0, by
+.Fn log1p
+unless
+.Fa x
+> \-1.
+.Sh NOTES
+The functions exp(x)\-1 and log(1+x) are called
+expm1 and logp1 in
+.Tn BASIC
+on the Hewlett\-Packard
+.Tn HP Ns \-71B
+and
+.Tn APPLE
+Macintosh,
+.Tn EXP1
+and
+.Tn LN1
+in Pascal, exp1 and log1 in C
+on
+.Tn APPLE
+Macintoshes, where they have been provided to make
 sure financial calculations of ((1+x)**n\-1)/x, namely
 expm1(n\(**log1p(x))/x, will be accurate when x is tiny.
 They also provide accurate inverse hyperbolic functions.
 sure financial calculations of ((1+x)**n\-1)/x, namely
 expm1(n\(**log1p(x))/x, will be accurate when x is tiny.
 They also provide accurate inverse hyperbolic functions.
-.PP
-Pow(x,0) returns x**0 = 1 for all x including x = 0,
+.Pp
+The function
+.Fn pow x 0
+returns x**0 = 1 for all x including x = 0,
 .if n \
 Infinity
 .if t \
 \(if
 .if n \
 Infinity
 .if t \
 \(if
-(not found on a VAX), and \*(nn (the reserved
-operand on a VAX).  Previous implementations of pow may
+(not found on a
+.Tn VAX ) ,
+and
+.Em NaN
+(the reserved
+operand on a
+.Tn VAX ) .  Previous implementations of pow may
 have defined x**0 to be undefined in some or all of these
 cases.  Here are reasons for returning x**0 = 1 always:
 have defined x**0 to be undefined in some or all of these
 cases.  Here are reasons for returning x**0 = 1 always:
-.IP (1) \w'\0\0\0\0'u
+.Bl -enum -width indent
+.It
 Any program that already tests whether x is zero (or
 infinite or \*(nn) before computing x**0 cannot care
 whether 0**0 = 1 or not. Any program that depends
 upon 0**0 to be invalid is dubious anyway since that
 expression's meaning and, if invalid, its consequences 
 vary from one computer system to another.
 Any program that already tests whether x is zero (or
 infinite or \*(nn) before computing x**0 cannot care
 whether 0**0 = 1 or not. Any program that depends
 upon 0**0 to be invalid is dubious anyway since that
 expression's meaning and, if invalid, its consequences 
 vary from one computer system to another.
-.IP (2) \w'\0\0\0\0'u
+.It
 Some Algebra texts (e.g. Sigler's) define x**0 = 1 for 
 all x, including x = 0.
 This is compatible with the convention that accepts a[0]
 as the value of polynomial
 Some Algebra texts (e.g. Sigler's) define x**0 = 1 for 
 all x, including x = 0.
 This is compatible with the convention that accepts a[0]
 as the value of polynomial
-.ce
+.Bd -literal -offset indent
 p(x) = a[0]\(**x**0 + a[1]\(**x**1 + a[2]\(**x**2 +...+ a[n]\(**x**n
 p(x) = a[0]\(**x**0 + a[1]\(**x**1 + a[2]\(**x**2 +...+ a[n]\(**x**n
-.IP
+.Ed
+.Pp
 at x = 0 rather than reject a[0]\(**0**0 as invalid.
 at x = 0 rather than reject a[0]\(**0**0 as invalid.
-.IP (3) \w'\0\0\0\0'u
+.It
 Analysts will accept 0**0 = 1 despite that x**y can
 approach anything or nothing as x and y approach 0
 independently.
 The reason for setting 0**0 = 1 anyway is this:
 Analysts will accept 0**0 = 1 despite that x**y can
 approach anything or nothing as x and y approach 0
 independently.
 The reason for setting 0**0 = 1 anyway is this:
-.IP
-If x(z) and y(z) are \fIany\fR functions analytic (expandable
+.Bd -filled -offset indent
+If x(z) and y(z) are
+.Em any
+functions analytic (expandable
 in power series) in z around z = 0, and if there 
 x(0) = y(0) = 0, then x(z)**y(z) \(-> 1 as z \(-> 0.
 in power series) in z around z = 0, and if there 
 x(0) = y(0) = 0, then x(z)**y(z) \(-> 1 as z \(-> 0.
-.IP (4) \w'\0\0\0\0'u
+.Ed
+.It
 If 0**0 = 1, then
 .if n \
 infinity**0 = 1/0**0 = 1 too; and
 If 0**0 = 1, then
 .if n \
 infinity**0 = 1/0**0 = 1 too; and
@@ -122,7 +232,29 @@ infinity**0 = 1/0**0 = 1 too; and
 \(if**0 = 1/0**0 = 1 too; and
 then \*(nn**0 = 1 too because x**0 = 1 for all finite
 and infinite x, i.e., independently of x.
 \(if**0 = 1/0**0 = 1 too; and
 then \*(nn**0 = 1 too because x**0 = 1 for all finite
 and infinite x, i.e., independently of x.
-.SH SEE ALSO
-math(3M), infnan(3M)
-.SH AUTHOR
+.El
+.Sh SEE ALSO
+.Xr math 3 ,
+.Xr infnan 3
+.Sh AUTHOR
 Kwok\-Choi Ng, W. Kahan
 Kwok\-Choi Ng, W. Kahan
+.Sh HISTORY
+A
+.Fn exp ,
+.Fn log
+and
+.Fn pow
+function
+appeared in
+.At v6 .
+A
+.Fn log10
+function
+appeared in
+.At v7 .
+The
+.Fn log1p
+and
+.Fn expm1
+functions appeared in
+.Bx 4.3 .
index 2bb95d5..9b0e3f0 100644 (file)
@@ -1,61 +1,39 @@
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)floor.3     6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH FLOOR 3M  ""
-.UC 4
-.SH NAME
-fabs, floor, ceil, rint \- absolute value, floor, ceiling, and
-round-to-nearest functions
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double floor(x)
-.B double x;
-.PP
-.B double ceil(x)
-.B double x;
-.PP
-.B double fabs(x)
-.B double x;
-.PP
-.B double rint(x)
-.B double x;
-.fi
-.SH DESCRIPTION
-Fabs returns the absolute value |\|x\||.
-.PP
-Floor returns the largest integer no greater than x.
-.PP
-Ceil returns the smallest integer no less than x.
-.PP
-Rint returns the integer (represented as a double precision number)
-nearest x in the direction of the prevailing rounding mode.
-.SH NOTES
-On a VAX, rint(x) is equivalent to adding half to the magnitude
-and then rounding towards zero.
-.PP
-In the default rounding mode, to nearest,
-on a machine that conforms to IEEE 754,
-rint(x) is the integer nearest x with the additional stipulation
-that if |rint(x)\-x|=1/2 then rint(x) is even.
-Other rounding modes can make rint act like floor, or like ceil,
-or round towards zero.
-.PP
-Another way to obtain an integer near x is to declare (in C)
-.RS
-double x;\0\0\0\0 int k;\0\0\0\0k\0=\0x;
-.RE
-Most C compilers round x towards 0 to get the integer k, but
-some do otherwise.
-If in doubt, use floor, ceil, or rint first, whichever you intend.
-Also note that, if x is larger than k can accommodate, the value of
-k and the presence or absence of an integer overflow are hard to
-predict.
-.SH SEE ALSO
-abs(3),
-ieee(3M),
-math(3M)
+.\"     @(#)floor.3    6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt FLOOR 3
+.Os
+.Sh NAME
+.Nm floor
+.Nd largest integral value not greater than x
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn floor "double x"
+.Sh DESCRIPTION
+The
+.Fn floor
+function computes the largest integral value not greater than
+.Fa x .
+.Sh RETURN VALUES
+The
+.Fn floor
+function returns the largest integral value
+expressed as a double.
+.Sh SEE ALSO
+.Xr abs 3 ,
+.Xr ieee 3 ,
+.Xr fabs 3 ,
+.Xr floor 3 ,
+.Xr rint 3 ,
+.Xr math 3
+.Sh STANDARDS
+The
+.Fn floor
+function conforms to
+.St -ansiC .
index d3c4807..0fd6d08 100644 (file)
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)hypot.3     6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH HYPOT 3M  ""
-.UC 4
-.ds up \fIulp\fR
-.ds nn \fINaN\fR
-.SH NAME
-hypot, cabs \- Euclidean distance, complex absolute value
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double hypot(x,y)
-.B double x,y;
-.PP
-.B double cabs(z)
-.B struct {double x,y;} z;
-.fi
-.SH DESCRIPTION
-Hypot(x,y) and cabs(x,y) return sqrt(x\(**x+y\(**y)
-computed in such a way that underflow will not happen, and overflow
+.\"     @(#)hypot.3    6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt HYPOT 3
+.Os BSD 4
+.Sh NAME
+.Nm hypot ,
+.Nm cabs
+.Nd euclidean distance and complex absolute value functions
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn hypot "double x" "double y"
+.Fd struct {double x, y;} z;
+.Ft double
+.Fn cabs z
+.Sh DESCRIPTION
+The
+.Fn hypot
+and
+.Fn cabs
+functions
+computes the
+sqrt(x*x+y*y)
+in such a way that underflow will not happen, and overflow
 occurs only if the final result deserves it.
 occurs only if the final result deserves it.
-.PP
-.if n \
-hypot(infinity,v) = hypot(v,infinity) = +infinity for all v, 
-.if t \
-hypot(\(if,v) = hypot(v,\(if) = +\(if for all v, 
-including \*(nn.
-.SH ERROR (due to Roundoff, etc.)
-Below 0.97 \*(ups.  Consequently hypot(5.0,12.0)\0=\013.0 exactly;
+.Pp
+.Fn hypot "\*(If" "v"
+=
+.Fn hypot "v" "\*(If"
+= +\*(If for all
+.Ar v ,
+including \*(Na.
+.Sh ERROR (due to Roundoff, etc.)
+Below 0.97
+.Em ulps .
+Consequently
+.Fn hypot "5.0" "12.0"
+= 13.0
+exactly;
 in general, hypot and cabs return an integer whenever an
 integer might be expected.
 in general, hypot and cabs return an integer whenever an
 integer might be expected.
-.PP
+.Pp
 The same cannot be said for the shorter and faster version of hypot
 and cabs that is provided in the comments in cabs.c; its error can
 The same cannot be said for the shorter and faster version of hypot
 and cabs that is provided in the comments in cabs.c; its error can
-exceed 1.2 \*(ups.
-.SH NOTES
-As might be expected, hypot(v,\*(nn) and hypot(\*(nn,v) are \*(nn for all
-\fIfinite\fR v; with "reserved operand" in place of "\*(nn", the
-same is true on a VAX.  But programmers on machines other than a VAX
-(it has no
-.if n \
-infinity)
-.if t \
-\(if)
+exceed 1.2
+.Em ulps .
+.Sh NOTES
+As might be expected,
+.Fn hypot "v" "\*(Na"
+and
+.Fn hypot "\*(Na" "v"
+are \*(Na for all
+.Em finite
+.Ar v ;
+with "reserved operand" in place of "\*(Na", the
+same is true on a
+.Tn VAX .
+But programmers on machines other than a
+.Tn VAX
+(if has no \*(If)
 might be surprised at first to discover that
 might be surprised at first to discover that
-.if n \
-hypot(\(+-infinity,\*(nn) = +infinity.
-.if t \
-hypot(\(+-\(if,\*(nn) = +\(if.
+.Fn hypot "\(+-\*(If" "\*(Na"
+= +\*(If.
 This is intentional; it happens because
 This is intentional; it happens because
-.if n \
-hypot(infinity,v) = +infinity
-.if t \
-hypot(\(if,v) = +\(if
-for \fIall\fR v, finite or infinite.
+.Fn hypot "\*(If" "v"
+= +\*(If
+for
+.Em all
+.Ar v ,
+finite or infinite.
 Hence
 Hence
-.if n \
-hypot(infinity,v)
-.if t \
-hypot(\(if,v)
-is independent of v.
-Unlike the reserved operand on a VAX, the IEEE \*(nn is designed to
+.Fn hypot "\*(If" "v"
+is independent of
+.Ar v .
+Unlike the reserved operand fault on a
+.Tn VAX ,
+the
+.Tn IEEE
+\*(Na is designed to
 disappear when it turns out to be irrelevant, as it does in
 disappear when it turns out to be irrelevant, as it does in
-.if n \
-hypot(infinity,\*(nn).
-.if t \
-hypot(\(if,\*(nn).
-.SH SEE ALSO
-math(3M), sqrt(3M)
-.SH AUTHOR
-W. Kahan
+.Fn hypot "\*(If" "\*(Na" .
+.Sh SEE ALSO
+.Xr math 3 ,
+.Xr sqrt 3
+.Sh AUTHOR
+.An W. Kahan
+.Sh HISTORY
+Both a
+.Fn hypot
+function and a
+.Fn cabs
+function
+appeared in
+.At v7 .
index e13f845..38d0628 100644 (file)
 From Prof. Kahan at UC at Berkeley
 From Prof. Kahan at UC at Berkeley
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)ieee.3      6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH IEEE 3M  ""
-.UC 6
-.ds nn \fINaN\fR
-.SH NAME
-copysign, drem, finite, logb, scalb \- copysign, remainder,
-exponent manipulations
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double copysign(x,y)
-.B double x,y;
-.PP
-.B double drem(x,y)
-.B double x,y;
-.PP
-.B int finite(x)
-.B double x;
-.PP
-.B double logb(x)
-.B double x;
-.PP
-.B double scalb(x,n)
-.B double x;
-.B int n;
-.fi
-.SH DESCRIPTION
-These functions are required for, or recommended by the IEEE standard
+.\"     @(#)ieee.3     6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt IEEE 3
+.Os BSD 4.3
+.Sh NAME
+.Nm copysign ,
+.Nm drem ,
+.Nm finite ,
+.Nm logb ,
+.Nm scalb
+.Nm copysign ,
+.Nm remainder,
+.Nd exponent manipulations
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double 
+.Fn copysign "double x" "double y"
+.Ft double 
+.Fn drem "double x" "double y"
+.Ft int 
+.Fn finite "double x"
+.Ft double 
+.Fn logb "double x"
+.Ft double 
+.Fn scalb "double x" "int n"
+.Sh DESCRIPTION
+These functions are required for, or recommended by the
+.Tn IEEE
+standard
 754 for floating\-point arithmetic.
 754 for floating\-point arithmetic.
-.PP
-Copysign(x,y)
-returns x with its sign changed to y's.
-.PP
-Drem(x,y) returns the remainder r := x \- n\(**y
-where n is the integer nearest the exact value of x/y;
-moreover if |n\|\-\|x/y|\|=\|1/2 then n is even.  Consequently
-the remainder is computed exactly and |r| \(<= |y|/2.  But
-drem(x,0) is exceptional; see below under DIAGNOSTICS.
-.PP
-.nf
-.ta \w'Finite(x)'u+1n +\w'= 0 otherwise'u+1n
-.if n \
-Finite(x)      = 1 just when \-infinity < x < +infinity,
-.if t \
-Finite(x)      = 1 just when \-\(if < x < +\(if,
-.if n \
-       = 0 otherwise   (when |x| = infinity or x is \*(nn or
-.if t \
-       = 0 otherwise   (when |x| = \(if or x is \*(nn or
-               \0x is the VAX's reserved operand.)
-.ta
-.fi
-.PP
-Logb(x) returns x's exponent n,
+.Pp
+The
+.Fn copysign
+function
+returns
+.Fa x
+with its sign changed to
+.Fa y Ns 's.
+.Pp
+The
+.Fn drem
+function
+returns the remainder
+.Fa r
+:=
+.Fa x
+\-
+.Fa n\(**y
+where
+.Fa n
+is the integer nearest the exact value of
+.Bk -words
+.Fa x Ns / Ns Fa y ;
+.Ek
+moreover if
+.Pf \\*(Ba Fa n
+\-
+.Sm off
+.Fa x No / Fa y No \\*(Ba
+.Sm on
+=
+1/2
+then
+.Fa n
+is even.  Consequently
+the remainder is computed exactly and
+.Sm off
+.Pf \\*(Ba Fa r No \\*(Ba
+.Sm on
+\*(Le
+.Sm off
+.Pf \\*(Ba Fa y No \\*(Ba/2.
+.Sm on
+But
+.Fn drem x 0
+is exceptional.
+(See below under
+.Sx DIAGNOSTICS . )
+.Pp
+The
+.Fn finite
+function returns the value 1 just when
+\-\*(If \*(Lt
+.Fa x
+\*(Lt +\*(If;
+otherwise a
+zero is returned
+(when
+.Pf \\*(Ba Ns Fa x Ns \\*(Ba
+= \*(If or
+.Fa x
+is \*(Na or
+is the
+.Tn VAX Ns 's
+reserved operand).
+.Pp
+The
+.Fn logb
+function returns
+.Fa x Ns 's exponent
+.Fa n ,
 a signed integer converted to double\-precision floating\-point and so
 a signed integer converted to double\-precision floating\-point and so
-chosen that 1\0\(<=\0|x|/2**n\0<\02 unless x = 0 or
-(only on machines that conform to IEEE 754)
-.if n \
-|x| = infinity
-.if t \
-|x| = \(if
-or x lies between 0 and the Underflow Threshold; see below under "BUGS".
-.PP
-Scalb(x,n) = x\(**(2**n) computed, for integer n, without first computing
-2**n.
-.SH DIAGNOSTICS
-IEEE 754 defines drem(x,0) and
+chosen that
+1 (<=
+.Pf \\*(Ba Ns Fa x Ns \\*(Ba2** Ns Fa n
+< 2
+unless
+.Fa x
+= 0 or
+(only on machines that conform to
+.Tn IEEE
+754)
+.Pf \\*(Ba Fa x Ns \\*(Ba
+= \*(If
+or
+.Fa x
+lies between 0 and the Underflow Threshold.
+(See below under
+.Sx BUGS . )
+.Pp
+The
+Fn calb
+returns
+.Fa x Ns \(**(2** Ns Fa n )
+computed, for integer n, without first computing
+.Pf 2\(** Fa n .
+.Sh RETURN VALUES
+The
+.Tn IEEE
+standard
+754 defines
+.Fn drem x 0
+and
+.Fn drem \\*(If y
+to be invalid operations that produce a \*(Na.
+On the
+.Tn VAX , 
+.Fn drem x 0
+generates a reserved operand fault.  No \*(If
+exists on a
+.Tn VAX . 
+.Pp
+.Tn IEEE
+754 defines
 .if n \
 .if n \
-drem(infinity,y)
-.if t \
-drem(\(if,y)
-to be invalid operations that produce a \*(nn.
-On a VAX, drem(x,0) returns the reserved operand.  No
-.if n \
-infinity
-.if t \
-\(if
-exists on a VAX.
-.PP
-IEEE 754 defines
-.if n \
-logb(\(+-infinity) = +infinity and logb(0) = \-infinity,
-.if t \
-logb(\(+-\(if) = +\(if and logb(0) = \-\(if, and
+.Fn logb \(+-\\*(If
+= \*(If and
+.Fn logb 0
+= \-\*(If, and
 requires the latter to signal Division\-by\-Zero.
 requires the latter to signal Division\-by\-Zero.
-But on a VAX, logb(0) = 1.0 \- 2.0**31 = \-2,147,483,647.0.
-And if the correct value of scalb(x,n) would overflow on a VAX,
-it returns the reserved operand and sets \fIerrno\fR to ERANGE.
-.SH SEE ALSO
-floor(3M), math(3M), infnan(3M)
-.SH AUTHOR
+But on a
+.Tn VAX , 
+.Fn logb 0
+= 1.0 \- 2.0**31 = \-2,147,483,647.0.
+And if the correct value of
+.Fn scalb
+would overflow on a
+.Tn VAX , 
+it generates a reserved operand fault and sets the global variable
+.Va errno
+to
+.Dv ERANGE . 
+.Sh SEE ALSO
+.Xr floor 3 ,
+.Xr math 3 ,
+.Xr infnan 3
+.Sh AUTHOR
 Kwok\-Choi Ng
 Kwok\-Choi Ng
-.SH BUGS
-Should drem(x,0) and logb(0) on a VAX signal invalidity 
-by setting \fIerrno\fR = EDOM?  Should  logb(0) return  \-1.7e38?
-.PP
-IEEE 754 currently specifies that
-logb(denormalized no.) = logb(tiniest normalized no. > 0)
+.Sh HISTORY
+The
+.Nm ieee
+functions appeared in 
+.Bx 4.3 .
+.Sh BUGS
+Should
+.Fn drem x 0
+and
+.Fn logb 0
+on a
+.Tn VAX
+signal invalidity 
+by setting
+.Va errno No = Dv EDOM ?
+Should
+.Fn logb 0
+return  \-1.7e38?
+.Pp
+.Tn IEEE
+754 currently specifies that
+.Fn logb "denormalized no."
+=
+.Fn logb "tiniest normalized no. > 0"
 but the consensus has changed to the specification in the new 
 but the consensus has changed to the specification in the new 
-proposed IEEE standard p854, namely that logb(x) satisfy 
-.RS
-1 \(<= scalb(|x|,\-logb(x)) < Radix\0\0\0... = 2 for IEEE 754
-.RE
+proposed
+.Tn IEEE
+standard p854, namely that
+.Fn logb x
+satisfy 
+.Bd -filled -offset indent
+1 \(<=
+.Fn scalb \\*(Bax\\*(Ba \-logb(x)
+<
+Radix\0 ... = 2
+for
+.Tn IEEE
+754
+.Ed
+.Pp
 for every x except 0, 
 for every x except 0, 
-.if n \
-infinity
-.if t \
-\(if
-and \*(nn.
+\*(If
+and \*(Na.
 Almost every program that assumes 754's specification will work
 Almost every program that assumes 754's specification will work
-correctly if logb follows 854's specification instead.
-.PP
-IEEE 754 requires copysign(x,\*(nn) = \(+-x  but says nothing
-else about the sign of a \*(nn.  A \*(nn (\fIN\fRot \fIa\fR \fIN\fRumber) is
-similar in spirit to the VAX's reserved operand, but very
+correctly if
+.Fn logb
+follows 854's specification instead.
+.Pp
+.Tn IEEE
+754 requires
+.Fn copysign x \\*(Na)
+=
+.Pf \(+- Ns Fa x
+but says nothing
+else about the sign of a \*(Na.  A \*(Na
+.Em N Ns ot
+.Em a
+.Em N Ns umber )
+is
+similar in spirit to the
+.Tn VAX Ns 's
+reserved operand, but very
 different in important details.  Since the sign bit of a
 reserved operand makes it look negative,  
 different in important details.  Since the sign bit of a
 reserved operand makes it look negative,  
-.RS
-copysign(x,reserved operand) = \-x;
-.RE
+.Bd -filled -offset indent
+.Fn copysign x "reserved operand"
+=
+.Pf \- Fa x ;
+.Ed
+.Pp
 should this return the reserved operand instead?
 should this return the reserved operand instead?
index 9e4fe19..34510c4 100644 (file)
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)infnan.3    6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH INFNAN 3M  ""
-.UC 6
-.ds nn \fINaN\fR
-.SH NAME
-infnan \- signals invalid floating-point operations on a VAX (temporary)
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double infnan(iarg)
-.B int iarg;
-.SH DESCRIPTION
+.\"     @(#)infnan.3   6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt INFNAN 3
+.Os BSD 4.3
+.Sh NAME
+.Nm infnan
+.Nd signals invalid floating\-point operations on a
+.Tn VAX
+(temporary)
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double 
+.Fn infnan "int iarg"
+.Sh DESCRIPTION
 At some time in the future, some of the useful properties of
 At some time in the future, some of the useful properties of
-the Infinities and \*(nns in the IEEE standard 754 for Binary
-Floating\-Point Arithmetic will be simulated in UNIX on the
-DEC VAX by using its Reserved Operands.  Meanwhile, the
+the Infinities and \*(Nas in the
+.Tn IEEE
+standard 754 for Binary
+Floating\-Point Arithmetic will be simulated in
+.Tn UNIX
+on the
+.Tn DEC VAX
+by using its Reserved Operands.  Meanwhile, the
 Invalid, Overflow and Divide\-by\-Zero exceptions of the
 Invalid, Overflow and Divide\-by\-Zero exceptions of the
-IEEE standard are being approximated on a VAX by calls to a
-procedure \fIinfnan\fR in appropriate places in \fIlibm\fR.  When
-better exception\-handling is implemented in UNIX, only
-\fIinfnan\fR among the codes in \fIlibm\fR will have to be changed.
-And users of \fIlibm\fR can design their own \fIinfnan\fR now to
+.Tn IEEE
+standard are being approximated on a
+.Tn VAX
+by calls to a
+procedure
+.Fn infnan
+in appropriate places in
+.Xr libm 3 .
+When
+better exception\-handling is implemented in
+.Tn UNIX , 
+only
+.Fn infnan
+among the codes in
+.Xr libm
+will have to be changed.
+And users of
+.Xr libm
+can design their own
+.Fn infnan
+now to
 insulate themselves from future changes.
 insulate themselves from future changes.
-.PP
-Whenever an elementary function code in \fIlibm\fR has to
-simulate one of the aforementioned IEEE exceptions, it calls
-infnan(iarg) with an appropriate value of \fIiarg\fR.  Then a
-reserved operand fault stops computation.  But \fIinfnan\fR could
+.Pp
+Whenever an elementary function code in
+.Xr libm
+has to
+simulate one of the aforementioned
+.Tn IEEE
+exceptions, it calls
+.Fn infnan iarg
+with an appropriate value of
+.Fa iarg .
+Then a
+reserved operand fault stops computation.  But
+.Fn infnan
+could
 be replaced by a function with the same name that returns
 some plausible value, assigns an apt value to the global
 be replaced by a function with the same name that returns
 some plausible value, assigns an apt value to the global
-variable \fIerrno\fR, and allows computation to resume.
+variable
+.Va errno ,
+and allows computation to resume.
 Alternatively, the Reserved Operand Fault Handler could be
 changed to respond by returning that plausible value, etc.
 instead of aborting.
 Alternatively, the Reserved Operand Fault Handler could be
 changed to respond by returning that plausible value, etc.
 instead of aborting.
-.PP
+.Pp
 In the table below, the first two columns show various
 In the table below, the first two columns show various
-exceptions signaled by the IEEE standard, and the default
+exceptions signaled by the
+.Tn IEEE
+standard, and the default
 result it prescribes.  The third column shows what value is
 result it prescribes.  The third column shows what value is
-given to \fIiarg\fR by functions in \fIlibm\fR when they
-invoke infnan(iarg) under analogous circumstances on a VAX.
-Currently \fIinfnan\fR stops computation under all those
+given to
+.Fa iarg
+by functions in
+.Xr libm
+when they
+invoke
+.Fn infnan iarg
+under analogous circumstances on a
+.Tn VAX . 
+Currently
+.Fn infnan
+stops computation under all those
 circumstances.  The last two columns offer an alternative;
 circumstances.  The last two columns offer an alternative;
-they suggest a setting for \fIerrno\fR and a value for a
-revised \fIinfnan\fR to return.  And a C program to
+they suggest a setting for
+.Va errno
+and a value for a
+revised
+.Fn infnan
+to return.  And a C program to
 implement that suggestion follows. 
 .sp 0.5
 implement that suggestion follows. 
 .sp 0.5
-.RS
-.nf
-.ta \w'Div\-by\-0'u+2n +\w'+Infinity'u+1n +\w'+ERANGE'u+1n +\w'ERANGE or EDOM'u+4n +\w'+HUGE'u+1n
-IEEE   IEEE
-Signal Default \fIiarg\fR      \fIerrno\fR     \fIinfnan\fR
-.if t \{\
-.sp -0.5
-.ta \w'Div\-by\-0'u+2n+\w'+Infinity'u+1n+\w'+ERANGE'u+1n+\w'ERANGE or EDOM'u+4n+\w'+HUGE'u+1n
-.tc \(ru
-       
-.ta \w'Div\-by\-0'u+2n +\w'+Infinity'u+1n +\w'+ERANGE'u+1n +\w'ERANGE or EDOM'u+4n +\w'+HUGE'u+1n
-.tc \}
-.if n \
-\l'5i'
-Invalid        \*(nn   EDOM    EDOM    0
-.if n \{\
-Overflow       \(+-Infinity    ERANGE  ERANGE  HUGE
-Div\-by\-0     \(+-Infinity    \(+-ERANGE      ERANGE or EDOM  \(+-HUGE \}
-.if t \{\
-Overflow       \(+-\(if        ERANGE  ERANGE  HUGE
-Div\-by\-0     \(+-\(if        \(+-ERANGE      ERANGE or EDOM  \(+-HUGE \}
-.sp 0.5
-       (HUGE = 1.7e38 ... nearly  2.0**127)
-.ta
-.fi
-.RE
-.sp 0.5
-.PP
-.nf
-.ta \w'\fBextern int\fR'u+1n +\w'\fBdefault:\fR'u+1n +\w'\fB\-ERANGE:\fR'u+1n +\w'\fBerrno = ERANGE;\fR'u+1n
-ALTERNATIVE  \fIinfnan\fR:\fB
-.sp 0.5
+.Bd -filled -offset indent
+.Bl -column "IEEE Signal" "IEEE Default" XXERANGE ERANGEXXorXXEDOM
+.It IEEE Signal        IEEE Default Ta
+.Fa iarg Ta
+.Va errno Ta
+.Fn infnan
+.It Invalid    \*(Na Ta
+.Dv EDOM       EDOM    0
+.It Overflow   \(+-\*(If Ta
+.Dv ERANGE     ERANGE  HUGE
+.It Div\-by\-0 \(+-Infinity Ta
+.Dv \(+-ERANGE ERANGE or EDOM  \(+-HUGE
+.It    ( Ns Dv HUGE No "= 1.7e38 ... nearly  2.0**127)"
+.El
+.Ed
+.Pp
+ALTERNATIVE
+.Fn infnan :
+.Bd -literal -offset indent
 #include       <math.h>
 #include       <errno.h>
 extern int     errno ;
 #include       <math.h>
 #include       <errno.h>
 extern int     errno ;
@@ -89,15 +125,30 @@ double     infnan(iarg)
 int    iarg ;
 {
        switch(iarg) {
 int    iarg ;
 {
        switch(iarg) {
-       case    \0ERANGE:       errno = ERANGE; return(HUGE);
+       case    \0ERANGE:       errno = ERANGE; return(HUGE);
        case    \-ERANGE:       errno = EDOM;   return(\-HUGE);
        default:                errno = EDOM;   return(0);
        }
        case    \-ERANGE:       errno = EDOM;   return(\-HUGE);
        default:                errno = EDOM;   return(0);
        }
-}\fR
-.ta
-.fi
-.SH SEE ALSO
-math(3M), intro(2), signal(3).
-.PP
-ERANGE and EDOM are defined in <errno.h>.  See intro(2)
-for explanation of EDOM and ERANGE.
+}
+.Ed
+.Sh SEE ALSO
+.Xr math 3 ,
+.Xr intro 2 ,
+.Xr signal 3 .
+.Pp
+.Dv ERANGE
+and
+.Dv EDOM
+are defined in
+.Aq Pa errno.h .
+(See
+.Xr intro 2
+for explanation of
+.Dv EDOM
+and
+.Dv ERANGE . )
+.Sh HISTORY
+The
+.Fn infnan
+function appeared in 
+.Bx 4.3 .
index 0e965c2..30a18d9 100644 (file)
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)j0.3        6.6 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH J0 3M  ""
-.UC 4
-.SH NAME
-j0, j1, jn, y0, y1, yn \- bessel functions
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double j0(x)
-.B double x;
-.PP
-.B double j1(x)
-.B double x;
-.PP
-.B double jn(n,x)
-.B int n;
-.B double x;
-.PP
-.B double y0(x)
-.B double x;
-.PP
-.B double y1(x)
-.B double x;
-.PP
-.B double yn(n,x)
-.B int n;
-.B double x;
-.fi
-.SH DESCRIPTION
-These functions calculate Bessel functions of the first
-and second kinds for real arguments and integer orders.
-.SH DIAGNOSTICS
-On a VAX, negative arguments cause y0, y1 and yn
-to return the reserved operand and set \fIerrno\fR to EDOM.
-.SH SEE ALSO
-math(3M), infnan(3M)
+.\"     @(#)j0.3       6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt J0 3
+.Os BSD 4
+.Sh NAME
+.Nm j0 ,
+.Nm j1 ,
+.Nm jn ,
+.Nm y0 ,
+.Nm y1 ,
+.Nm yn
+.Nd bessel functions of first and second kind
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn j0 "double x"
+.Ft double
+.Fn j1 "double x"
+.Ft double
+.Fn jn "int n" "double x"
+.Ft double
+.Fn y0 "double x"
+.Ft double
+.Fn y1 "double x"
+.Ft double
+.Fn yn "int n" "double x"
+.Sh DESCRIPTION
+The functions
+.Fn j0
+and
+.Fn j1
+compute the
+.Em Bessel function of the first kind of the order
+0 and the
+.Em order
+1, respectively,
+for the
+real value
+.Fa x ;
+the function
+.Fn jn
+computes the
+.Em Bessel function of the first kind of the integer order
+.Fa n
+for the real value
+.Fa x .
+.Pp
+The functions
+.Fn y0
+and
+.Fn y1
+compute the linearly independent
+.Em Bessel function of the second kind of the order
+0 and the
+.Em order
+1, respectively,
+for the
+postive
+.Em integer
+value
+.Fa x
+(expressed as a double);
+the function
+.Fn yn
+computes the
+.Em Bessel function of the second kind for the integer order
+.Fa n
+for the postive 
+.Em integer
+value
+.Fa x
+(expressed as a double).
+.Sh RETURN VALUES
+If these functions are successful,
+the computed value is returned. On the
+.Tn VAX
+and
+.Tn Tahoe
+architectures,
+a negative
+.Fa x
+value
+results in an error; the global
+variable
+.Va errno
+is set to
+.Er EDOM
+and a reserve operand fault is generated.
+.Sh SEE ALSO
+.Xr math 3 ,
+.Xr infnan 3
+.Sh HISTORY
+A set of these functions
+function appeared in
+.At v7 .
index 50d7035..af0de70 100644 (file)
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)sin.3       6.6 (Berkeley) %G%
+.\"    @(#)sin.3       6.7 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SIN 3M  ""
-.UC 4
-.de Pi         \" PI stuff sign
-.if n \\
-\\$2pi\\$1
-.if t \\
-\\$2\\(*p\\$1
-..
-.ds up \fIulp\fR
-.SH NAME
-sin, cos, tan, asin, acos, atan, atan2 \- trigonometric functions
-and their inverses
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double sin(x)
-.B double x;
-.PP
-.B double cos(x)
-.B double x;
-.PP
-.B double tan(x)
-.B double x;
-.PP
-.B double asin(x)
-.B double x;
-.PP
-.B double acos(x)
-.B double x;
-.PP
-.B double atan(x)
-.B double x;
-.PP
-.B double atan2(y,x)
-.B double y,x;
-.fi
-.SH DESCRIPTION
-Sin, cos and tan
-return trigonometric functions of radian arguments x.
-.PP
-Asin returns the arc sine in the range 
-.Pi /2 \-
-to
-.Pi /2.
-.PP
-Acos returns the arc cosine in the range 0 to
-.Pi.
-.PP
-Atan returns the arc tangent in the range
-.Pi /2 \-
-to
-.Pi /2.
-.PP
-On a VAX,
-.nf
-.if n \{\
-.ta \w'atan2(y,x) := 'u+2n +\w'sign(y)\(**(pi \- atan(|y/x|))'u+2n
-atan2(y,x) :=  atan(y/x)       if x > 0,
-       sign(y)\(**(pi \- atan(|y/x|))  if x < 0,
-       0       if x = y = 0, or
-       sign(y)\(**pi/2 if x = 0 != y.  \}
-.if t \{\
-.ta \w'atan2(y,x) := 'u+2n +\w'sign(y)\(**(\(*p \- atan(|y/x|))'u+2n
-atan2(y,x) :=  atan(y/x)       if x > 0,
-       sign(y)\(**(\(*p \- atan(|y/x|))        if x < 0,
-       0       if x = y = 0, or
-       sign(y)\(**\(*p/2       if x = 0 \(!= y.  \}
-.ta
-.fi
-.SH DIAGNOSTICS
-On a VAX, if |x| > 1 then asin(x) and acos(x)
-will return reserved operands and \fIerrno\fR will be set to EDOM.
-.SH NOTES
-Atan2 defines atan2(0,0) = 0 on a VAX despite that previously
-atan2(0,0) may have generated an error message.
-The reasons for assigning a value to atan2(0,0) are these:
-.IP (1) \w'\0\0\0\0'u
-Programs that test arguments to avoid computing
-atan2(0,0) must be indifferent to its value.
-Programs that require it to be invalid are vulnerable
-to diverse reactions to that invalidity on diverse computer systems. 
-.IP (2) \w'\0\0\0\0'u
-Atan2 is used mostly to convert from rectangular (x,y)
-to polar
-.if n\
-(r,theta)
-.if t\
-(r,\(*h)
-coordinates that must satisfy x =
-.if n\
-r\(**cos theta
-.if t\
-r\(**cos\(*h
-and y =
-.if n\
-r\(**sin theta.
-.if t\
-r\(**sin\(*h.
-These equations are satisfied when (x=0,y=0)
-is mapped to 
-.if n \
-(r=0,theta=0)
-.if t \
-(r=0,\(*h=0)
-on a VAX.  In general, conversions to polar coordinates
-should be computed thus:
-.nf
-.ta 1iR +1n +\w' := hypot(x,y);'u+0.5i
-.if n \{\
-       r       := hypot(x,y);  ... := sqrt(x\(**x+y\(**y)
-       theta   := atan2(y,x).
-.ta \}
-.if t \{\
-       r       := hypot(x,y);  ... := \(sr(x\u\s82\s10\d+y\u\s82\s10\d)
-       \(*h    := atan2(y,x).
-.ta \}
-.fi
-.IP (3) \w'\0\0\0\0'u
-The foregoing formulas need not be altered to cope in a
-reasonable way with signed zeros and infinities
-on a machine that conforms to IEEE 754;
-the versions of hypot and atan2 provided for
-such a machine are designed to handle all cases.
-That is why atan2(\(+-0,\-0) =
-.Pi , \(+-
-for instance.
-In general the formulas above are equivalent to these:
-.RS
-.nf
-.if n \
-r := sqrt(x\(**x+y\(**y); if r = 0 then x := copysign(1,x);
-.if t \
-r := \(sr(x\(**x+y\(**y);\0\0if r = 0 then x := copysign(1,x);
-.br
-.if n \
-.ta 1i
-.if t \
-.ta \w'if x > 0'u+2n +\w'then'u+2n
-.if n \
-if x > 0       then theta := 2\(**atan(y/(r+x))
-.if t \
-if x > 0       then    \(*h := 2\(**atan(y/(r+x))
-.if n \
-       else theta := 2\(**atan((r\-x)/y);
-.if t \
-       else    \(*h := 2\(**atan((r\-x)/y);
-.fi
-.RE
-except if r is infinite then atan2 will yield an
-appropriate multiple of
-.Pi /4
-that would otherwise have to be obtained by taking limits.
-.SH ERROR (due to Roundoff etc.)
-Let P stand for the number stored in the computer in place of
-.Pi " = 3.14159 26535 89793 23846 26433 ... ."
-Let "trig" stand for one of "sin", "cos" or "tan".  Then
-the expression "trig(x)" in a program actually produces an
-approximation to
-.Pi /P), trig(x\(**
-and "atrig(x)" approximates
-.Pi )\(**atrig(x). (P/
-The approximations are close,  within 0.9 \*(ups for sin,
-cos and atan, within 2.2 \*(ups for tan, asin,
-acos and atan2 on a VAX.  Moreover,
-.Pi \& "P = "
-in the codes that run on a VAX.
-
-In the codes that run on other machines, P differs from
-.Pi
-by a fraction of an \*(up; the difference matters only if the argument
-x is huge, and even then the difference is likely to be swamped by
-the uncertainty in x.  Besides, every trigonometric identity that
-does not involve
-.Pi
-explicitly is satisfied equally well regardless of whether
-.Pi . "P = "
-For instance,
-.if n \
-sin(x)**2+cos(x)**2\0=\01
-.if t \
-sin\u\s62\s10\d(x)+cos\u\s62\s10\d(x)\0=\01
-and sin(2x)\0=\02\|sin(x)cos(x) to within a few \*(ups no matter how big
-x may be.  Therefore the difference between P and
-.Pi
-is most unlikely to affect scientific and engineering computations.
-.SH SEE ALSO
-math(3M), hypot(3M), sqrt(3M), infnan(3M)
-.SH AUTHOR
-Robert P. Corbett, W. Kahan, Stuart\0I.\0McDonald, Peter\0Tang and,
-for the codes for IEEE 754, Dr. Kwok\-Choi\0Ng.
+.\"     @(#)sin.3      6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SIN 3
+.Os
+.Sh NAME
+.Nm sin
+.Nd sine function
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn sin "double x"
+.Sh DESCRIPTION
+The
+.Fn sin
+function computes the sine of
+.Fa x
+(measured in radians).
+A large magnitude argument may yield a result with little
+or no significance.
+.Sh RETURN VALUES
+The
+.Fn sin
+function returns the sine value.
+.Sh SEE ALSO
+.Xr acos 3 ,
+.Xr asin 3 ,
+.Xr atan 3 ,
+.Xr atan2 3 ,
+.Xr cos 3 ,
+.Xr cosh 3 ,
+.Xr sinh 3 ,
+.Xr tan 3 ,
+.Xr tanh 3 ,
+.Xr math 3 ,
+.Sh STANDARDS
+The
+.Fn sin
+function conforms to
+.St -ansiC .
index fe7e3b5..7cb77b7 100644 (file)
@@ -1,35 +1,48 @@
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1991 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)sinh.3      6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SINH 3M  ""
-.UC 4
-.SH NAME
-sinh, cosh, tanh \- hyperbolic functions
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double sinh(x)
-.B double x;
-.PP
-.B double cosh(x)
-.B double x;
-.PP
-.B double tanh(x)
-.B double x;
-.fi
-.SH DESCRIPTION
-These functions compute the designated hyperbolic functions for real arguments.
-.SH ERROR (due to Roundoff etc.)
-Below 2.4 \fIulp\fRs; an \fIulp\fR is one \fIU\fRnit in the \fIL\fRast
-\fIP\fRlace.
-.SH DIAGNOSTICS
-Sinh and cosh return the reserved operand on a VAX if
-the correct value would overflow.
-.SH SEE ALSO
-math(3M), infnan(3M)
-.SH AUTHOR
-W. Kahan, Kwok\-Choi Ng
+.\"    @(#)sinh.3      6.6 (Berkeley) %G%
+.Dd 
+.Dt SINH 3
+.Os
+.Sh NAME
+.Nm sinh
+.Nd hyperbolic sine function
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn sinh "double  x"
+.Sh DESCRIPTION
+The
+.Fn sinh
+function computes the hyperbolic sine of
+.Fa x .
+.Sh RETURN VALUES
+The
+.Fn sinh
+function returns the hyperbolic sine value unless
+the  magnitude 
+of
+.Fa x
+is too large; in this event, the global variable
+.Va errno
+is set to
+.Er ERANGE .
+.Sh SEE ALSO
+.Xr acos 3 ,
+.Xr asin 3 ,
+.Xr atan 3 ,
+.Xr atan2 3 ,
+.Xr cos 3 ,
+.Xr cosh 3 ,
+.Xr sin 3 ,
+.Xr tan 3 ,
+.Xr tanh 3 ,
+.Xr math 3 ,
+.Sh STANDARDS
+The
+.Fn sinh
+function conforms to
+.St -ansiC .
index b8b9268..005564c 100644 (file)
@@ -1,41 +1,96 @@
-.\" Copyright (c) 1985 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1985, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)sqrt.3      6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SQRT 3M  ""
-.UC 6
-.ds up \fIulp\fR
-.SH NAME
-cbrt, sqrt \- cube root, square root
-.SH SYNOPSIS
-.nf
-.B #include <math.h>
-.PP
-.B double cbrt(x)
-.B double x;
-.PP
-.B double sqrt(x)
-.B double x;
-.fi
-.SH DESCRIPTION
-Cbrt(x) returns the cube root of x.
-.PP
-Sqrt(x) returns the square root of x.
-.SH DIAGNOSTICS
-On a VAX, sqrt(negative)
-returns the reserved operand and sets \fIerrno\fR to EDOM .
-.SH ERROR (due to Roundoff etc.)
-Cbrt is accurate to within 0.7 \*(ups.
-.br
-Sqrt on a VAX is accurate to within 0.501 \*(ups.
-.br
-Sqrt on a machine that conforms to IEEE 754 is correctly rounded
+.\"     @(#)sqrt.3     6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SQRT 3
+.Os
+.Sh NAME
+.Nm cbrt ,
+.Nm sqrt
+.Nd cube root and square root functions
+.Sh SYNOPSIS
+.Fd #include <math.h>
+.Ft double
+.Fn cbrt "double x"
+.Ft double
+.Fn sqrt "double x"
+.Sh DESCRIPTION
+The
+.Fn cbrt
+function computes
+the cube root of
+.Ar x .
+.Pp
+The
+.Fn sqrt
+computes the
+non-negative square root of x.
+.Sh RETURN VALUES
+The
+.Fn cbrt
+function returns the requested cube root.
+The
+.Fn sqrt
+function returns the requested square root
+unless an error occurs.
+On the
+.Tn VAX
+or
+.Tn Tahoe
+processor an attempt to take the
+.Fn sqrt
+of negative
+.Fa x
+causes an error; in this event,
+the global variable
+.Va errno
+is set to
+.Dv EDOM
+and a reserved operand fault is generated.
+.Sh ERROR (due to Roundoff etc.)
+The
+.Fn cbrt
+function
+is accurate to within 0.7
+.Em ulps .
+.Pp
+The
+.Fn sqrt
+function on a
+.Tn VAX
+is accurate to within 0.501
+.Em ulps .
+Sqrt on a machine that conforms to
+.Tn IEEE
+754 is correctly rounded
 in accordance with the rounding mode in force; the error is less than
 in accordance with the rounding mode in force; the error is less than
-half an \*(up in the default mode (round\-to\-nearest).
-An \*(up is one \fIU\fRnit in the \fIL\fRast \fIP\fRlace carried.
-.SH SEE ALSO
-math(3M), infnan(3M)
-.SH AUTHOR
-W. Kahan
+half an
+.Em ulp
+in the default mode (round\-to\-nearest).
+An
+.Em ulp
+is one
+.Em U Ns nit
+in the
+.Em L Ns ast
+.Em P Ns lace
+carried.
+.Sh SEE ALSO
+.Xr math 3 ,
+.Xr infnan 3
+.Sh AUTHOR
+.An W. Kahan
+.Sh STANDARDS
+The
+.Nm sqrt
+function conforms to
+.St -ansiC .
+.Sh HISTORY
+The
+.Nm cbrt
+function appeared in
+.Bx 4.3 .
index 14c5cc8..ece902c 100644 (file)
-.\" Copyright (c) 1986 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1986, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)mp.3        6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH MP 3X ""
-.UC 6
-.SH NAME
-madd, msub, mult, mdiv, pow, gcd, invert, rpow, msqrt, mcmp,
-move, min, omin, fmin, m_in, mout, omout, fmout, m_out, sdiv, itom
-\- multiple precision integer arithmetic
-.SH SYNOPSIS
-.nf
-.B #include <mp.h>
-.B #include <stdio.h>
-.PP
-.B "typedef struct mint { int len; short *val; } MINT;"
-.PP
-.B madd(a, b, c)
-.B msub(a, b, c)
-.B mult(a, b, c)
-.B mdiv(a, b, q, r)
-.B pow(a, b, m, c)
-.B gcd(a, b, c)
-.B invert(a, b, c)
-.B rpow(a, n, c)
-.B msqrt(a, b, r)
-.B mcmp(a, b)
-.B move(a, b)
-.B min(a)
-.B omin(a)
-.B fmin(a, f)
-.B m_in(a, n, f)
-.B mout(a)
-.B omout(a)
-.B fmout(a, f)
-.B m_out(a, n, f)
-.B MINT *a, *b, *c, *m, "*q, *r;"
-.B FILE *f;
-.B int n;
-.PP
-.B sdiv(a, n, q, r)
-.B MINT *a, *q;
-.B short n;
-.B short *r;
-.PP
-.B MINT *itom(n)
-.SH DESCRIPTION
-These routines perform arithmetic on integers of
-arbitrary length.
-The integers are stored using the defined type
-.IR MINT .
-Pointers to a
-.I MINT
-can be initialized using the function
-.I itom
-which sets the initial value to
-.IR n .
-After that, space is managed automatically by the routines.
-.PP
-.IR madd , " msub " and " mult"
-assign to
-.I c
-the sum, difference and
-product, respectively, of
-.IR a " and " b .
-.I mdiv
-assigns to
-.IR q " and " r
-the quotient and remainder obtained
-from dividing
-.IR a " by " b.
-.I sdiv
-is like
-.I mdiv
-except that the divisor is a short integer
-.I n
-and the remainder is placed in a short
-whose address is given as
-.IR r .
-.I msqrt
-produces the integer square root of
-.IR a " in " b
-and places the remainder in
-.IR r .
-.I rpow
-calculates in
-.I c
-the value of
-.I a
-raised to the (``regular'' integral) power
-.IR n ,
-while
-.I pow
-calculates this with a full multiple precision exponent
-.I b
-and the result is reduced modulo
-.IR m .
-.I gcd
-returns the greatest common denominator of
-.IR a " and " b " in " c ,
+.\"     @(#)mp.3       6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt MP 3
+.Os BSD 4.3
+.Sh NAME
+.Nm fmin ,
+.Nm fmout ,
+.Nm gcd ,
+.Nm invert ,
+.Nm itom
+.Nm m_in ,
+.Nm m_out ,
+.Nm madd ,
+.Nm mcmp,
+.Nm mdiv ,
+.Nm min ,
+.Nm mout ,
+.Nm move ,
+.Nm msqrt ,
+.Nm msub ,
+.Nm mult ,
+.Nm omin ,
+.Nm omout ,
+.Nm pow ,
+.Nm rpow ,
+.Nm sdiv ,
+.Nd multiple precision integer arithmetic
+.Sh SYNOPSIS
+.Fd #include <mp.h>
+.Fd #include <stdio.h>
+.Fd "typedef struct mint { int len; short *val; } MINT;"
+.Fn madd "MINT *a" "MINT *b" "MINT *c"
+.Fn msub "MINT *a" "MINT *b" "MINT *c"
+.Fn mult "MINT *a" "MINT *b" "MINT *c"
+.Fn mdiv "MINT *a" "MINT *b" "MINT *q" "short r"
+.Fn pow "MINT *a" "MINT *b" m "MINT *c"
+.Fn gcd "MINT *a" "MINT *b" "MINT *c"
+.Fn invert "MINT *a" "MINT *b" "MINT *c"
+.Fn rpow "MINT *a" "short n" "MINT *c"
+.Fn msqrt "MINT *a" "MINT *b" "short r"
+.Fn mcmp "MINT *a" "MINT *b"
+.Fn move "MINT *a" "MINT *b"
+.Fn min "MINT *a"
+.Fn omin "MINT *a"
+.Fn fmin "MINT *a" "FILE *f"
+.Fn m_in "MINT *a" "int n" "FILE *f"
+.Fn mout "MINT *a"
+.Fn omout "MINT *a"
+.Fn fmout "MINT *a" "FILE *f"
+.Fn m_out "MINT *a" "int n" "FILE *f"
+.Fn sdiv "MINT *a" "short n" "MINT *q" "short r"
+.Fn itom "short n"
+.Sh DESCRIPTION
+.Bf -symbolic
+The interface for this library is expected to change.
+.Ef
+.Pp
+These functions operate on integers of variable length.
+The function
+.Fn itom
+allocates space for an integer of length
+.Fa n
+which may be accessed via the returned
+.Fa MINT
+pointer.
+The underlying storage scheme is transparent to the user.
+.Pp
+.Bl -tag -width "mdivXXX" -compact
+.It Fn fmin
+.It Fn fmout
+Convert decimal input and output using file
+.Fa f .
+.Pp
+.It Fn gcd
+Finds the greatest common denominator of
+.Fa a
 and
 and
-.I invert
-computes
-.IR c " such that " a*c " mod " b " = 1,"
+.Fa b ,
+storing the result
+in
+.Fa c .
+.Pp
+.It Fn invert
+Computes
+.Fa c
+such that
+.Fa a Ns * Fa c No mod
+.Fa b
+= 1,
 for
 for
-.IR a " and " b
+.Fa a
+and
+.Fa b
 relatively prime.
 relatively prime.
-.I mcmp
-returns a negative, zero or positive integer value when
-.I a
+.Pp
+.It Fn m_in
+.It Fn m_out
+.Tn I/O
+with arbitrary radix
+.Fa n .
+.Pp
+.It Fn madd
+The sum of
+.Fa a
+and
+.Fa b
+is stored in
+.Fa c .
+.Pp
+.It Fn mcmp
+Returns a negative, zero or positive integer value when
+.Fa a
 is less than, equal to or greater than
 is less than, equal to or greater than
-.IR b ,
+.Fa b ,
 respectively.
 respectively.
-.I move
-copies
-.IR a " to " b .
-.IR min " and " mout
-do decimal input and output while
-.IR omin " and " omout
-do octal input and output.
-More generally,
-.IR fmin " and " fmout
-do decimal input and output using file
-.IR f ,
+.It Fn move
+Copies
+.Fa a
+to
+.Fa b .
+.Pp
+.It Fn min
+.It Fn mout
+Convert decimal input and output.
+.Pp
+.It Fn mdiv
+Divides
+.Fa a
+by
+.Fa b
+and stores the quotient in
+.Fa q
+and the remainder in
+.Fa r .
+.Pp
+.It Fn msqrt
+Calculates the integer square root of
+.Fa a
+in
+.Fa b
+and places the remainder in
+.Fa r .
+.Pp
+.It Fn msub
+The difference of
+.Fa a
+and
+.Fa b
+is stored in
+.Fa c .
+.Pp
+.It Fn mult
+The product of
+.Fa a
 and
 and
-.IR m_in " and " m_out
-do I/O with arbitrary radix
-.IR n .
+.Fa b
+is stored in
+.Fa c .
+.Pp
+.It Fn omin
+.It Fn omout
+Convert octal input and output.
+.Pp
+.It Fn pow
+Calculates
+the value of
+.Fa a
+raised to the
+full multiple precision exponent
+.Fa b ,
+the result is reduced modulo
+.Fa m
+and stored in
+.Fa c .
+.Pp
+.It Fn rpow
+Calculates
+the value of
+.Fa a
+raised to the (``regular'' integral) power
+.Fa n
+and stores the result in
+.Fa c .
+.Pp
+.It Fn sdiv
+(Short divisor.)
+Divides
+.Fa a
+by the short integer
+.Fa b
+and stores the quotient in
+.Fa q
+and the remainder in short integer
+.Fa r .
 On input, records should have the form of
 strings of digits terminated by a newline;
 output records have a similar form.
 On input, records should have the form of
 strings of digits terminated by a newline;
 output records have a similar form.
-.PP
-Programs which use the multiple-precision arithmetic library
-must be loaded using the loader flag
-.IR \-lmp .
-.SH FILES
-.ta 2i
-/usr/include/mp.h      include file
-.br
-/usr/lib/libmp.a       object code library
-.SH SEE ALSO
-dc(1), bc(1)
-.SH DIAGNOSTICS
-Illegal operations and running out of memory
-produce messages and core images.
-.SH BUGS
+.El
+.Sh FILES
+.Bl -tag -width /usr/include/mp.h -compact
+.It Pa /usr/lib/libmp.a
+object code library
+.It Pa /usr/include/mp.h
+include file
+.El
+.Sh SEE ALSO
+.Xr dc 1 ,
+.Xr bc 1
+.Sh HISTORY
+A
+.Fn gcd ,
+.Fn itom ,
+.Fn madd ,
+.Fn mdiv ,
+.Fn min ,
+.Fn mout ,
+.Fn msqrt ,
+.Fn msub ,
+.Fn mult ,
+.Fn pow ,
+.Fn rpow ,
+and
+.Fn sdiv
+function appeared in
+.At v7 .
+.\" The rest of the functions appeared in
+.\" .Bx ??
+.Sh BUGS
 Bases for input and output should be <= 10.
 Bases for input and output should be <= 10.
-.PP
-.IR dc (1)
+.Pp
+The interpreters
+.Xr dc 1
 and
 and
-.IR bc (1)
+.Xr bc 1
 don't use this library.
 don't use this library.
-.PP
+.Pp
 The input and output routines are a crock.
 The input and output routines are a crock.
-.PP
-.I pow
+.Pp
+The function name
+.Fn pow
 is also the name of a standard math library routine.
 is also the name of a standard math library routine.
index 261197d..0235627 100644 (file)
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)termcap.3   6.5 (Berkeley) %G%
+.\"     @(#)termcap.3  6.6 (Berkeley) %G%
 .\"
 .\"
-.TH TERMCAP 3 ""
-.UC 4
-.SH NAME
-tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs \- terminal independent operation routines
-.SH SYNOPSIS
-.nf
-.B char PC;
-.B char *BC;
-.B char *UP;
-.B short ospeed;
-.PP
-.B tgetent(bp, name)
-.B char *bp, *name;
-.PP
-.B tgetnum(id)
-.B char *id;
-.PP
-.B tgetflag(id)
-.B char *id;
-.PP
-.B char *
-.B tgetstr(id, area)
-.B char *id, **area;
-.PP
-.B char *
-.B tgoto(cm, destcol, destline)
-.B char *cm;
-.PP
-.B tputs(cp, affcnt, outc)
-.B register char *cp;
-.B int affcnt;
-.B int (*outc)();
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt TERMCAP 3
+.Os BSD 4
+.Sh NAME
+.Nm tgetent ,
+.Nm tgetnum ,
+.Nm tgetflag ,
+.Nm tgetstr ,
+.Nm tgoto ,
+.Nm tputs
+.Nd terminal independent operation routines
+.Sh SYNOPSIS
+.Vt char PC;
+.Vt char *BC;
+.Vt char *UP;
+.Vt short ospeed;
+.Fn tgetent "char *bp" "char *name"
+.Fn tgetnum "char *id"
+.Fn tgetflag "char *id"
+.Ft char *
+.Fn tgetstr "char *id" "char *area"
+.Ft char *
+.Fn tgoto "char *cm" destcol destline
+.Fn tputs "register char *cp" "int affcnt" "int (*outc)()"
+.Sh DESCRIPTION
 These functions extract and use capabilities from a terminal capability data
 These functions extract and use capabilities from a terminal capability data
-base, usually /usr/share/misc/termcap, the format of which is described in
-.IR termcap (5).
+base, usually
+.Pa /usr/share/misc/termcap ,
+the format of which is described in
+.Xr termcap 5 .
 These are low level routines;
 see
 These are low level routines;
 see
-.IR curses (3X)
+.Xr curses 3
 for a higher level package.
 for a higher level package.
-.PP
-.I Tgetent
+.Pp
+The
+.Fn tgetent
+function
 extracts the entry for terminal
 extracts the entry for terminal
-.I name
+.Fa name
 into the buffer at
 into the buffer at
-.I bp.
-.I Bp
+.Fa bp .
+The
+.Fa bp
+argument
 should be a character buffer of size
 1024 and must be retained through all subsequent calls to
 should be a character buffer of size
 1024 and must be retained through all subsequent calls to
-.I tgetnum,
-.I tgetflag,
+.Fn tgetnum ,
+.Fn tgetflag ,
 and
 and
-.I tgetstr.
-.I Tgetent
-returns \-1 if none of the termcap
+.Fn tgetstr .
+The
+.Fn tgetent
+function
+returns \-1 if none of the
+.Nm termcap
 data base files could be opened,
 0 if the terminal name given does not have an entry,
 and 1 if all goes well.
 data base files could be opened,
 0 if the terminal name given does not have an entry,
 and 1 if all goes well.
-It will look in the environment for a TERMCAP variable.
+It will look in the environment for a
+.Ev TERMCAP
+variable.
 If found, and the value does not begin with a slash,
 and the terminal type
 If found, and the value does not begin with a slash,
 and the terminal type
-.I name
-is the same as the environment string TERM,
-the TERMCAP string is used instead of reading a termcap file.
+.Fa name
+is the same as the environment string
+.Ev TERM ,
+the
+.Ev TERMCAP
+string is used instead of reading a
+.Nm termcap
+file.
 If it does begin with a slash, the string is used as a path name
 If it does begin with a slash, the string is used as a path name
-of the termcap file to search.
-If TERMCAP does not begin with a slash and
-.I name
-is different from TERM,
-.I tgetent
-searches the files $HOME/.termcap and /usr/share/misc/termcap,
-in that order, unless the environment variable TERMPATH exists,
+of the
+.Nm termcap
+file to search.
+If
+.Ev TERMCAP
+does not begin with a slash and
+.Fa name
+is different from
+.Ev TERM ,
+.Fn tgetent
+searches the files
+.Pa $HOME/.termcap
+and
+.Pa /usr/share/misc/termcap ,
+in that order, unless the environment variable
+.Ev TERMPATH
+exists,
 in which case it specifies a list of file pathnames
 (separated by spaces or colons) to be searched instead.
 Whenever multiple files are searched and a
 in which case it specifies a list of file pathnames
 (separated by spaces or colons) to be searched instead.
 Whenever multiple files are searched and a
-.B tc
+.Sy tc
 field occurs in the requested entry, the entry it names must be found
 in the same file or one of the succeeding files.
 This can speed up entry into programs that call
 field occurs in the requested entry, the entry it names must be found
 in the same file or one of the succeeding files.
 This can speed up entry into programs that call
-.IR tgetent ,
+.Fn tgetent ,
 as well as help debug new terminal descriptions
 as well as help debug new terminal descriptions
-or make one for your terminal if you can't write the file /usr/share/misc/termcap.
-.PP
-.I Tgetnum
+or make one for your terminal if you can't write the file
+.Pa /usr/share/misc/termcap .
+.Pp
+The
+.Fn tgetnum
+function
 gets the numeric value of capability
 gets the numeric value of capability
-.I id,
+.Fa id ,
 returning \-1 if is not given for the terminal.
 returning \-1 if is not given for the terminal.
-.I Tgetflag
+The
+.Fn tgetflag
+function
 returns 1 if the specified capability is present in
 the terminal's entry, 0 if it is not.
 returns 1 if the specified capability is present in
 the terminal's entry, 0 if it is not.
-.I Tgetstr
+The
+.Fn tgetstr
+function
 returns the string value of the capability
 returns the string value of the capability
-.I id,
+.Fa id ,
 places it in the buffer at
 places it in the buffer at
-.I area,
+.Fa area ,
 and advances the
 and advances the
-.I area
+.Fa area
 pointer.
 It decodes the abbreviations for this field described in
 pointer.
 It decodes the abbreviations for this field described in
-.IR termcap (5),
+.Xr termcap 5 ,
 except for cursor addressing and padding information.
 except for cursor addressing and padding information.
-.I Tgetstr
-returns NULL if the capability was not found.
-.PP
-.I Tgoto
+The
+.Fn tgetstr
+function
+returns
+.Dv NULL
+if the capability was not found.
+.Pp
+The
+.Fn tgoto
+function
 returns a cursor addressing string decoded from
 returns a cursor addressing string decoded from
-.I cm
+.Fa cm
 to go to column
 to go to column
-.I destcol
+.Fa destcol
 in line
 in line
-.I destline.
+.Fa destline .
 It uses the external variables
 It uses the external variables
-.B UP
-(from the \fBup\fR capability)
+.Va UP
+(from the
+.Sy up
+capability)
 and
 and
-.B BC
-(if \fBbc\fR is given rather than \fBbs\fR)
-if necessary to avoid placing \fB\en\fR, \fB^D\fR or \fB^@\fR in
+.Va BC
+(if
+.Sy bc
+is given rather than
+.Sy bs )
+if necessary to avoid placing
+.Sy \en ,
+.Sy ^D
+or
+.Sy ^@
+in
 the returned string.
 the returned string.
-(Programs which call tgoto should be sure to turn off the XTABS bit(s),
+(Programs which call
+.Fn tgoto
+should be sure to turn off the
+.Dv XTABS
+bit(s),
 since
 since
-.I tgoto
+.Fn tgoto
 may now output a tab.
 may now output a tab.
-Note that programs using termcap should in general turn off XTABS
+Note that programs using termcap should in general turn off
+.Dv XTABS
 anyway since some terminals use control-I for other functions,
 such as nondestructive space.)
 anyway since some terminals use control-I for other functions,
 such as nondestructive space.)
-If a \fB%\fR sequence is given which is not understood, then
-.I tgoto
-returns \*(lqOOPS\*(rq.
-.PP
-.I Tputs
+If a
+.Sy %
+sequence is given which is not understood, then
+.Fn tgoto
+returns
+.Pq Dv OOPS .
+.Pp
+The
+.Fn tputs
+function
 decodes the leading padding information of the string
 decodes the leading padding information of the string
-.IR cp ;
-.I affcnt
+.Fa cp ;
+.Fa affcnt
 gives the number of lines affected by the operation, or 1 if this is
 not applicable,
 gives the number of lines affected by the operation, or 1 if this is
 not applicable,
-.I outc
+.Fa outc
 is a routine which is called with each character in turn.
 The external variable
 is a routine which is called with each character in turn.
 The external variable
-.I ospeed
+.Va ospeed
 should contain the output speed of the terminal as encoded by
 should contain the output speed of the terminal as encoded by
-.IR stty (3).
+.Xr stty 3 .
 The external variable
 The external variable
-.B PC
-should contain a pad character to be used (from the \fBpc\fR capability)
-if a null (\fB^@\fR) is inappropriate.
-.SH FILES
-.ta \w'/usr/lib/libtermcap.a  'u
-/usr/lib/libtermcap.a  \-ltermcap library (also known as \-ltermlib)
-.br
-/usr/share/misc/termcap        standard terminal capability data base
-.br
-$HOME/.termcap user's terminal capability data base
-.DT
-.SH SEE ALSO
-ex(1), curses(3), termcap(5)
+.Va PC
+should contain a pad character to be used (from the
+.SY pc
+capability)
+if a null
+.Pq Sy ^@
+is inappropriate.
+.Sh FILES
+.Bl -tag -width /usr/share/misc/termcap -compact
+.It Pa /usr/lib/libtermcap.a
+.Fl l Ar ltermcap
+library (also known as
+.Fl l Ar ltermlib )
+.It Pa /usr/share/misc/termcap
+standard terminal capability data base
+.It Pa $HOME/.termcap
+user's terminal capability data base
+.El
+.Sh SEE ALSO
+.Xr ex 1 ,
+.Xr curses 3 ,
+.Xr termcap 5
+.Sh HISTORY
+The
+.Nm
+functions appeared in 
+.Bx 4.0 .
index f317fcc..21a18a5 100644 (file)
@@ -1,40 +1,60 @@
-.\"    @(#)assert.3    6.2 (Berkeley) %G%
+.\" Copyright (c) 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH ASSERT 3 ""
-.AT 3
-.SH NAME
-assert \- program verification
-.SH SYNOPSIS
-.B #include <assert.h>
-.PP
-.B assert(expression)
-.SH DESCRIPTION
-.PP
-.I Assert
-is a macro that indicates
-.I expression
-is expected to be true at this point in the program.
-It causes an
-.IR exit (2)
-with a diagnostic comment on the standard output when
-.I expression
-is false (0).
-Compiling with the 
-.IR cc (1)
-option
-.SM
-.B \-DNDEBUG
-effectively deletes
-.I assert
-from the program.
-.SH DIAGNOSTICS
-`Assertion failed: file
-.I f
-line
-.I n.'
-.I F
-is the source file and
-.I n
-the source line number of the
-.I assert
-statement.
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)assert.3   6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt ASSERT 3
+.Os
+.Sh NAME
+.Nm assert
+.Nd expression verification macro
+.Sh SYNOPSIS
+.Fd #include <assert.h>
+.Fn assert expression
+.Sh DESCRIPTION
+The
+.Fn assert
+macro tests the given
+.Ar expression
+and if it is false,
+the calling process is terminated.
+A
+diagnostic message is written to the
+.Em stderr
+and the function
+.Xr _exit 2
+is called effectively terminating the program.
+.Pp
+If
+.Ar expression
+is true,
+the
+.Fn assert
+macro does nothing.
+.Pp
+The
+.Fn assert
+macro
+may be removed at compile time with
+the
+.Fl NDEBUG
+option, see
+.Xr cc 1 .
+.Sh DIAGNOSTICS
+The following diagnostic message is written to
+.Em stderr
+if
+.Ar expression
+is false:
+.Bd -literal -offset indent
+"assertion \e"%s\e" failed: file \e"%s\e", line %d\n", \e
+                   "expression", __FILE__, __LINE__);
+.Ed
+.Sh HISTORY
+The
+.Fn assert
+function is
+.Ud .
index c116b73..256643a 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Paul Vixie.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Paul Vixie.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bitstring.3 5.3 (Berkeley) %G%
+.\"     @(#)bitstring.3        5.4 (Berkeley) %G%
 .\"
 .\"
-.TH BITSTRING 3  ""
-.UC 4
-.SH NAME
-bit_alloc, bit_clear, bit_decl, bit_ffs, bit_nclear, bit_nset,
-bit_set, bitstr_size, bit_test \- bit-string manipulation macros
-.SH SYNOPSIS
-.ft B
-.nf
-#include <bitstring.h>
-
-name = bit_alloc(nbits)
-bitstr_t *name;
-int nbits;
-
-bit_decl(name, nbits)
-bitstr_t name;
-int nbits;
-
-bit_clear(name, bit)
-bitstr_t name;
-int bit;
-
-bit_ffc(name, nbits, value)
-bitstr_t name;
-int nbits, *value;
-
-bit_ffs(name, nbits, value)
-bitstr_t name;
-int nbits, *value;
-
-bit_nclear(name, start, stop)
-bitstr_t name;
-int start, stop;
-
-bit_nset(name, start, stop)
-bitstr_t name;
-int start, stop;
-
-bit_set(name, bit)
-bitstr_t name;
-int bit;
-
-bitstr_size(nbits)
-int nbits;
-
-bit_test(name, bit)
-bitstr_t name;
-int bit;
-.fi
-.ft R
-.SH DESCRIPTION
+.Dd 
+.Dt BITSTRING 3
+.Os BSD 4
+.Sh NAME
+.Nm bit_alloc ,
+.Nm bit_clear ,
+.Nm bit_decl ,
+.Nm bit_ffs ,
+.Nm bit_nclear ,
+.Nm bit_nset,
+.Nm bit_set ,
+.Nm bitstr_size ,
+.Nm bit_test
+.Nd bit-string manipulation macros
+.Sh SYNOPSIS
+.Fd #include <bitstring.h>
+.Ft bitstr_t *
+.Fn bit_alloc "int nbits"
+.Fn bit_decl "bit_str name" "int nbits"
+.Fn bit_clear "bit_str name" "int bit"
+.Fn bit_ffc "bit_str name" "int nbits" "int *value"
+.Fn bit_ffs "bit_str name" "int nbits" "int *value"
+.Fn bit_nclear "bit_str name" "int start" "int stop"
+.Fn bit_nset "bit_str name" "int start" "int stop"
+.Fn bit_set "bit_str name" "int bit"
+.Fn bitstr_size "int nbits"
+.Fn bit_test "bit_str name" "int bit"
+.Sh DESCRIPTION
 These macros operate on strings of bits.
 These macros operate on strings of bits.
-.PP
-.I Bit_alloc
+.Pp
+The macro
+.Fn bit_alloc
 returns a pointer of type
 returns a pointer of type
-.I bitstr_t\ *
+.Dq Fa "bitstr_t *"
 to sufficient space to store
 to sufficient space to store
-.I nbits
-bits, or NULL if no space is available.
-.PP
-.I Bit_decl
-is a macro for allocating sufficient space to store
-.I nbits
+.Fa nbits
+bits, or
+.Dv NULL
+if no space is available.
+.Pp
+The macro
+.Fn bit_decl
+allocates sufficient space to store
+.Fa nbits
 bits on the stack.
 bits on the stack.
-.PP
-.I Bitstr_size
+.Pp
+The macro
+.Fn bitstr_size
 returns the number of elements of type
 returns the number of elements of type
-.I bitstr_t
+.Fa bitstr_t
 necessary to store
 necessary to store
-.I nbits
+.Fa nbits
 bits.
 This is useful for copying bit strings.
 bits.
 This is useful for copying bit strings.
-.PP
-.I Bit_clear
+.Pp
+The macros
+.Fn bit_clear
 and
 and
-.I bit_set
+.Fn bit_set
 clear or set the zero-based numbered bit
 clear or set the zero-based numbered bit
-.IR bit ,
+.Fa bit ,
 in the bit string
 in the bit string
-.IR name .
-.PP
-.I Bit_nset
+.Ar name .
+.Pp
+The
+.Fn bit_nset
 and
 and
-.I bit_nclear
+.Fn bit_nclear
+macros
 set or clear the zero-based numbered bits from
 set or clear the zero-based numbered bits from
-.I start
+.Fa start
 to
 to
-.I stop
+.Fa stop
 in the bit string
 in the bit string
-.IR name .
-.PP
-.I Bit_test
+.Ar name .
+.Pp
+The
+.Fn bit_test
+macro
 evaluates to zero if the zero-based numbered bit
 evaluates to zero if the zero-based numbered bit
-.I bit
+.Fa bit
 of bit string
 of bit string
-.I name
+.Fa name
 is set, and non-zero otherwise.
 is set, and non-zero otherwise.
-.PP
-.I Bit_ffs
+.Pp
+The
+.Fn bit_ffs
+macro
 stores in the location referenced by
 stores in the location referenced by
-.I value
+.Fa value
 the zero-based number of the first bit set in the array of
 the zero-based number of the first bit set in the array of
-.I nbits
+.Fa nbits
 bits referenced by
 bits referenced by
-.IR name .
+.Fa name .
 If no bits are set, the location referenced by
 If no bits are set, the location referenced by
-.I value
-is set to -1.
-.PP
-.I Bit_ffc
+.Fa value
+is set to \-1.
+.Pp
+The macro
+.Fn bit_ffc
 stores in the location referenced by
 stores in the location referenced by
-.I value
+.Fa value
 the zero-based number of the first bit not set in the array of
 the zero-based number of the first bit not set in the array of
-.I nbits
+.Fa nbits
 bits referenced by
 bits referenced by
-.IR name .
+.Fa name .
 If all bits are set, the location referenced by
 If all bits are set, the location referenced by
-.I value
-is set to -1.
-.PP
+.Fa value
+is set to \-1.
+.Pp
 The arguments to these macros are evaluated only once and may safely
 have side effects.
 The arguments to these macros are evaluated only once and may safely
 have side effects.
-.SH EXAMPLE
-.nf
-.in +5
+.Sh EXAMPLE
+.Bd -literal -offset indent
 #include <limits.h>
 #include <bitstring.h>
 
 #include <limits.h>
 #include <bitstring.h>
 
@@ -156,6 +144,11 @@ make_lpr_available()
                bit_set(bitlist, LPR_AVAILABLE_BIT);
        }
 }
                bit_set(bitlist, LPR_AVAILABLE_BIT);
        }
 }
-.fi
-.SH "SEE ALSO"
-malloc(3)
+.Ed
+.Sh SEE ALSO
+.Xr malloc 3
+.Sh HISTORY
+The
+.Nm
+functions are
+.Ud .
index 5b6f305..4f2794a 100644 (file)
@@ -1,39 +1,40 @@
-.\"    @(#)end.3       6.2 (Berkeley) %G%
+.\"    @(#)end.3       6.2 (Berkeley) 5/12/86
 .\"
 .\"
-.TH END 3  ""
-.AT 3
-.SH NAME
-end, etext, edata \- last locations in program
-.SH SYNOPSIS
-.nf
-.B extern end;
-.B extern etext;
-.B extern edata;
-.fi
-.SH DESCRIPTION
-These names refer neither to routines nor to locations with interesting
-contents.  The address of
-.I etext
-is the first address above the program text,
-.I edata
-above the initialized data region, and
-.I end
-above the uninitialized data region.
-.PP
-When execution begins, the program break coincides with
-.I end,
-but it is reset by the routines
-.IR brk (2),
-.IR malloc (3), 
-standard input/output
-.RI ( stdio (3S)),
-the profile
-.RB ( \-p )
-option of 
-.IR cc (1),
-etc.
-The current value of the program break is reliably returned by `sbrk(0)',
-see
-.IR brk (2).
-.SH "SEE ALSO"
-brk(2), malloc(3)
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)end.3      6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt END 3
+.Os
+.Sh NAME
+.Nm end ,
+.Nm etext ,
+.Nm edata
+.Nd end boundaries of image segments
+.Sh SYNOPSIS
+.Vt extern end;
+.Vt extern etext;
+.Vt extern edata;
+.Sh DESCRIPTION
+The global variables
+.Va end , extext
+and
+.Va edata
+correspond to the
+the next address following the end
+of the text segment,
+the initialized data segment and the
+end of the data segment
+.Pq Tn BSS .
+These values are initially set at execution time
+by
+.Xr brk 2 .
+.Sh SEE ALSO
+.Xr brk 2 ,
+.Xr malloc 3
+.Sh HISTORY
+A
+.Nm end
+manual appeared in
+.At v6 .
index 89360f6..81575e1 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)stdarg.3    6.4 (Berkeley) %G%
+.\"     @(#)stdarg.3   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH VARARGS 3  ""
-.AT 3
-.SH NAME
-varargs \- variable argument lists
-.SH SYNOPSIS
-.nf
-.ft B
-#include <stdarg.h>
-
-void
-va_start(va_list ap, last);
-
-type
-va_arg(va_list ap, type);
-
-void
-va_end(va_list ap);
-.ft R
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt VARARGS 3
+.Os ATT 7th
+.Sh NAME
+.Nm varargs
+.Nd variable argument lists
+.Sh SYNOPSIS
+.Fd #include <stdarg.h>
+.Ft void
+.Fn va_start "va_list ap" last
+.Ft type
+.Fn va_arg "va_list ap" type
+.Ft void
+.Fn va_end "va_list ap"
+.Sh DESCRIPTION
 A function may be called with a varying number of arguments of varying
 types.
 The include file
 A function may be called with a varying number of arguments of varying
 types.
 The include file
-.I <stdarg.h>
-declares a type (\fIva_list\fP) and defines three macros for stepping
+.Aq Pa stdarg.h
+declares a type
+.Pq Em va_list
+and defines three macros for stepping
 through a list of arguments whose number and types are not known to
 the called function.
 through a list of arguments whose number and types are not known to
 the called function.
-.PP
+.Pp
 The called function must declare an object of type
 The called function must declare an object of type
-.I va_list
+.Em va_list
 which is used by the macros
 which is used by the macros
-.IR va_start ,
-.IR va_arg ,
+.Fn va_start ,
+.Fn va_arg ,
 and
 and
-.IR va_end .
-.PP
+.Fn va_end .
+.Pp
 The
 The
-.I va_start
+.Fn va_start
 macro initializes
 macro initializes
-.I ap
+.Fa ap
 for subsequent use by
 for subsequent use by
-.I va_arg
+.Fn va_arg
 and
 and
-.IR va_end ,
+.Fn va_end ,
 and must be called first.
 and must be called first.
-.PP
+.Pp
 The parameter
 The parameter
-.I last
+.Fa last
 is the name of the last parameter before the variable argument list,
 i.e. the last parameter of which the calling function knows the type.
 is the name of the last parameter before the variable argument list,
 i.e. the last parameter of which the calling function knows the type.
-.PP
+.Pp
 Because the address of this parameter is used in the
 Because the address of this parameter is used in the
-.I va_start
+.Fn va_start
 macro, it should not be declared as a register variable, or as a
 macro, it should not be declared as a register variable, or as a
-function or array type.
-.PP
+function or an array type.
+.Pp
 The
 The
-.I va_start
+.Fn va_start
 macro returns no value.
 macro returns no value.
-.PP
+.Pp
 The
 The
-.I va_arg
+.Fn va_arg
 macro expands to an expression that has the type and value of the next
 argument in the call.
 The parameter
 macro expands to an expression that has the type and value of the next
 argument in the call.
 The parameter
-.I ap
+.Fa ap
 is the 
 is the 
-.I va_list ap
+.Em va_list Fa ap
 initialized by
 initialized by
-.IR va_start .
+.Fn va_start .
 Each call to 
 Each call to 
-.I va_arg 
+.Fn va_arg
 modifies
 modifies
-.I ap
+.Fa ap
 so that the next call returns the next argument.
 The parameter
 so that the next call returns the next argument.
 The parameter
-.I type
+.Fa type
 is a type name specified so that the type of a pointer to an
 object that has the specified type can be obtained simply by 
 is a type name specified so that the type of a pointer to an
 object that has the specified type can be obtained simply by 
-adding a 
-.I *
+adding a *
 to
 to
-.IR type .
-.PP
+.Fa type .
+.Pp
 If there is no next argument, or if
 If there is no next argument, or if
-.I type
+.Fa type
 is not compatible with the type of the actual next argument
 (as promoted according to the default argument promotions),
 random errors will occur.
 is not compatible with the type of the actual next argument
 (as promoted according to the default argument promotions),
 random errors will occur.
-.PP
+.Pp
 The first use of the
 The first use of the
-.I va_arg
+.Fn va_arg
 macro after that of the 
 macro after that of the 
-.I va_start 
+.Fn va_start
 macro returns the argument after 
 macro returns the argument after 
-.IR last .
+.Fa last .
 Successive invocations return the values of the remaining
 arguments.
 Successive invocations return the values of the remaining
 arguments.
-.PP
+.Pp
 The
 The
-.I va_end
+.Fn va_end
 macro handles a normal return from the function whose variable argument
 list was initialized by 
 macro handles a normal return from the function whose variable argument
 list was initialized by 
-.IR va_start .
-.PP
+.Fn va_start .
+.Pp
 The
 The
-.I va_end
+.Fn va_end
 macro returns no value.
 macro returns no value.
-.SH STANDARDS
-The
-.IR va_start ,
-.IR va_arg ,
-and
-.I va_end
-macros are ANSI C compatible.
-.SH COMPATIBILITY
-These macros are
-.B not
-compatible with the historic macros they replace.
-A backward compatible version can be found in the include
-file 
-.IR <varargs.h> .
-.SH EXAMPLES
+.Sh EXAMPLES
 The function
 The function
-.I foo
+.Em foo
 takes a string of format characters and prints out the argument
 associated with each format character based on the type.
 takes a string of format characters and prints out the argument
 associated with each format character based on the type.
-.sp
-.nf
-.RS
-foo(fmt)
-       char *fmt;
+.Bd -literal -offset indent
+foo(char *fmt)
 {
        va_list ap;
        int d;
 {
        va_list ap;
        int d;
@@ -160,4 +139,19 @@ foo(fmt)
                }
        va_end(ap);
 }
                }
        va_end(ap);
 }
-.fi
+.Ed
+.Sh STANDARDS
+The
+.Fn va_start ,
+.Fn va_arg ,
+and
+.Fn va_end
+macros conform to
+.St -ansiC .
+.Sh COMPATIBILITY
+These macros are
+.Em not
+compatible with the historic macros they replace.
+A backward compatible version can be found in the include
+file 
+.Aq Pa varargs.h .