BSD 4_1c_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sat, 26 Feb 1983 10:23:44 +0000 (02:23 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sat, 26 Feb 1983 10:23:44 +0000 (02:23 -0800)
Work on file usr/man/man3/abort.3
Work on file usr/man/man3/abs.3
Work on file usr/man/man3/atof.3
Work on file usr/man/man3/crypt.3
Work on file usr/man/man3/assert.3x
Work on file usr/man/man3/ctime.3
Work on file usr/man/man3/ctype.3
Work on file usr/man/man3/termcap.3x
Work on file usr/man/man3/dbm.3x
Work on file usr/man/man3/ferror.3s
Work on file usr/man/man3/ecvt.3
Work on file usr/man/man3/exp.3m
Work on file usr/man/man3/end.3
Work on file usr/man/man3/fclose.3s
Work on file usr/man/man3/frexp.3
Work on file usr/man/man3/fread.3s
Work on file usr/man/man3/floor.3m
Work on file usr/man/man3/fopen.3s
Work on file usr/man/man3/getarg.3f
Work on file usr/man/man3/fseek.3s
Work on file usr/man/man3/gamma.3m
Work on file usr/man/man3/getc.3s
Work on file usr/man/man3/getfsent.3
Work on file usr/man/man3/getenv.3
Work on file usr/man/man3/getlogin.3
Work on file usr/man/man3/getpw.3
Work on file usr/man/man3/getgrent.3
Work on file usr/man/man3/getpwent.3
Work on file usr/man/man3/hypot.3m
Work on file usr/man/man3/gets.3s
Work on file usr/man/man3/getpass.3
Work on file usr/man/man3/malloc.3
Work on file usr/man/man3/j0.3m
Work on file usr/man/man3/mktemp.3
Work on file usr/man/man3/plot.3x
Work on file usr/man/man3/monitor.3
Work on file usr/man/man3/perror.3
Work on file usr/man/man3/nlist.3
Work on file usr/man/man3/putc.3s
Work on file usr/man/man3/printf.3s
Work on file usr/man/man3/popen.3s
Work on file usr/man/man3/puts.3s
Work on file usr/man/man3/qsort.3
Work on file usr/man/man3/rand.3
Work on file usr/man/man3/scanf.3s
Work on file usr/man/man3/setjmp.3
Work on file usr/man/man3/intro.3m
Work on file usr/man/man3/sin.3m
Work on file usr/man/man3/string.3
Work on file usr/man/man3/sinh.3m
Work on file usr/man/man3/swab.3
Work on file usr/man/man3/sleep.3
Work on file usr/man/man3/system.3
Work on file usr/man/man3/getwd.3
Work on file usr/man/man3/inet.3n
Work on file usr/man/man3/ungetc.3s
Work on file usr/man/man3/ttyname.3
Work on file usr/man/man3/valloc.3
Work on file usr/man/man3/varargs.3
Work on file usr/man/man3/gethostent.3n
Work on file usr/man/man3/random.3
Work on file usr/man/man3/abort.3f
Work on file usr/man/man3/bessel.3f
Work on file usr/man/man3/exit.3f
Work on file usr/man/man3/rand.3f
Work on file usr/man/man3/traper.3f
Work on file usr/man/man3/range.3f
Work on file usr/man/man3/fork.3f
Work on file usr/man/man3/index.3f
Work on file usr/man/man3/chdir.3f
Work on file usr/man/man3/access.3f
Work on file usr/man/man3/alarm.3f
Work on file usr/man/man3/trapov.3f
Work on file usr/man/man3/fdate.3f
Work on file usr/man/man3/etime.3f
Work on file usr/man/man3/fseek.3f
Work on file usr/man/man3/flush.3f
Work on file usr/man/man3/getenv.3f
Work on file usr/man/man3/getlog.3f
Work on file usr/man/man3/getc.3f
Work on file usr/man/man3/getuid.3f
Work on file usr/man/man3/getpid.3f
Work on file usr/man/man3/kill.3f
Work on file usr/man/man3/idate.3f
Work on file usr/man/man3/link.3f
Work on file usr/man/man3/putc.3f
Work on file usr/man/man3/perror.3f
Work on file usr/man/man3/loc.3f
Work on file usr/man/man3/qsort.3f
Work on file usr/man/man3/signal.3f
Work on file usr/man/man3/sleep.3f
Work on file usr/man/man3/system.3f
Work on file usr/man/man3/time.3f
Work on file usr/man/man3/ttynam.3f
Work on file usr/man/man3/stat.3f
Work on file usr/man/man3/scandir.3
Work on file usr/man/man3/unlink.3f
Work on file usr/man/man3/wait.3f
Work on file usr/man/man3/intro.3s
Work on file usr/man/man3/intro.3f
Work on file usr/man/man3/curses.3x
Work on file usr/man/man3/directory.3
Work on file usr/man/man3/getprotoent.3n
Work on file usr/man/man3/getnetent.3n
Work on file usr/man/man3/getservent.3n
Work on file usr/man/man3/psignal.3
Work on file usr/man/man3/initgroups.3
Work on file usr/man/man3/sigset.3j
Work on file usr/man/man3/intro.3j

Synthesized-from: CSRG/cd1/4.1c.2

109 files changed:
usr/man/man3/abort.3 [new file with mode: 0644]
usr/man/man3/abort.3f [new file with mode: 0644]
usr/man/man3/abs.3 [new file with mode: 0644]
usr/man/man3/access.3f [new file with mode: 0644]
usr/man/man3/alarm.3f [new file with mode: 0644]
usr/man/man3/assert.3x [new file with mode: 0644]
usr/man/man3/atof.3 [new file with mode: 0644]
usr/man/man3/bessel.3f [new file with mode: 0644]
usr/man/man3/chdir.3f [new file with mode: 0644]
usr/man/man3/crypt.3 [new file with mode: 0644]
usr/man/man3/ctime.3 [new file with mode: 0644]
usr/man/man3/ctype.3 [new file with mode: 0644]
usr/man/man3/curses.3x [new file with mode: 0644]
usr/man/man3/dbm.3x [new file with mode: 0644]
usr/man/man3/directory.3 [new file with mode: 0644]
usr/man/man3/ecvt.3 [new file with mode: 0644]
usr/man/man3/end.3 [new file with mode: 0644]
usr/man/man3/etime.3f [new file with mode: 0644]
usr/man/man3/exit.3f [new file with mode: 0644]
usr/man/man3/exp.3m [new file with mode: 0644]
usr/man/man3/fclose.3s [new file with mode: 0644]
usr/man/man3/fdate.3f [new file with mode: 0644]
usr/man/man3/ferror.3s [new file with mode: 0644]
usr/man/man3/floor.3m [new file with mode: 0644]
usr/man/man3/flush.3f [new file with mode: 0644]
usr/man/man3/fopen.3s [new file with mode: 0644]
usr/man/man3/fork.3f [new file with mode: 0644]
usr/man/man3/fread.3s [new file with mode: 0644]
usr/man/man3/frexp.3 [new file with mode: 0644]
usr/man/man3/fseek.3f [new file with mode: 0644]
usr/man/man3/fseek.3s [new file with mode: 0644]
usr/man/man3/gamma.3m [new file with mode: 0644]
usr/man/man3/getarg.3f [new file with mode: 0644]
usr/man/man3/getc.3f [new file with mode: 0644]
usr/man/man3/getc.3s [new file with mode: 0644]
usr/man/man3/getenv.3 [new file with mode: 0644]
usr/man/man3/getenv.3f [new file with mode: 0644]
usr/man/man3/getfsent.3 [new file with mode: 0644]
usr/man/man3/getgrent.3 [new file with mode: 0644]
usr/man/man3/gethostent.3n [new file with mode: 0644]
usr/man/man3/getlog.3f [new file with mode: 0644]
usr/man/man3/getlogin.3 [new file with mode: 0644]
usr/man/man3/getnetent.3n [new file with mode: 0644]
usr/man/man3/getpass.3 [new file with mode: 0644]
usr/man/man3/getpid.3f [new file with mode: 0644]
usr/man/man3/getprotoent.3n [new file with mode: 0644]
usr/man/man3/getpw.3 [new file with mode: 0644]
usr/man/man3/getpwent.3 [new file with mode: 0644]
usr/man/man3/gets.3s [new file with mode: 0644]
usr/man/man3/getservent.3n [new file with mode: 0644]
usr/man/man3/getuid.3f [new file with mode: 0644]
usr/man/man3/getwd.3 [new file with mode: 0644]
usr/man/man3/hypot.3m [new file with mode: 0644]
usr/man/man3/idate.3f [new file with mode: 0644]
usr/man/man3/index.3f [new file with mode: 0644]
usr/man/man3/inet.3n [new file with mode: 0644]
usr/man/man3/initgroups.3 [new file with mode: 0644]
usr/man/man3/intro.3f [new file with mode: 0644]
usr/man/man3/intro.3j [new file with mode: 0644]
usr/man/man3/intro.3m [new file with mode: 0644]
usr/man/man3/intro.3s [new file with mode: 0644]
usr/man/man3/j0.3m [new file with mode: 0644]
usr/man/man3/kill.3f [new file with mode: 0644]
usr/man/man3/link.3f [new file with mode: 0644]
usr/man/man3/loc.3f [new file with mode: 0644]
usr/man/man3/malloc.3 [new file with mode: 0644]
usr/man/man3/mktemp.3 [new file with mode: 0644]
usr/man/man3/monitor.3 [new file with mode: 0644]
usr/man/man3/nlist.3 [new file with mode: 0644]
usr/man/man3/perror.3 [new file with mode: 0644]
usr/man/man3/perror.3f [new file with mode: 0644]
usr/man/man3/plot.3x [new file with mode: 0644]
usr/man/man3/popen.3s [new file with mode: 0644]
usr/man/man3/printf.3s [new file with mode: 0644]
usr/man/man3/psignal.3 [new file with mode: 0644]
usr/man/man3/putc.3f [new file with mode: 0644]
usr/man/man3/putc.3s [new file with mode: 0644]
usr/man/man3/puts.3s [new file with mode: 0644]
usr/man/man3/qsort.3 [new file with mode: 0644]
usr/man/man3/qsort.3f [new file with mode: 0644]
usr/man/man3/rand.3 [new file with mode: 0644]
usr/man/man3/rand.3f [new file with mode: 0644]
usr/man/man3/random.3 [new file with mode: 0644]
usr/man/man3/range.3f [new file with mode: 0644]
usr/man/man3/scandir.3 [new file with mode: 0644]
usr/man/man3/scanf.3s [new file with mode: 0644]
usr/man/man3/setjmp.3 [new file with mode: 0644]
usr/man/man3/signal.3f [new file with mode: 0644]
usr/man/man3/sigset.3j [new file with mode: 0644]
usr/man/man3/sin.3m [new file with mode: 0644]
usr/man/man3/sinh.3m [new file with mode: 0644]
usr/man/man3/sleep.3 [new file with mode: 0644]
usr/man/man3/sleep.3f [new file with mode: 0644]
usr/man/man3/stat.3f [new file with mode: 0644]
usr/man/man3/string.3 [new file with mode: 0644]
usr/man/man3/swab.3 [new file with mode: 0644]
usr/man/man3/system.3 [new file with mode: 0644]
usr/man/man3/system.3f [new file with mode: 0644]
usr/man/man3/termcap.3x [new file with mode: 0644]
usr/man/man3/time.3f [new file with mode: 0644]
usr/man/man3/traper.3f [new file with mode: 0644]
usr/man/man3/trapov.3f [new file with mode: 0644]
usr/man/man3/ttynam.3f [new file with mode: 0644]
usr/man/man3/ttyname.3 [new file with mode: 0644]
usr/man/man3/ungetc.3s [new file with mode: 0644]
usr/man/man3/unlink.3f [new file with mode: 0644]
usr/man/man3/valloc.3 [new file with mode: 0644]
usr/man/man3/varargs.3 [new file with mode: 0644]
usr/man/man3/wait.3f [new file with mode: 0644]

diff --git a/usr/man/man3/abort.3 b/usr/man/man3/abort.3
new file mode 100644 (file)
index 0000000..66b8c40
--- /dev/null
@@ -0,0 +1,15 @@
+.TH ABORT 3 "18 January 1983"
+.SH NAME
+abort \- generate a fault
+.SH DESCRIPTION
+.I Abort
+executes an instruction which is illegal in user mode.
+This causes a signal that normally terminates
+the process with a core dump, which may be used for debugging.
+.SH SEE ALSO
+adb(1), signal(2), exit(2)
+.SH DIAGNOSTICS
+Usually `IOT trap \- core dumped' from the shell.
+.SH BUGS
+The abort() function does not flush standard I/O buffers.  Use
+\fIfflush\fP\|(3).
diff --git a/usr/man/man3/abort.3f b/usr/man/man3/abort.3f
new file mode 100644 (file)
index 0000000..88c7546
--- /dev/null
@@ -0,0 +1,23 @@
+.TH ABORT 3F "19 January 1983"
+.SH NAME
+abort \- terminate abruptly with memory image
+.SH SYNOPSIS
+.B subroutine abort (string)
+.br
+.B character*(*) string
+.SH DESCRIPTION
+.I Abort
+cleans up the I/O buffers and then aborts producing a
+.I core
+file in the current directory.
+If
+.I string
+is given, it is written to logical unit 0 preceeded by ``abort:''.
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
+.SH "SEE ALSO"
+abort(3)
+.  \".SH BUGS
+.  \".I String
+.  \"is ignored on the PDP11.
diff --git a/usr/man/man3/abs.3 b/usr/man/man3/abs.3
new file mode 100644 (file)
index 0000000..c78dc9c
--- /dev/null
@@ -0,0 +1,20 @@
+.TH ABS 3 "18 January 1983"
+.SH NAME
+abs \- integer absolute value
+.SH SYNOPSIS
+.nf
+.B abs(i)
+.B int i;
+.fi
+.SH DESCRIPTION
+.I Abs
+returns the absolute value of its integer operand.
+.SH SEE ALSO
+floor(3M) for
+.I fabs
+.SH BUGS
+Applying the \fIabs\fP function to the most negative integer generates a
+result which is the most negative integer.  That is, 
+.IP "abs(0x80000000)"
+.LP
+returns 0x80000000 as a result.
diff --git a/usr/man/man3/access.3f b/usr/man/man3/access.3f
new file mode 100644 (file)
index 0000000..79189f6
--- /dev/null
@@ -0,0 +1,115 @@
+.ds f. access.3f.raw
+.TH ACCESS 3F "19 January 1983"
+.SH NAME
+access \- determine accessability of a file
+.SH SYNOPSIS
+.B integer function access (name, mode)
+.br
+.B character*(*) name, mode
+.SH DESCRIPTION
+.I Access
+checks the given file,
+.I name,
+for accessability with respect to the caller according to
+.I mode.
+.I Mode
+may include in any order and in any combination one or more of:
+.sp 1
+.TS
+.if \n+(b.=1 .nr d. \n(.c-\n(c.-1
+.de 35
+.ps \n(.s
+.vs \n(.vu
+.in \n(.iu
+.if \n(.u .fi
+.if \n(.j .ad
+.if \n(.j=0 .na
+..
+.nf
+.nr #~ 0
+.if n .nr #~ 0.6n
+.ds #d .d
+.if \(ts\n(.z\(ts\(ts .ds #d nl
+.fc
+.nr 33 \n(.s
+.rm 80 81
+.nr 80 0
+.nr 38 \w\ 2\fBr\fR\ 2
+.if \n(80<\n(38 .nr 80 \n(38
+.nr 38 \w\ 2\fBw\fR\ 2
+.if \n(80<\n(38 .nr 80 \n(38
+.nr 38 \w\ 2\fBx\fR\ 2
+.if \n(80<\n(38 .nr 80 \n(38
+.nr 38 \w\ 2(blank)\ 2
+.if \n(80<\n(38 .nr 80 \n(38
+.80
+.rm 80
+.nr 81 0
+.nr 38 \w\ 2test for read permission\ 2
+.if \n(81<\n(38 .nr 81 \n(38
+.nr 38 \w\ 2test for write permission\ 2
+.if \n(81<\n(38 .nr 81 \n(38
+.nr 38 \w\ 2test for execute permission\ 2
+.if \n(81<\n(38 .nr 81 \n(38
+.nr 38 \w\ 2test for existence\ 2
+.if \n(81<\n(38 .nr 81 \n(38
+.81
+.rm 81
+.nr 38 1n
+.nr 79 0
+.nr 40 \n(79+(0*\n(38)
+.nr 80 +\n(40
+.nr 41 \n(80+(3*\n(38)
+.nr 81 +\n(41
+.nr TW \n(81
+.if t .if (\n(TW+\n(.o)>7.65i .tm Table at line 24 file access.3f.raw is too wide - \n(TW units
+.nr #I \n(.i
+.in +(\n(.lu-\n(TWu-\n(.iu)/2u
+.fc \ 2 \ 3
+.nr #T 0-1
+.nr #a 0-1
+.eo
+.de T#
+.ds #d .d
+.if \(ts\n(.z\(ts\(ts .ds #d nl
+.mk ##
+.nr ## -1v
+.ls 1
+.ls
+..
+.ec
+.ta \n(80u \n(81u 
+.nr 31 \n(.f
+.nr 35 1m
+\&\h'|\n(40u'\ 2\ 3\fBr\fR\ 3\ 2\h'|\n(41u'\ 2test for read permission\ 3\ 2
+.ta \n(80u \n(81u 
+.nr 31 \n(.f
+.nr 35 1m
+\&\h'|\n(40u'\ 2\ 3\fBw\fR\ 3\ 2\h'|\n(41u'\ 2test for write permission\ 3\ 2
+.ta \n(80u \n(81u 
+.nr 31 \n(.f
+.nr 35 1m
+\&\h'|\n(40u'\ 2\ 3\fBx\fR\ 3\ 2\h'|\n(41u'\ 2test for execute permission\ 3\ 2
+.ta \n(80u \n(81u 
+.nr 31 \n(.f
+.nr 35 1m
+\&\h'|\n(40u'\ 2\ 3(blank)\ 3\ 2\h'|\n(41u'\ 2test for existence\ 3\ 2
+.fc
+.nr T. 1
+.T# 1
+.in \n(#Iu
+.35
+.TE
+.if \n-(b.=0 .nr c. \n(.c-\n(d.-7
+.sp 1
+.PP
+An error code is returned if either argument is illegal, or if the file
+can not be accessed in all of the specified modes.
+0 is returned if the specified access would be successful.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+access(2), perror(3F)
+.SH BUGS
+Pathnames can be no longer than 127 characters.
diff --git a/usr/man/man3/alarm.3f b/usr/man/man3/alarm.3f
new file mode 100644 (file)
index 0000000..10c95bc
--- /dev/null
@@ -0,0 +1,39 @@
+.TH ALARM 3F "19 January 1983"
+.SH NAME
+alarm \- execute a subroutine after a specified time
+.SH SYNOPSIS
+.B integer function alarm (time, proc)
+.br
+.B integer time
+.br
+.B external proc
+.SH DESCRIPTION
+This routine arranges for subroutine
+.I proc
+to be called after
+.I time
+seconds. If
+.I time
+is ``0'', the alarm is turned off and no routine will be called.
+The returned value will be the time remaining on the last alarm.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+alarm(2), sleep(3f), signal(3f)
+.SH BUGS
+.I Alarm
+and
+.I sleep
+interact. If
+.I sleep
+is called after
+.IR alarm ,
+the
+.I alarm
+process will never be called. SIGALRM will occur at the lesser of the
+remaining
+.I alarm
+time or the
+.I sleep
+time.
diff --git a/usr/man/man3/assert.3x b/usr/man/man3/assert.3x
new file mode 100644 (file)
index 0000000..b2c7e22
--- /dev/null
@@ -0,0 +1,37 @@
+.TH ASSERT 3X "19 January 1983"
+.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.
diff --git a/usr/man/man3/atof.3 b/usr/man/man3/atof.3
new file mode 100644 (file)
index 0000000..35c03ff
--- /dev/null
@@ -0,0 +1,35 @@
+.TH ATOF 3  "19 January 1983"
+.SH NAME
+atof, atoi, atol \- convert ASCII to numbers
+.SH SYNOPSIS
+.nf
+.B double atof(nptr)
+.B char *nptr;
+.PP
+.B atoi(nptr)
+.B char *nptr;
+.PP
+.B long atol(nptr)
+.B char *nptr;
+.fi
+.SH DESCRIPTION
+These functions convert a string pointed to by
+.I nptr
+to floating, integer, and long integer representation respectively.
+The first unrecognized character ends the string.
+.PP
+.I Atof
+recognizes an optional string of spaces, then an optional sign, then
+a string of digits optionally containing a decimal
+point, then an optional `e' or `E' followed by an optionally signed integer.
+.PP
+.I Atoi
+and
+.I atol
+recognize an optional string of spaces, then an optional sign, then a
+string of
+digits.
+.SH SEE ALSO
+scanf(3S)
+.SH BUGS
+There are no provisions for overflow.
diff --git a/usr/man/man3/bessel.3f b/usr/man/man3/bessel.3f
new file mode 100644 (file)
index 0000000..60e708f
--- /dev/null
@@ -0,0 +1,50 @@
+.TH BESSEL 3F "19 January 1983"
+.SH NAME
+bessel functions \- of two kinds for integer orders
+.SH SYNOPSIS
+.B function besj0 (x)
+.sp 1
+.B function besj1 (x)
+.sp 1
+.B function besjn (n, x)
+.sp 1
+.B function besy0 (x)
+.sp 1
+.B function besy1 (x)
+.sp 1
+.B function besyn (n, x)
+.sp 1
+.B double precision function dbesj0 (x)
+.br
+.B double precision x
+.sp 1
+.B double precision function dbesj1 (x)
+.br
+.B double precision x
+.sp 1
+.B double precision function dbesjn (n, x)
+.br
+.B double precision x
+.sp 1
+.B double precision function dbesy0 (x)
+.br
+.B double precision x
+.sp 1
+.B double precision function dbesy1 (x)
+.br
+.B double precision x
+.sp 1
+.B double precision function dbesyn (n, x)
+.br
+.B double precision x
+.SH DESCRIPTION
+These functions calculate Bessel functions of the first and second kinds
+for real arguments and integer orders.
+.SH DIAGNOSTICS
+Negative arguments cause \fIbesy0, besy1,\fR and \fIbesyn\fR to return a huge
+negative value. The system error code will be set to EDOM (33).
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
+.SH "SEE ALSO"
+j0(3m), perror(3F)
diff --git a/usr/man/man3/chdir.3f b/usr/man/man3/chdir.3f
new file mode 100644 (file)
index 0000000..b38c2de
--- /dev/null
@@ -0,0 +1,19 @@
+.TH CHDIR 3F "19 January 1983"
+.SH NAME
+chdir \- change default directory
+.SH SYNOPSIS
+.B integer function chdir (dirname)
+.br
+.B character*(*) dirname
+.SH DESCRIPTION
+The default directory for creating and locating files will be
+changed to
+.I dirname.
+Zero is returned if successful; an error code otherwise.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+chdir(2), cd(1), perror(3F)
+.SH BUGS
+Pathnames can be no longer than 127 characters.
diff --git a/usr/man/man3/crypt.3 b/usr/man/man3/crypt.3
new file mode 100644 (file)
index 0000000..7790ab5
--- /dev/null
@@ -0,0 +1,65 @@
+.TH CRYPT 3  "25 February 1983"
+.SH NAME
+crypt, setkey, encrypt \- DES encryption
+.SH SYNOPSIS
+.nf
+.B char *crypt(key, salt)
+.B char *key, *salt;
+.PP
+.B setkey(key)
+.B char *key;
+.PP
+.B encrypt(block, edflag)
+.B char *block;
+.fi
+.SH DESCRIPTION
+.I Crypt
+is the password encryption routine.
+It is based on the NBS Data Encryption Standard, with
+variations intended (among other things) to frustrate use of hardware
+implementations of the DES for key search.
+.PP
+The first argument to
+.I crypt
+is normally a user's typed password.
+The second is a 2-character string chosen from the
+set [a-zA-Z0-9./].
+The
+.I salt
+string is used to perturb the DES algorithm in one of 4096
+different ways, after which the password
+is used as the key to encrypt repeatedly a constant string.
+The returned value points to the encrypted password,
+in the same alphabet as the salt.
+The first two characters are the salt itself.
+.PP
+The other entries provide (rather primitive)
+access to the actual DES algorithm.
+The argument of
+.I setkey
+is a character array of length 64 containing only the characters
+with numerical value 0 and 1.
+If this string is divided into groups of 8,
+the low-order bit in each group is ignored,
+leading to a 56-bit key which is set into the machine.
+.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
+.I setkey.
+If
+.I edflag
+is 0, the argument is encrypted;
+if non-zero,
+it is decrypted.
+.SH "SEE ALSO"
+passwd(1), passwd(5), login(1), getpass(3)
+.SH BUGS
+The return value
+points to static data whose content is overwritten
+by each call.
diff --git a/usr/man/man3/ctime.3 b/usr/man/man3/ctime.3
new file mode 100644 (file)
index 0000000..b64ec9c
--- /dev/null
@@ -0,0 +1,89 @@
+.TH CTIME 3  "19 January 1983"
+.SH NAME
+ctime, localtime, gmtime, asctime, timezone \-  convert date and time to ASCII
+.SH SYNOPSIS
+.nf
+.B char *ctime(clock)
+.B long *clock;
+.PP
+.B #include <time.h>
+.PP
+.B struct tm *localtime(clock)
+.B long *clock;
+.PP
+.B struct tm *gmtime(clock)
+.B long *clock;
+.PP
+.B char *asctime(tm)
+.B struct tm *tm;
+.PP
+.B char *timezone(zone, dst)
+.fi
+.SH DESCRIPTION
+.I Ctime
+converts a time pointed to by
+.I clock
+such as returned by
+.IR time (2)
+into ASCII
+and returns a pointer to a
+26-character string
+in the following form.
+All the fields have constant width.
+.PP
+    Sun Sep 16 01:03:52 1973\\n\\0
+.PP
+.I Localtime
+and
+.I gmtime
+return pointers to structures containing
+the broken-down time.
+.I Localtime
+corrects for the time zone and possible daylight savings time;
+.I gmtime
+converts directly to GMT, which is the time UNIX uses.
+.I Asctime
+converts a broken-down time to ASCII and returns a pointer
+to a 26-character string.
+.PP
+The structure declaration from the include file is:
+.RS
+.PP
+.nf
+.so /usr/include/time.h
+.fi
+.RE
+.PP
+These quantities give the time on a 24-hour clock,
+day of month (1-31), month of year (0-11), day of week
+(Sunday = 0), year \- 1900, day of year (0-365),
+and a flag that is nonzero if daylight saving time is in effect.
+.PP
+When local time is called for,
+the program consults the system to determine the time zone and
+whether the standard U.S.A. daylight saving time adjustment is
+appropriate.
+The program knows about the peculiarities
+of this conversion in 1974 and 1975;
+if necessary,
+a table for these years can be extended.
+.PP
+.I Timezone
+returns the name of the time zone associated with its first argument,
+which is measured in minutes westward from Greenwich.
+If the second argument is 0, the standard name is used,
+otherwise the Daylight Saving version.
+If the required name does not appear in a table
+built into the routine,
+the difference from GMT is produced; e.g.
+in Afghanistan
+.I timezone(-(60*4+30), 0)
+is appropriate because it is 4:30 ahead of GMT
+and the string
+.B GMT+4:30
+is produced.
+.SH "SEE ALSO"
+time(2)
+.SH BUGS
+The return values point to static data
+whose content is overwritten by each call.
diff --git a/usr/man/man3/ctype.3 b/usr/man/man3/ctype.3
new file mode 100644 (file)
index 0000000..dd4252b
--- /dev/null
@@ -0,0 +1,64 @@
+.TH CTYPE 3  "25 February 1983"
+.SH NAME
+isalpha, isupper, islower, isdigit, isalnum, isspace, ispunct, isprint, iscntrl, isascii \- character classification
+.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
+is 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 isalnum
+.I c
+is an alphanumeric character
+.TP
+.I isspace
+.I c
+is a space, tab, carriage return, newline, 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 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
+.SH "SEE ALSO"
+ascii(7)
diff --git a/usr/man/man3/curses.3x b/usr/man/man3/curses.3x
new file mode 100644 (file)
index 0000000..7f779a4
--- /dev/null
@@ -0,0 +1,104 @@
+.TH CURSES 3X "19 January 1983"
+.UC 4
+.SH NAME
+curses \- screen functions with ``optimal'' cursor motion
+.SH SYNOPSIS
+.B cc
+[ flags ] files
+.B \-lcurses \-ltermcap
+[ 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
+.I refresh()
+tells the routines to make the current screen look like the new one.
+In order to initialize the routines, the routine
+.I initscr()
+must be called before any of the other routines that deal with windows and
+screens are used.  The routine
+.I endwin()
+should be called before exiting.
+.SH SEE ALSO
+.I "Screen Updating and Cursor Movement Optimization: A Library Package,"
+Ken Arnold,
+.br
+stty(2),
+getenv(3),
+termcap(5)
+.SH AUTHOR
+Ken Arnold
+.SH FUNCTIONS
+.nf
+.ds w \fIwin\fR
+.ds s \fIstdscr\fR
+.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
+crmode()       set cbreak mode
+clear()        clear \*s
+clearok(scr,boolf)     set clear flag for \fIscr\fR
+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
+getch()        get a char through \*s
+getcap(name)   get terminal capability \fIname\fR
+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\fR
+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
+nocrmode()     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
+touchwin(win)  \*(lqchange\*(rq all of \*w
+unctrl(ch)     printable version of \fIch\fR
+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 BUGS
diff --git a/usr/man/man3/dbm.3x b/usr/man/man3/dbm.3x
new file mode 100644 (file)
index 0000000..5a34892
--- /dev/null
@@ -0,0 +1,113 @@
+.TH DBM 3X  "19 January 1983"
+.UC 4
+.SH NAME
+dbminit, fetch, store, delete, firstkey, nextkey \- data base subroutines
+.SH SYNOPSIS
+.nf
+.PP
+.B typedef struct {
+.B "   char *dptr;"
+.B "   int dsize;"
+.B } datum;
+.PP
+.B dbminit(file)
+.B char *file;
+.PP
+.B datum fetch(key)
+.B datum key;
+.PP
+.B store(key, content)
+.B datum key, content;
+.PP
+.B delete(key)
+.B datum key;
+.PP
+.B datum firstkey()
+.PP
+.B datum nextkey(key)
+.B datum key;
+.SH DESCRIPTION
+These functions maintain key/content pairs in a data base.
+The functions will handle very large (a billion blocks)
+databases and will access a keyed item in one or two file system accesses.
+The functions are obtained with the loader option
+.BR \-ldbm .
+.PP
+.IR Key s
+and
+.IR content s
+are described by the
+.I datum
+typedef.  A
+.I datum
+specifies a string of
+.I dsize
+bytes pointed to by
+.I dptr.
+Arbitrary binary data, as well as normal ASCII strings, are allowed.
+The data base is stored in two files.
+One file is a directory containing a bit map and has `.dir' as its suffix.
+The second file contains all data and has `.pag' as its suffix.
+.PP
+Before a database can be accessed, it must be opened by
+.I dbminit.
+At the time of this call, the files
+.IB file .dir
+and
+.IB file .pag
+must exist.
+(An empty database is created by creating zero-length
+`.dir' and `.pag' files.)
+.PP
+Once open, the data stored under a key is accessed by
+.I fetch
+and data is placed under a key by
+.IR store .
+A key (and its associated contents) is deleted by
+.IR delete .
+A linear pass through all keys in a database may be made,
+in an (apparently) random order, by use of
+.I firstkey
+and
+.IR nextkey .
+.I Firstkey
+will return the first key in the database.  With any key
+.I nextkey
+will return the next key in the database.
+This code will traverse the data base:
+.IP
+.B for
+(key = firstkey(); key.dptr != NULL; key = nextkey(key))
+.SH DIAGNOSTICS
+All functions that return an
+.I int
+indicate errors with negative values.  A zero return indicates ok.
+Routines that return a
+.I datum
+indicate errors with a null (0)
+.I dptr.
+.SH BUGS
+The `.pag' file will contain holes so that its apparent size is about
+four times its actual content.  Older UNIX systems may create real
+file blocks for these holes when touched.  These files cannot be copied
+by normal means (cp, cat, tp, tar, ar) without filling in the holes.
+.PP
+.I Dptr
+pointers returned by these subroutines point into static storage
+that is changed by subsequent calls.
+.PP
+The sum of the sizes of a key/content pair must not exceed
+the internal block size (currently 1024 bytes).
+Moreover all key/content pairs that hash together must fit on a single block.
+.I Store
+will return an error in the event that a disk block fills with inseparable data.
+.PP
+.I Delete
+does not physically reclaim file space,
+although it does make it available for reuse.
+.PP
+The order of keys presented by
+.I firstkey
+and
+.I nextkey
+depends on a hashing function, not on anything interesting.
diff --git a/usr/man/man3/directory.3 b/usr/man/man3/directory.3
new file mode 100644 (file)
index 0000000..234e13e
--- /dev/null
@@ -0,0 +1,136 @@
+.TH DIRECTORY 3 "25 February 1983"
+.UC
+.SH NAME
+opendir, readdir, telldir, seekdir, rewinddir, closedir \- directory operations
+.SH SYNOPSIS
+.B #include <ndir.h>
+.PP
+.SM
+.B DIR
+.B *opendir(filename)
+.br
+.B char *filename;
+.PP
+.B struct direct
+.B *readdir(dirp)
+.br
+.SM
+.B DIR
+.B *dirp;
+.PP
+.B long
+.B telldir(dirp)
+.br
+.SM
+.B DIR
+.B *dirp;
+.PP
+.B seekdir(dirp, loc)
+.br
+.SM
+.B DIR
+.B *dirp;
+.br
+.B long loc;
+.PP
+.B rewinddir(dirp)
+.br
+.SM
+.B DIR
+.B *dirp;
+.PP
+.B closedir(dirp)
+.br
+.SM
+.B DIR
+.B *dirp;
+.SH DESCRIPTION
+.I Opendir
+opens the directory named by
+.I filename
+and associates a
+.I directory stream
+with it.
+.I Opendir
+returns a pointer to be used to identify the
+.I directory stream
+in subsequent operations.  The pointer
+.SM
+.B NULL
+is returned if
+.I filename
+cannot be accessed or is not a directory, or if it cannot
+.IR malloc (3)
+enough memory to hold the whole thing.
+.PP
+.I Readdir
+returns a pointer to the next directory entry.  It returns
+.B NULL
+upon reaching the end of the directory or detecting an invalid
+.I seekdir
+operation.
+.PP
+.I Telldir
+returns the current location associated with the named
+.I directory stream.
+.PP
+.I Seekdir
+sets the position of the next
+.I readdir
+operation on the
+.I directory stream.
+The new position reverts to the one associated with the
+.I directory stream
+when the
+.I telldir
+operation was performed.  Values returned by
+.I telldir
+are good only for the lifetime of the DIR pointer from which they are derived.
+If the directory is closed and then reopened, the 
+.I telldir
+value may be invalidated due to undetected directory compaction.
+It is safe to use a previous
+.I telldir
+value immediately after a call to
+.I opendir
+and before any calls to
+.I readdir.
+.PP
+.I Rewinddir
+resets the position of the named
+.I directory stream
+to the beginning of the directory.
+.PP
+.I Closedir
+closes the named
+.I directory stream
+and frees the structure associated with the DIR pointer.
+.PP
+Sample code which searchs a directory for entry ``name'' is:
+.PP
+.br
+       len = strlen(name);
+.br
+       dirp = opendir(".");
+.br
+       for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
+.br
+               if (dp->d_namlen == len && !strcmp(dp->d_name, name)) {
+.br
+                       closedir(dirp);
+.br
+                       return FOUND;
+.br
+               }
+.br
+       closedir(dirp);
+.br
+       return NOT_FOUND;
+.SH "SEE ALSO"
+open(2),
+close(2),
+read(2),
+lseek(2)
+.SH BUGS
+Old UNIX programs which examine directories should be converted to use
+this package, as the new directory format is non-obvious.
diff --git a/usr/man/man3/ecvt.3 b/usr/man/man3/ecvt.3
new file mode 100644 (file)
index 0000000..1ab1f4c
--- /dev/null
@@ -0,0 +1,53 @@
+.TH ECVT 3  "19 January 1983"
+.SH NAME
+ecvt, fcvt, gcvt \- output conversion
+.SH SYNOPSIS
+.nf
+.B char *ecvt(value, ndigit, decpt, sign)
+.B double value;
+.B int ndigit, *decpt, *sign;
+.PP
+.B char *fcvt(value, ndigit, decpt, sign)
+.B double value;
+.B int ndigit, *decpt, *sign;
+.PP
+.B char *gcvt(value, ndigit, buf)
+.B double value;
+.B char *buf;
+.fi
+.SH DESCRIPTION
+.I Ecvt
+converts the 
+.I value
+to a null-terminated string of
+.I ndigit
+ASCII digits and returns a pointer thereto.
+The position of the decimal point relative to the
+beginning of the string is stored indirectly through
+.IR decpt ""
+(negative means to the left of the returned digits).
+If the sign of the result is negative, the word pointed to by
+.IR sign ""
+is non-zero, otherwise it is zero.  The low-order digit is rounded.
+.PP
+.IR Fcvt " is identical to " "ecvt\fR, except that the correct digit"
+has been rounded for Fortran F-format output of the number
+of digits specified by
+.IR \(*_ndigits .
+.PP
+.I Gcvt
+converts the
+.I value
+to a null-terminated ASCII string in
+.I buf
+and returns a pointer to 
+.I buf.
+It attempts to produce
+.I ndigit
+significant digits in Fortran F format if possible, otherwise E format,
+ready for printing.  Trailing zeros may be suppressed.
+.SH "SEE ALSO"
+printf(3)
+.SH BUGS
+The return values point to static data
+whose content is overwritten by each call.
diff --git a/usr/man/man3/end.3 b/usr/man/man3/end.3
new file mode 100644 (file)
index 0000000..679f50e
--- /dev/null
@@ -0,0 +1,36 @@
+.TH END 3  "19 January 1983"
+.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 (3)),
+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)
diff --git a/usr/man/man3/etime.3f b/usr/man/man3/etime.3f
new file mode 100644 (file)
index 0000000..8d4b900
--- /dev/null
@@ -0,0 +1,28 @@
+.TH ETIME 3F "19 January 1983"
+.SH NAME
+etime, dtime \- return elapsed execution time
+.SH SYNOPSIS
+.B function etime (tarray)
+.br
+.B real tarray(2)
+.sp 1
+.B function dtime (tarray)
+.br
+.B real tarray(2)
+.SH DESCRIPTION
+These two routines return elapsed runtime in seconds for the calling process.
+.I Dtime
+returns the elapsed time since the last call to
+.I dtime,
+or the start of execution on the first call.
+.PP
+The argument array returns user time in the first element and system time
+in the second element.
+The function value is the sum of user and system time.
+.PP
+The resolution of all timing is 1/60 sec.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+times(2)
diff --git a/usr/man/man3/exit.3f b/usr/man/man3/exit.3f
new file mode 100644 (file)
index 0000000..f9ee935
--- /dev/null
@@ -0,0 +1,30 @@
+.TH EXIT 3F  "19 January 1983"
+.SH NAME
+exit \- terminate process with status
+.SH SYNOPSIS
+.B subroutine exit (status)
+.br
+.B integer status
+.SH DESCRIPTION
+.I Exit
+flushes and closes all the process's files, and notifies the parent process
+if it is executing a
+.IR wait .
+The low-order 8 bits of 
+.I status
+are available to the parent process.
+(Therefore
+.I status
+should be in the range 0 \- 255)
+.PP
+This call will never return.
+.PP
+The C function
+.I exit
+may cause cleanup actions before the
+final `sys exit'.
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
+.SH "SEE ALSO"
+exit(2), fork(2), fork(3f), wait(2), wait(3f)
diff --git a/usr/man/man3/exp.3m b/usr/man/man3/exp.3m
new file mode 100644 (file)
index 0000000..962a421
--- /dev/null
@@ -0,0 +1,70 @@
+.TH EXP 3M  "19 January 1983"
+.SH NAME
+exp, log, log10, pow, sqrt \- exponential, logarithm, power, square root
+.SH SYNOPSIS
+.nf
+.B #include <math.h>
+.PP
+.B double exp(x)
+.B double x;
+.PP
+.B double log(x)
+.B double x;
+.PP
+.B double log10(x)
+.B double x;
+.PP
+.B double pow(x, y)
+.B double x, y;
+.PP
+.B double sqrt(x)
+.B double x;
+.fi
+.SH DESCRIPTION
+.I Exp
+returns the exponential function of 
+.I x.
+.PP
+.I Log
+returns the natural logarithm of 
+.IR x ;
+.I log10
+returns the base 10 logarithm.
+.PP
+.I Pow
+returns
+.I  x\u\s8y\s10\d.
+.PP
+.I Sqrt
+returns the square root of 
+.I x.
+.SH SEE ALSO
+hypot(3),
+sinh(3),
+intro(2)
+.SH DIAGNOSTICS
+.I Exp
+and
+.I pow
+return a huge value when the correct value would overflow;
+.I errno
+is set to ERANGE.
+.I Pow
+returns 0 and sets
+.I errno
+to EDOM when the second argument is negative and non-integral and
+when both arguments are 0.
+.PP
+.I Log
+returns 0 when
+.I x
+is zero or negative;
+.I errno
+is set to EDOM.
+.PP
+.I Sqrt
+returns 0 when 
+.I x
+is negative;
+.I errno
+is set to EDOM.
diff --git a/usr/man/man3/fclose.3s b/usr/man/man3/fclose.3s
new file mode 100644 (file)
index 0000000..ceb6a7a
--- /dev/null
@@ -0,0 +1,47 @@
+.TH FCLOSE 3S  "19 January 1983"
+.SH NAME
+fclose, fflush \- close or flush a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B fclose(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B fflush(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Fclose
+causes any buffers for the named
+.I stream
+to be emptied, and the file to be closed.
+Buffers allocated by the standard input/output system
+are freed.
+.PP
+.I Fclose
+is performed automatically upon
+calling
+.IR  exit (2).
+.PP
+.I Fflush
+causes any buffered data for the named output
+.I stream
+to be written to that file.
+The stream remains open.
+.SH "SEE ALSO"
+close(2),
+fopen(3),
+setbuf(3)
+.SH DIAGNOSTICS
+These routines return
+.SM
+.B EOF
+if
+.I stream
+is not associated with an output file, or
+if buffered data cannot be transferred to that file.
diff --git a/usr/man/man3/fdate.3f b/usr/man/man3/fdate.3f
new file mode 100644 (file)
index 0000000..44bed82
--- /dev/null
@@ -0,0 +1,20 @@
+.TH FDATE 3F "19 January 1983"
+.SH NAME
+fdate \- return date and time in an ASCII string
+.SH SYNOPSIS
+.B subroutine fdate (string)
+.br
+.B character*(*) string
+.sp 1
+.B character*(*) function fdate()
+.SH DESCRIPTION
+.I Fdate
+returns the current date and time as a 24 character string
+in the format described under
+.IR ctime (3).
+Neither 'newline' nor NULL will be included.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+ctime(3), time(3F), itime(3F), idate(3F), ltime(3F)
diff --git a/usr/man/man3/ferror.3s b/usr/man/man3/ferror.3s
new file mode 100644 (file)
index 0000000..ff393d2
--- /dev/null
@@ -0,0 +1,61 @@
+.TH FERROR 3S  "19 January 1983"
+.SH NAME
+feof, ferror, clearerr, fileno \- stream status inquiries
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B feof(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B ferror(stream)
+.br
+.SM
+.B FILE
+.B *stream
+.PP
+.B clearerr(stream)
+.br
+.SM
+.B FILE
+.B *stream
+.PP
+.B fileno(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Feof
+returns non-zero when end of file is read on the named input
+.I stream,
+otherwise zero.
+.PP
+.I Ferror
+returns non-zero when an error has occurred reading or writing
+the named
+.I stream,
+otherwise zero.
+Unless cleared by
+.I clearerr,
+the error indication lasts until
+the stream is closed.
+.PP
+.I Clrerr
+resets the error indication on the named
+.I stream.
+.PP
+.I Fileno
+returns the integer file descriptor
+associated with the
+.I stream,
+see
+.IR  open (2).
+.PP
+These functions
+are implemented as macros;
+they cannot be redeclared.
+.SH "SEE ALSO"
+fopen(3), open(2)
diff --git a/usr/man/man3/floor.3m b/usr/man/man3/floor.3m
new file mode 100644 (file)
index 0000000..f7dbbe6
--- /dev/null
@@ -0,0 +1,30 @@
+.TH FLOOR 3M  "19 January 1983"
+.SH NAME
+fabs, floor, ceil \- absolute value, floor, ceiling 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;
+.nf
+.SH DESCRIPTION
+.I Fabs
+returns the absolute value
+.RI | \|x\| |.
+.PP
+.I Floor
+returns the largest integer not greater than
+.IR x .
+.PP
+.I Ceil
+returns the smallest integer not less than
+.IR x .
+.SH SEE ALSO
+abs(3)
diff --git a/usr/man/man3/flush.3f b/usr/man/man3/flush.3f
new file mode 100644 (file)
index 0000000..28efa65
--- /dev/null
@@ -0,0 +1,17 @@
+.TH FLUSH 3F "19 January 1983"
+.SH NAME
+flush \- flush output to a logical unit
+.SH SYNOPSIS
+.B subroutine flush (lunit)
+.SH DESCRIPTION
+.I Flush
+causes the contents of the buffer for logical unit
+.I lunit
+to be flushed to the associated file.
+This is most useful for logical units 0 and 6 when they are both
+associated with the control terminal.
+.SH FILES
+.ie \nM /usr/ucb/lib/libI77.a
+.el /usr/lib/libI77.a
+.SH "SEE ALSO"
+fclose(3)
diff --git a/usr/man/man3/fopen.3s b/usr/man/man3/fopen.3s
new file mode 100644 (file)
index 0000000..5a67328
--- /dev/null
@@ -0,0 +1,102 @@
+.TH FOPEN 3S  "1 April 1981"
+.UC 4
+.SH NAME
+fopen, freopen, fdopen \- open a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.SM
+.B FILE
+.B *fopen(filename, type)
+.br
+.B char *filename, *type;
+.PP
+.SM
+.B FILE
+.B *freopen(filename, type, stream)
+.br
+.B char *filename, *type;
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.SM
+.B FILE
+.B *fdopen(fildes, type)
+.br
+.B char *type;
+.SH DESCRIPTION
+.I Fopen
+opens the file named by
+.I filename
+and associates a stream with it.
+.I Fopen
+returns a pointer to be used to identify the stream in subsequent operations.
+.PP
+.I Type
+is a character string having one of the following values:
+.TP 5
+"r"
+open for reading
+.ns
+.TP 5
+"w"
+create for writing
+.ns
+.TP 5
+"a"
+append: open for writing at end of file, or create for writing
+.PP
+In addition, each
+.I type
+may be followed by a '+' to have the file opened for reading and writing.
+"r+" positions the stream at the beginning of the file, "w+" creates
+or truncates it, and "a+" positions it at the end.  Both reads and writes
+may be used on read/write streams, with the limitation that an
+.I fseek, rewind,
+or reading an end-of-file must be used between a read and a write or vice-versa.
+.PP
+.I Freopen
+substitutes the named file in place of the open
+.IR stream .
+It returns the original value of
+.IR stream .
+The original stream is closed.
+.PP
+.I Freopen
+is typically used to attach the preopened constant names,
+.B stdin, stdout, stderr,
+to specified files.
+.PP
+.I Fdopen
+associates a stream with a file descriptor obtained from
+.I open, dup, creat,
+or
+.IR pipe (2).
+The
+.I type
+of the stream must agree with the mode of the open file.
+.SH "SEE ALSO"
+open(2),
+fclose(3)
+.SH DIAGNOSTICS
+.I Fopen
+and 
+.I freopen
+return the pointer
+.SM
+.B NULL
+if
+.I filename
+cannot be accessed.
+.SH BUGS
+.I Fdopen
+is not portable to systems other than UNIX.
+.PP
+The read/write 
+.I types
+do not exist on all systems.  Those systems without
+read/write modes will probably treat the 
+.I type
+as if the '+' was not present.  These are unreliable in any event.
diff --git a/usr/man/man3/fork.3f b/usr/man/man3/fork.3f
new file mode 100644 (file)
index 0000000..eb19dab
--- /dev/null
@@ -0,0 +1,47 @@
+.TH FORK 3F "19 January 1983"
+.SH NAME
+fork \- create a copy of this process
+.SH SYNOPSIS
+.B integer function fork()
+.SH DESCRIPTION
+.I Fork
+creates a copy of the calling process.
+The only distinction between the 2 processes is that the value
+returned to one of them (referred to as the 'parent' process)
+will be the process id if the copy.
+The copy is usually referred to as the 'child' process.
+The value returned to the 'child' process will be zero.
+.PP
+All logical units open for writing are flushed before the fork to avoid
+duplication of the contents of I/O buffers in the external file(s).
+.PP
+If the returned value is negative, it indicates an error and will be
+the negation of the system error code.
+See perror(3F).
+.PP
+A corresponding
+.I exec
+routine has not been provided because there is no satisfactory way to
+retain open logical units across the exec.
+However, the usual function of
+.I fork/exec
+can be performed using
+.IR system (3F).
+.if 0 \{
+A pipe can be opened to another process using the f77
+.B open
+statement with
+.sp 1
+.ti +5
+.B "file=\(fm\fIprocess\fB\(fm, status=\(fmpipe\(fm, access=\(fmread\(fm"
+.br
+or
+.br
+.ti +5
+.B "file=\(fm\fIprocess\fB\(fm, status=\(fmpipe\(fm, access=\(fmwrite\(fm"
+\}
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+fork(2), wait(3F), kill(3F), system(3F), perror(3F)
diff --git a/usr/man/man3/fread.3s b/usr/man/man3/fread.3s
new file mode 100644 (file)
index 0000000..1a35fd6
--- /dev/null
@@ -0,0 +1,63 @@
+.TH FREAD 3S  "19 January 1983"
+.UC 4
+.SH NAME
+fread, fwrite \- buffered binary input/output
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B fread(ptr, sizeof(*ptr), nitems, stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B fwrite(ptr, sizeof(*ptr), nitems, stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Fread
+reads, into a block beginning at
+.I ptr,
+.I nitems
+of data of the type of
+.I *ptr
+from the named input
+.IR stream .
+It returns the number of items actually read.
+.PP
+If
+.I stream
+is
+.B stdin
+and the standard output is line buffered, then any partial output line
+will be flushed before any call to
+.IR read (2)
+to satisfy the
+.I fread.
+.PP
+.I Fwrite
+appends at most
+.I nitems
+of data of the type of
+.I *ptr
+beginning at
+.I ptr
+to the named output
+.IR stream .
+It returns the number of items actually written.
+.SH "SEE ALSO"
+read(2), write(2),
+fopen(3),
+getc(3), putc(3),
+gets(3), puts(3),
+printf(3), scanf(3)
+.SH DIAGNOSTICS
+.I Fread
+and
+.I fwrite
+return
+0
+upon end of file or error.
+.SH BUGS
diff --git a/usr/man/man3/frexp.3 b/usr/man/man3/frexp.3
new file mode 100644 (file)
index 0000000..0430d94
--- /dev/null
@@ -0,0 +1,40 @@
+.TH FREXP 3 "19 January 1983"
+.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
+.I Frexp
+returns the mantissa of a double 
+.I value
+as a double quantity,
+.I x,
+of magnitude less than 1
+and stores an integer 
+.I n
+such that
+.I value
+=
+\fIx\fP\|\(**\|2\u\fIn\fP\d
+indirectly through 
+.I eptr.
+.PP
+.I Ldexp
+returns the quantity
+\fIvalue\|\(**\|2\u\fIexp\fP\d.
+.PP
+.I Modf
+returns the positive fractional part of
+.I value
+and stores the integer part indirectly
+through 
+.I iptr.
diff --git a/usr/man/man3/fseek.3f b/usr/man/man3/fseek.3f
new file mode 100644 (file)
index 0000000..090b13a
--- /dev/null
@@ -0,0 +1,42 @@
+.TH FSEEK 3F "19 January 1983"
+.SH NAME
+fseek, ftell \- reposition a file on a logical unit
+.SH SYNOPSIS
+.B integer function fseek (lunit, offset, from)
+.br
+.B integer offset, from
+.sp 1
+.B integer function ftell (lunit)
+.SH DESCRIPTION
+.I lunit
+must refer to an open logical unit.
+.I offset
+is an offset in bytes relative to the position specified by
+.I from.
+Valid values for
+.I from
+are:
+.sp 1
+.in +5
+0 meaning 'beginning of the file'
+.br
+1 meaning 'the current position'
+.br
+2 meaning 'the end of the file'
+.in -5
+.PP
+The value returned by
+.I fseek
+will be 0 if successful, a system error code otherwise.
+(See perror(3F))
+.PP
+.I Ftell
+returns the current position of the file associated with the specified
+logical unit. The value is an offset, in bytes, from the beginning of the file.
+If the value returned is negative, it indicates an error and will be
+the negation of the system error code. (See perror(3F))
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+fseek(3), perror(3F)
diff --git a/usr/man/man3/fseek.3s b/usr/man/man3/fseek.3s
new file mode 100644 (file)
index 0000000..f6895d5
--- /dev/null
@@ -0,0 +1,59 @@
+.TH FSEEK 3S  "19 January 1983"
+.SH NAME
+fseek, ftell, rewind \- reposition a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B fseek(stream, offset, ptrname)
+.br
+.SM
+.B FILE
+.B *stream;
+.br
+.B long offset;
+.PP
+.B long ftell(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B rewind(stream)
+.SH DESCRIPTION
+.I Fseek
+sets the position of the next input or output
+operation on the
+.IR stream .
+The new position is at the signed distance
+.I offset
+bytes
+from the beginning, the current position, or the end of the file,
+according as 
+.I ptrname
+has the value 0, 1, or 2.
+.PP
+.I Fseek
+undoes any effects of
+.IR  ungetc (3).
+.PP
+.I Ftell
+returns the current value of the offset relative to the beginning
+of the file associated with the named
+.IR stream .
+It is measured in bytes on UNIX;
+on some other systems it is a magic cookie,
+and the only foolproof way to obtain an 
+.I offset
+for
+.IR fseek .
+.PP
+.IR Rewind ( stream )
+is equivalent to
+.IR fseek ( stream ,
+0L, 0).
+.SH "SEE ALSO"
+lseek(2),
+fopen(3)
+.SH DIAGNOSTICS
+.I Fseek
+returns \-1 for improper seeks.
diff --git a/usr/man/man3/gamma.3m b/usr/man/man3/gamma.3m
new file mode 100644 (file)
index 0000000..d449498
--- /dev/null
@@ -0,0 +1,29 @@
+.TH GAMMA 3M  "19 January 1983"
+.SH NAME
+gamma \- log gamma function
+.SH SYNOPSIS
+.nf
+.B #include <math.h>
+.PP
+.B double gamma(x)
+.B double x;
+.fi
+.SH DESCRIPTION
+.I Gamma
+returns ln \||\|\(*G(\||\|\fIx\fR\||\|)\||\|.
+The sign of \(*G(\||\|\fIx\fR\||\|) is returned in the external integer
+.IR signgam .
+The following C program might be used to calculate \(*G:
+.PP
+.nf
+       y = gamma(x);
+       if (y > 88.0)
+               error();
+       y = exp(y);
+       if(signgam)
+               y = \-y;
+.fi
+.SH DIAGNOSTICS
+A huge value is returned for negative integer arguments.
+.SH BUGS
+There should be a positive indication of error.
diff --git a/usr/man/man3/getarg.3f b/usr/man/man3/getarg.3f
new file mode 100644 (file)
index 0000000..49812b5
--- /dev/null
@@ -0,0 +1,34 @@
+.TH GETARG 3F "19 January 1983"
+.SH NAME
+getarg, iargc \- command arguments to Fortran
+.SH SYNOPSIS
+.nf
+.B subroutine getarg( argno, string )
+.B integer argno
+.B character *(*) string
+.PP
+.B iargc()
+.fi
+.SH DESCRIPTION
+These procedures permit Fortran programs to access the command arguments.
+The integer function
+.B iargc
+returns the number of command arguments.
+The subroutine
+.B getarg
+stores the nth command argument in its second argument.
+The string is truncated or padded with blanks,
+in accord with the rules of Fortran character assignment.
+.PP
+The command
+       go arg1 argument2
+.br
+will return 2 as the value of
+.B iargc.
+If \fBs\fR is declared character\(**4,
+then
+      call getarg(2, s)
+.br
+will put \*(lqargu\*(rq in \fBs\fR.
+.SH "SEE ALSO"
+exec(2)
diff --git a/usr/man/man3/getc.3f b/usr/man/man3/getc.3f
new file mode 100644 (file)
index 0000000..946ebf0
--- /dev/null
@@ -0,0 +1,26 @@
+.TH GETC 3F "19 January 1983"
+.SH NAME
+getc, fgetc \- get a character from a logical unit
+.SH SYNOPSIS
+.B integer function getc (char)
+.br
+.B character char
+.sp 1
+.B integer function fgetc (lunit, char)
+.br
+.B character char
+.SH DESCRIPTION
+These routines return the next character from a file associated with a
+fortran logical unit, bypassing normal fortran I/O.
+.I Getc
+reads from logical unit 5, normally connected to the control terminal input.
+.PP
+The value of each function is a system status code. Zero indicates no
+error occured on the read; \-1 indicates end of file was detected.
+A positive value will be either a UNIX system error code or an f77 I/O error
+code. See perror(3F).
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+getc(3S), intro(2), perror(3F)
diff --git a/usr/man/man3/getc.3s b/usr/man/man3/getc.3s
new file mode 100644 (file)
index 0000000..17e12f5
--- /dev/null
@@ -0,0 +1,85 @@
+.TH GETC 3S  "19 January 1983"
+.SH NAME
+getc, getchar, fgetc, getw \- get character or word from stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B int getc(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B int getchar()
+.PP 
+.B int fgetc(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B int getw(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Getc
+returns the next character from the named input
+.IR stream .
+.PP
+.IR Getchar ()
+is identical to 
+.IR getc ( stdin ) .
+.PP
+.I Fgetc
+behaves like 
+.IR getc ,
+but is a genuine function, not a macro;
+it may be used to save object text.
+.PP
+.I Getw
+returns the next
+word (in a 32-bit integer on a VAX-11) from the named input
+.IR stream .
+It returns the constant
+.SM
+.B EOF
+upon end of file or error, but since that is a good
+integer value,
+.I feof
+and
+.IR  ferror (3)
+should be used to check the success of
+.IR getw .
+.I Getw
+assumes no special alignment in the file.
+.SH "SEE ALSO"
+fopen(3), putc(3),
+gets(3), scanf(3),
+fread(3),
+ungetc(3)
+.SH DIAGNOSTICS
+These functions return the integer constant
+.SM
+.B EOF
+at end of file or upon read error.
+.PP
+A stop with message,
+`Reading bad file', means an attempt has been made to
+read from a stream that has not been opened for
+reading by
+.IR fopen .
+.SH BUGS
+The end-of-file return from
+.I getchar
+is incompatible with that in UNIX editions 1-6.
+.PP
+Because it is implemented as a macro,
+.I getc
+treats a
+.I stream
+argument with side effects incorrectly.
+In particular,
+`getc(*f++);'
+doesn't work sensibly.
diff --git a/usr/man/man3/getenv.3 b/usr/man/man3/getenv.3
new file mode 100644 (file)
index 0000000..dc6088f
--- /dev/null
@@ -0,0 +1,23 @@
+.TH GETENV 3 "19 January 1983"
+.SH NAME
+getenv \- value for environment name
+.SH SYNOPSIS
+.nf
+.B char *getenv(name)
+.B char *name;
+.fi
+.SH DESCRIPTION
+.I Getenv
+.a
+searches the environment list
+(see
+.IR environ (5))
+for a string of the form
+.IB name = value
+and returns a pointer to the string
+.I value
+if such a string is present, otherwise 
+.I getenv
+returns the value 0 (NULL).
+.SH SEE ALSO
+environ(7), execve(2)
diff --git a/usr/man/man3/getenv.3f b/usr/man/man3/getenv.3f
new file mode 100644 (file)
index 0000000..9de5f3c
--- /dev/null
@@ -0,0 +1,27 @@
+.TH GETENV 3F "19 January 1983"
+.SH NAME
+getenv \- get value of environment variables
+.SH SYNOPSIS
+.B subroutine getenv (ename, evalue)
+.br
+.B character*(*) ename, evalue
+.SH DESCRIPTION
+.I Getenv
+.a
+searches the environment list
+(see
+.IR environ (5))
+for a string of the form
+.IB ename = value
+and returns
+.I value
+in
+.I evalue
+if such a string is present, otherwise fills
+.I evalue
+with blanks.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+environ(5), exec(2)
diff --git a/usr/man/man3/getfsent.3 b/usr/man/man3/getfsent.3
new file mode 100644 (file)
index 0000000..f4918bb
--- /dev/null
@@ -0,0 +1,73 @@
+.TH GETFSENT 3  "19 January 1983"
+.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(name)
+.B char *name;
+.PP
+.B struct fstab *getfsfile(name)
+.B char *name;
+.PP
+.B int setfsend()
+.PP
+.B int endfsent()
+.fi
+.SH DESCRIPTION
+.I Getfsent,
+.I getfsspec
+and
+.I getfsfile
+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,
+.I /usr/include/fstab.h.
+.RS
+.PP
+.nf
+#define        FSNMLG  16
+
+struct fstab{
+       char    fs_spec[FSNMLG];
+       char    fs_file[FSNMLG];
+       char    fs_type[3];
+       int     fs_freq;
+       int     fs_passno;
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The fields have meanings described in
+.IR fstab (5).
+.PP
+.I Getfsent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Setfsent
+opens and rewinds the file.
+.PP
+.I Endfsent
+closes the file.
+.PP
+.I Getfsspec
+and
+.I getfsfile
+sequentially search from the beginning of the file until a matching
+special file name or file system file name is found,
+or until EOF is encountered.
+.SH FILES
+/etc/fstab
+.SH "SEE ALSO"
+fstab(5)
+.SH DIAGNOSTICS
+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.
diff --git a/usr/man/man3/getgrent.3 b/usr/man/man3/getgrent.3
new file mode 100644 (file)
index 0000000..f7113cf
--- /dev/null
@@ -0,0 +1,97 @@
+.TH GETGRENT 3  "19 January 1983"
+.SH NAME
+getgrent, getgrgid, getgrnam, setgrent, endgrent \- get group file entry
+.SH SYNOPSIS
+.nf
+.B #include <grp.h>
+.PP
+.B struct group *getgrent()
+.PP
+.B struct group *getgrgid(gid)
+.B int gid;
+.PP
+.B struct group *getgrnam(name)
+.B char *name;
+.PP
+.B setgrent()
+.PP
+.B endgrent()
+.fi
+.SH DESCRIPTION
+.I Getgrent,
+.I getgrgid
+and
+.I getgrnam
+each return pointers
+to an object
+with the following structure
+containing the broken-out
+fields of a line in the group file.
+.RS
+.PP
+.nf
+.so /usr/include/grp.h
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'gr_passwd'u+2n
+gr_name
+The name of the group.
+.br
+.ns
+.TP \w'gr_passwd'u+2n
+gr_passwd
+The encrypted password of the group.
+.br
+.ns
+.TP \w'gr_passwd'u+2n
+gr_gid
+The numerical group-ID.
+.br
+.ns
+.TP \w'gr_passwd'u+2n
+gr_mem
+Null-terminated vector
+of pointers to the individual
+member names.
+.PP
+.I Getgrent
+simply reads the next
+line while
+.I getgrgid
+and
+.I getgrnam
+search until a matching
+.I gid
+or
+.I name
+is found
+(or until EOF is encountered).
+Each routine picks up
+where the others leave off
+so successive calls may be used
+to search the entire file.
+.PP
+A call to
+.I setgrent
+has the effect of rewinding
+the group file
+to allow
+repeated searches.
+.I Endgrent
+may be called to
+close the group file
+when processing is complete.
+.SH FILES
+/etc/group
+.SH "SEE ALSO"
+getlogin(3), getpwent(3), group(5)
+.SH DIAGNOSTICS
+A null pointer
+(0) is 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.
diff --git a/usr/man/man3/gethostent.3n b/usr/man/man3/gethostent.3n
new file mode 100644 (file)
index 0000000..73f7e0e
--- /dev/null
@@ -0,0 +1,103 @@
+.TH GETHOSTENT 3N "9 February 1983"
+.UC 4.2
+.SH NAME
+gethostent, gethostbyaddr, gethostbyname, sethostent, endhostent \- get network host entry
+.SH SYNOPSIS
+.B "#include <netdb.h>
+.PP
+.B "struct hostent *gethostent()
+.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 "sethostent(stayopen)
+.br
+.B "int stayopen
+.PP
+.B "endhostent()
+.SH DESCRIPTION
+.IR Gethostent ,
+.IR gethostbyname ,
+and
+.I gethostbyaddr
+each return a pointer to an object with the
+following structure
+containing the broken-out
+fields of a line in the network host data base,
+.IR /etc/hosts .
+.RS
+.PP
+.nf
+struct hostent {
+       char    *h_name;        /* official name of host */
+       char    **h_aliases;    /* alias list */
+       int     h_addrtype;     /* address type */
+       int     h_length;       /* length of address */
+       char    *h_addr;        /* address */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'h_addrtype'u+2n
+h_name
+Official name of the host.
+.TP \w'h_addrtype'u+2n
+h_aliases
+A zero terminated array of alternate names for the host.
+.TP \w'h_addrtype'u+2n
+h_addrtype
+The type of address being returned; currently always AF_INET.
+.TP \w'h_addrtype'u+2n
+h_length
+The length, in bytes, of the address.
+.TP \w'h_addrtype'u+2n
+h_addr
+A pointer to the network address for the host.
+Host addresses are returned
+in network byte order.
+.PP
+.I Gethostent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Sethostent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the host data base will not be closed after each call to 
+.I gethostent
+(either directly, or indirectly through one of the other
+\*(lqgethost\*(rq calls).
+.PP
+.I Endhostent
+closes the file.
+.PP
+.I Gethostbyname
+and
+.I gethostbyaddr
+sequentially search from the beginning
+of the file until a matching
+host name or
+host address is found,
+or until EOF is encountered.
+Host addresses are supplied in network order.
+.SH FILES
+/etc/hosts
+.SH "SEE ALSO"
+hosts(5)
+.SH DIAGNOSTICS
+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
+address format is currently understood.
diff --git a/usr/man/man3/getlog.3f b/usr/man/man3/getlog.3f
new file mode 100644 (file)
index 0000000..2964691
--- /dev/null
@@ -0,0 +1,18 @@
+.TH GETLOG 3F "19 January 1983"
+.SH NAME
+getlog \- get user's login name
+.SH SYNOPSIS
+.B subroutine getlog (name)
+.br
+.B character*(*) name
+.sp 1
+.B character*(*) function getlog()
+.SH DESCRIPTION
+.I Getlog
+will return the user's login name or all blanks if
+the process is running detached from a terminal.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+getlogin(3)
diff --git a/usr/man/man3/getlogin.3 b/usr/man/man3/getlogin.3
new file mode 100644 (file)
index 0000000..e78b6ba
--- /dev/null
@@ -0,0 +1,31 @@
+.TH GETLOGIN 3  "19 January 1983"
+.SH NAME
+getlogin \- get login name
+.SH SYNOPSIS
+.B char *getlogin()
+.SH DESCRIPTION
+.I Getlogin
+returns a pointer to the login name as found in
+.IR /etc/utmp .
+It may be used in conjunction with
+.I getpwnam
+to locate the correct password file entry when the same userid
+is shared by several login names.
+.PP
+If
+.I getlogin
+is called within a process that is not attached to a
+typewriter, it returns NULL.
+The correct procedure for determining the login name is to first call
+.I getlogin
+and if it fails, to call
+.IR getpw(getuid()) .
+.SH FILES
+/etc/utmp
+.SH "SEE ALSO"
+getpwent(3), getgrent(3), utmp(5), getpw(3)
+.SH DIAGNOSTICS
+Returns NULL (0) if name not found.
+.SH BUGS
+The return values point to static data
+whose content is overwritten by each call.
diff --git a/usr/man/man3/getnetent.3n b/usr/man/man3/getnetent.3n
new file mode 100644 (file)
index 0000000..5d0c09f
--- /dev/null
@@ -0,0 +1,106 @@
+.TH GETNETENT 3N "9 February 1983"
+.UC 4.2
+.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)
+long net;
+.PP
+.ft B
+setnetent(stayopen)
+int stayopen
+.PP
+.ft B
+endnetent()
+.fi
+.SH DESCRIPTION
+.IR Getnetent ,
+.IR getnetbyname ,
+and
+.I getnetbyaddr
+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
+struct netent {
+       char    *n_name;        /* official name of net */
+       char    **n_aliases;    /* alias list */
+       int     n_addrtype;     /* net number type */
+       long    n_net;          /* net number */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'n_addrtype'u+2n
+n_name
+The official name of the network.
+.TP \w'n_addrtype'u+2n
+n_aliases
+A zero terminated list of alternate names for the network.
+.TP \w'n_addrtype'u+2n
+n_addrtype
+The type of the network number returned; currently only AF_INET.
+.TP \w'n_addrtype'u+2n
+n_net
+The network number.  Network numbers are returned in machine byte
+order.
+.PP
+.I Getnetent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Setnetent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the net data base will not be closed after each call to 
+.I getnetent
+(either directly, or indirectly through one of
+the other \*(lqgetnet\*(rq calls).
+.PP
+.I Endnetent
+closes the file.
+.PP
+.I Getnetbyname
+and
+.I getnetbyaddr
+sequentially search from the beginning
+of the file until a matching
+net name or
+net address is found,
+or until EOF is encountered.
+Network numbers are supplied in host order.
+.SH FILES
+/etc/networks
+.SH "SEE ALSO"
+networks(5)
+.SH DIAGNOSTICS
+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
+numbers are currently understood.
+Expecting network numbers to fit
+in no more than 32 bits is probably
+naive.
diff --git a/usr/man/man3/getpass.3 b/usr/man/man3/getpass.3
new file mode 100644 (file)
index 0000000..271a988
--- /dev/null
@@ -0,0 +1,25 @@
+.TH GETPASS 3  "19 January 1983"
+.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.
+.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.
diff --git a/usr/man/man3/getpid.3f b/usr/man/man3/getpid.3f
new file mode 100644 (file)
index 0000000..9e65efe
--- /dev/null
@@ -0,0 +1,13 @@
+.TH GETPID 3F "19 January 1983"
+.SH NAME
+getpid \- get process id
+.SH SYNOPSIS
+.B integer function getpid()
+.SH DESCRIPTION
+.I Getpid
+returns the process ID number of the current process.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+getpid(2)
diff --git a/usr/man/man3/getprotoent.3n b/usr/man/man3/getprotoent.3n
new file mode 100644 (file)
index 0000000..d725fec
--- /dev/null
@@ -0,0 +1,97 @@
+.TH GETPROTOENT 3N "9 February 1983"
+.UC 4.2
+.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 ,
+and
+.I getprotobynumber
+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
+struct protoent {
+       char    *p_name;        /* official name of protocol */
+       char    **p_aliases;    /* alias list */
+       long    p_proto;        /* protocol number */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'p_aliases'u+2n
+p_name
+The official name of the protocol.
+.TP \w'p_aliases'u+2n
+p_aliases
+A zero terminated list of alternate names for the protocol.
+.TP \w'p_aliases'u+2n
+p_proto
+The protocol number.
+.PP
+.I Getprotoent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Setprotoent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the net data base will not be closed after each call to 
+.I getprotoent
+(either directly, or indirectly through one of
+the other \*(lqgetproto\*(rq calls).
+.PP
+.I Endprotoent
+closes the file.
+.PP
+.I Getprotobyname
+and
+.I getprotobynumber
+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
+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
+protocols are currently understood.
diff --git a/usr/man/man3/getpw.3 b/usr/man/man3/getpw.3
new file mode 100644 (file)
index 0000000..d9e1f99
--- /dev/null
@@ -0,0 +1,27 @@
+.TH GETPW 3  deprecated "19 January 1983"
+.SH NAME
+getpw \- get name from uid
+.SH SYNOPSIS
+.nf
+.B getpw(uid, buf)
+.B char *buf;
+.fi
+.SH DESCRIPTION
+.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.
diff --git a/usr/man/man3/getpwent.3 b/usr/man/man3/getpwent.3
new file mode 100644 (file)
index 0000000..04ca062
--- /dev/null
@@ -0,0 +1,74 @@
+.TH GETPWENT 3  "19 January 1983"
+.SH NAME
+getpwent, getpwuid, getpwnam, setpwent, endpwent \- get password file entry
+.SH SYNOPSIS
+.nf
+.B #include <pwd.h>
+.PP
+.B struct passwd *getpwent()
+.PP
+.B struct passwd *getpwuid(uid)
+.B int uid;
+.PP
+.B struct passwd *getpwnam(name)
+.B char *name;
+.PP
+.B int setpwent()
+.PP
+.B int endpwent()
+.fi
+.SH DESCRIPTION
+.I Getpwent,
+.I getpwuid
+and
+.I getpwnam
+each return a pointer to an object with the
+following structure
+containing the broken-out
+fields of a line in the password file.
+.RS
+.PP
+.nf
+.so /usr/include/pwd.h
+.ft R
+.ad
+.fi
+.RE
+.PP
+The fields
+.I pw_quota
+and
+.I pw_comment
+are unused; the others have meanings described in
+.IR passwd (5).
+.PP
+.I Getpwent
+reads the next
+line (opening the file if necessary);
+.I setpwent
+rewinds the file;
+.I endpwent
+closes it.
+.PP
+.I Getpwuid
+and
+.I getpwnam
+search from the beginning until a matching
+.I uid
+or
+.I name
+is found
+(or until EOF is encountered).
+.SH FILES
+/etc/passwd
+.SH "SEE ALSO"
+getlogin(3), getgrent(3), passwd(5)
+.SH DIAGNOSTICS
+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.
+.br
diff --git a/usr/man/man3/gets.3s b/usr/man/man3/gets.3s
new file mode 100644 (file)
index 0000000..a9e4005
--- /dev/null
@@ -0,0 +1,64 @@
+.TH GETS 3S  "19 January 1983"
+.SH NAME
+gets, fgets \- get a string from a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B char *gets(s)
+.br
+.B char *s;
+.PP
+.B char *fgets(s, n, stream)
+.br
+.B char *s;
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Gets
+reads a string into
+.I s
+from the standard input stream
+.BR stdin .
+The string is terminated by a newline
+character, which is replaced in
+.I s
+by a null character.
+.I Gets
+returns its argument.
+.PP
+.I Fgets
+reads 
+.IR n \-1
+characters, or up to a newline
+character, whichever comes first,
+from the
+.I stream
+into the string
+.IR s .
+The last character read into
+.I s
+is followed by a null character.
+.I Fgets
+returns its first argument.
+.SH "SEE ALSO"
+puts(3),
+getc(3),
+scanf(3),
+fread(3),
+ferror(3)
+.SH DIAGNOSTICS
+.I Gets
+and
+.I fgets
+return the constant pointer 
+.SM
+.B NULL
+upon end of file or error.
+.SH BUGS
+.I Gets
+deletes a newline,
+.I fgets
+keeps it,
+all in the name of backward compatibility.
diff --git a/usr/man/man3/getservent.3n b/usr/man/man3/getservent.3n
new file mode 100644 (file)
index 0000000..8fd27b2
--- /dev/null
@@ -0,0 +1,105 @@
+.TH GETSERVENT 3N "9 February 1983"
+.UC 4.2
+.SH NAME
+getservent, getservbyport, getservbyname, setservent, endservent \- get protocol 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 ,
+and
+.I getservbyport
+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
+struct servent {
+       char    *s_name;        /* official name of service */
+       char    **s_aliases;    /* alias list */
+       long    s_port;         /* port service resides at */
+       char    *s_proto;       /* protocol to use */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w's_aliases'u+2n
+s_name
+The official name of the service.
+.TP \w's_aliases'u+2n
+A zero terminated list of alternate names for the service.
+.TP \w's_aliases'u+2n
+s_port
+The port number at which the service resides.
+Port numbers are returned in network byte order.
+.TP \w's_aliases'u+2n
+s_proto
+The name of the protocol to use when contacting the
+service.
+.PP
+.I Getservent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Setservent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the net data base will not be closed after each call to 
+.I getservent
+(either directly, or indirectly through one of
+the other \*(lqgetserv\*(rq calls).
+.PP
+.I Endservent
+closes the file.
+.PP
+.I Getservbyname
+and
+.I getservbyport
+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),
+searches must also match the protocol.
+.SH FILES
+/etc/services
+.SH "SEE ALSO"
+getprotoent(3N), services(5)
+.SH DIAGNOSTICS
+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
+quantity is probably naive.
diff --git a/usr/man/man3/getuid.3f b/usr/man/man3/getuid.3f
new file mode 100644 (file)
index 0000000..ecd2cdf
--- /dev/null
@@ -0,0 +1,15 @@
+.TH GETUID 3F "19 January 1983"
+.SH NAME
+getuid, getgid \- get user or group ID of the caller
+.SH SYNOPSIS
+.B integer function getuid()
+.sp 1
+.B integer function getgid()
+.SH DESCRIPTION
+These functions return the real user or group ID of the user
+of the process.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+getuid(2)
diff --git a/usr/man/man3/getwd.3 b/usr/man/man3/getwd.3
new file mode 100644 (file)
index 0000000..3e1d738
--- /dev/null
@@ -0,0 +1,24 @@
+.TH GETWD 3 "25 February 1983"
+.UC 4
+.SH NAME
+getwd \- get current working directory pathname
+.SH SYNOPSIS
+.nf
+.B char *getwd(pathname)
+.B char *pathname;
+.fi
+.SH DESCRIPTION
+.I Getwd
+copies the absolute pathname of the current working directory to
+.I pathname
+and returns a pointer to the result.
+.SH LIMITATIONS
+Maximum pathname length is MAXPATHLEN characters (1024).
+.SH DIAGNOSTICS
+.I Getwd
+returns zero and places a message in
+.I pathname
+if an error occurs.
+.SH BUGS
+.I Getwd
+may fail to return to the current directory if an error occurs.
diff --git a/usr/man/man3/hypot.3m b/usr/man/man3/hypot.3m
new file mode 100644 (file)
index 0000000..f2e9104
--- /dev/null
@@ -0,0 +1,26 @@
+.TH HYPOT 3M  "19 January 1983"
+.SH NAME
+hypot, cabs \- Euclidean distance
+.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
+.I Hypot
+and
+.I cabs
+return
+.PP
+.IP
+sqrt(x*x + y*y),
+.LP
+taking precautions against unwarranted overflows.
+.SH SEE ALSO
+exp(3) for
+.I sqrt
diff --git a/usr/man/man3/idate.3f b/usr/man/man3/idate.3f
new file mode 100644 (file)
index 0000000..bf8cd27
--- /dev/null
@@ -0,0 +1,27 @@
+.TH IDATE 3F "19 January 1983"
+.SH NAME
+idate, itime \- return date or time in numerical form
+.SH SYNOPSIS
+.B subroutine idate (iarray)
+.br
+.B integer iarray(3)
+.sp 1
+.B subroutine itime (iarray)
+.br
+.B integer iarray(3)
+.SH DESCRIPTION
+.I Idate
+returns the current date in
+.I iarray.
+The order is: day, mon, year.
+Month will be in the range 1-12. Year will be \(>= 1969.
+.PP
+.I Itime
+returns the current time in
+.I iarray.
+The order is: hour, minute, second.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+ctime(3F), fdate(3F)
diff --git a/usr/man/man3/index.3f b/usr/man/man3/index.3f
new file mode 100644 (file)
index 0000000..6b6f65b
--- /dev/null
@@ -0,0 +1,42 @@
+.TH INDEX 3F "19 January 1983"
+.SH NAME
+index, rindex, lnblnk, len \- tell about character objects
+.SH SYNOPSIS
+.B (intrinsic) function index (string, substr)
+.br
+.B character*(*) string, substr
+.sp 1
+.B integer function rindex (string, substr)
+.br
+.B character*(*) string, substr
+.sp 1
+.B function lnblnk (string)
+.br
+.B character*(*) string
+.sp 1
+.B (intrinsic) function len (string)
+.br
+.B character*(*) string
+.SH DESCRIPTION
+.I Index
+.I (rindex)
+returns the index of the first (last) occurrence of the substring
+.I substr
+in
+.I string,
+or zero if it does not occur.
+.I Index
+is an f77 intrinsic function;
+.I rindex
+is a library routine.
+.PP
+.I Lnblnk
+returns the index of the last non-blank character in
+.I string.
+This is useful since all f77 character objects are fixed length, blank padded.
+Intrinsic function
+.I len
+returns the size of the character object argument.
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
diff --git a/usr/man/man3/inet.3n b/usr/man/man3/inet.3n
new file mode 100644 (file)
index 0000000..8ca78bc
--- /dev/null
@@ -0,0 +1,112 @@
+.TH INET 3N "9 February 1983"
+.UC 4.2
+.SH NAME
+inet_addr, inet_network, inet_makeaddr, inet_lnaof, inet_netof \- Internet address manipulation routines
+.SH SYNOPSIS
+.B "#include <sys/socket.h>
+.br
+.B "#include <netinet/in.h>
+.PP
+.B "struct in_addr
+.B "inet_addr(cp)
+.br
+.B "char *cp;
+.PP
+.B "int
+.B "inet_network(cp)
+.br
+.B "char *cp;
+.PP
+.B "struct in_addr
+.B "inet_makeaddr(net, lna)
+.br
+.B "int net, lna;
+.PP
+.B "int
+.B "inet_lnaof(in)
+.br
+.B "struct in_addr in;
+.PP
+.B "int
+.B "inet_netof(in)
+.br
+.B "struct in_addr in;
+.SH DESCRIPTION
+The routines
+.I inet_addr
+and
+.I inet_network
+each interpret character strings representing
+numbers expressed in the Internet standard \*(lq.\*(rq
+notation, returning numbers suitable for use
+as Internet addresses and Internet network
+numbers, respectively.  The routine
+.I inet_makeaddr
+takes an Internet network number and a local
+network address and constructs an Internet address
+from it.  The routines
+.I inet_netof
+and
+.I inet_lnaof
+break apart Internet host addresses, returning
+the network number and local network address part,
+respectively.
+.PP
+All Internet address 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
+of the following forms:
+.RS
+.nf
+a.b.c.d
+a.b.c
+a.b
+a
+.RE
+.fi
+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
+ordered from right to left.
+.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
+\*(lq128.net.host\*(rq.
+.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
+\*(lqnet.host\*(rq.
+.PP
+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
+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"
+gethostent(3N), getnetent(3N), hosts(5), networks(5),
+.SH DIAGNOSTICS
+The value \-1 is returned by
+.I inet_addr
+and
+.I inet_network
+for malformed requests.
+.SH BUGS
+The problem of host byte ordering versus network byte ordering is
+confusing.  A simple way to specify Class C network addresses in a manner
+similar to that for Class B and Class A is needed.
diff --git a/usr/man/man3/initgroups.3 b/usr/man/man3/initgroups.3
new file mode 100644 (file)
index 0000000..4cb1e15
--- /dev/null
@@ -0,0 +1,40 @@
+.TH INITGROUPS 3X "25 February 1983"
+.UC
+.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
+reads through the group file and sets up,
+using the
+.IR setgroups (2)
+call, the group access list for the user
+specified in
+.IR name .
+The
+.I basegid
+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
+returns -1 if it was not invoked by the super-user.
+.SH BUGS
+.I Initgroups
+uses the routines based on
+.IR getgrent (3).
+If the invoking program uses any of these routines,
+the group structure will
+be overwritten in the call to
+.IR initgroups .
+.LP
+No one ever keeps /etc/group up to date anyway.
diff --git a/usr/man/man3/intro.3f b/usr/man/man3/intro.3f
new file mode 100644 (file)
index 0000000..d460449
--- /dev/null
@@ -0,0 +1,90 @@
+.TH INTRO 3F "19 January 1983"
+.SH NAME
+intro \- introduction to FORTRAN library functions
+.SH DESCRIPTION
+.LP
+This section describes those functions that are in the FORTRAN run time
+library.  The functions listed here provide an interface from \fIf77\fP
+programs to the system in the same manner as the C library does for C
+programs.  They are automatically loaded as needed by the Fortran compiler
+.IR f77 (1).
+The link editor searches this library under the `\-lm' option.
+Declarations for these functions may be obtained from the include file <math.h>.
+.sp 2
+.ce
+\fIFunctions Available in the FORTRAN Library\fP
+.sp
+.nf
+.ta 0.4i 2.5i
+abort          terminate abruptly with memory image
+access         determine accessability of a file
+alarm          execute a subroutine after a specified time
+bessel functions               of two kinds for integer orders
+bis            bit set, clear, test routines
+       bic     bit set, clear, test routines (see bis.3f)
+       setbit  bit set, clear, test routines (see bis.3f)
+       bit     bit set, clear, test routines (see bis.3f)
+and            bitwise functions
+       or      bitwise or (see and.3f)
+       xor     bitwise xor (see and.3f)
+       not     bitwise not (see and.3f)
+rshift         right shift
+       lshift  left shift (see rshift.3f)
+chdir          change default directory
+etime          return elapsed execution time
+       dtime   return elapsed execution time (see etime.3f)
+exit           terminate process with status
+fdate          return date and time in an ASCII string
+flush          flush output to a logical unit
+fork           create a copy of this process
+fseek          reposition a file on a logical unit
+       ftell   determine position of file on logical unit (see fseek.3f)
+getarg         command arguments to Fortran
+       iargc   command arguments to Fortran (see getarg.3f)
+getc           get a character from a logical unit
+       fgetc   get a character from a logical unit (see getc.3f)
+getcwd         get pathname of current working directory
+getenv         get value of environment variables
+getlog         get user's login name
+getpid         get process id
+getuid         get user ID of the caller
+       getgid  get group ID of the caller (see getuid.3f)
+idate          return date in numerical form
+       itime   return time in numerical form (see idate.3f)
+index          tell about character objects
+       rindex  tell about character objects (see index.3f)
+       lnblnk  tell about character objects (see index.3f)
+       len     tell about character objects (see index.3f)
+kill           send a signal to a process
+link           make a link to an existing file
+loc            return the address of an object
+perror         get system error messages
+       gerror  get system error messages (see perror.3f)
+       ierrno  get system error messages (see perror.3f)
+putc           write a character to a fortran logical unit
+       fputc   write a character to a fortran logical unit (see putc.3f)
+qsort          quick sort
+rand           return random values
+       drand   return random values (see rand.3f)
+       irand   return random values (see rand.3f)
+flmin          return extreme values
+       flmax   return extreme values (see flmin.3f)
+       dflmin  return extreme values (see flmin.3f)
+       dflmax  return extreme values (see flmin.3f)
+       inmax   return extreme values (see flmin.3f)
+signal         change the action for a signal
+sleep          sleep for awhile
+stat           get file status
+       fstat   get file status (see stat.3f)
+system         execute a unix command
+time           return system time
+       ctime   return system time (see time.3f)
+       ltime   return system time (see time.3f)
+       gmtime  return system time (see time.3f)
+traper         trap arithmetic errors
+trapov         trap and repair floating point overflow
+ttynam         find name of a terminal port
+       isatty  find name of a terminal port (see ttynam.3f)
+unlink         remove a directory entry
+wait           wait for a process to terminate
+.fi
diff --git a/usr/man/man3/intro.3j b/usr/man/man3/intro.3j
new file mode 100644 (file)
index 0000000..5cb9576
--- /dev/null
@@ -0,0 +1,347 @@
+.TH INTRO 3J "19 January 1983"
+.UC 4
+.SH NAME
+intro \- summary of job control facilities
+.SH SYNOPSIS
+.nf
+.B #include <sys/ioctl.h>
+.B #include <signal.h>
+.B #include <resource.h>
+.B #include <wait.h>
+.PP
+.B int fildes, signo;
+.B short pid, pgrp;
+.B union wait status;
+.B struct resource res;
+.PP
+.B ioctl(fildes, TIOCSPGRP, &pgrp)
+.B ioctl(fildes, TIOCGPGRP, &pgrp)
+.PP
+.B sigset(signo, action)
+.B sighold(signo)
+.B sigrelse(signo)
+.B sigpause(signo)
+.B sigsys(signo, action)
+.PP
+.B wait3(&status, options, &res)
+.PP
+.B cc ... \-ljobs
+.fi
+.SH DESCRIPTION
+The facilities described here are used to support the job control implemented
+in
+.IR csh (1),
+and may be used in other programs to provide similar facilities.
+Because these facilities are not standard in UNIX and because the
+signal mechanisms are also slightly different, the associated
+routines are not in the standard C library, but rather in the \fB\-ljobs\fR
+library.
+.PP
+For descriptions of the individual routines see the various sections listed
+in \s-2SEE ALSO\s0 below.  This section attempt only to place these facilities
+in context, not to explain the semantics of the individual calls.
+.PP
+.B "Terminal arbitration mechanisms."
+.PP
+The job control mechanism works by associating with each process a number
+called a
+.I "process group";
+related processes (e.g. in a pipeline) are given the same process group.
+The system assigns a single process group number to each terminal.
+Processes running on a terminal are given read access to that terminal
+only if they are in the same process group as that terminal.
+.PP
+Thus a command interpreter may start several jobs running in different
+process groups and arbitrate access to the terminal by controlling which,
+if any, of these processes is in the same process group as the terminal.
+When a process which is not
+in the process group of the terminal tries to read from the terminal,
+all members of the process group of the process receive a SIGTTIN signal,
+which normally then causes them to stop until they are continued
+with a SIGCONT signal.
+(See
+.IR sigsys (2)
+for a description of these signals;
+.IR tty (4)
+for a description of process groups.)
+.PP
+If a process which is not in the process group of the terminal
+attempts to change the terminals mode,
+the process group of that process is sent a SIGTTOU signal, causing
+the process group to stop.
+A similar mechanism is (optionally) available for output, causing
+processes to block with SIGTTOU when they attempt to write to the terminal
+while not in its process group;
+this is controlled by the LTOSTOP bit in the tty mode
+word, enabled by \*(lqstty tostop\*(rq and disabled (the default)
+by \*(lqstty \-tostop.\*(rq
+(The LTOSTOP bit is described in
+.IR tty (4)).
+.LP
+.B "How the shell manipulates process groups."
+.PP
+A shell which is interactive first establishes its own process group
+and a process group for the terminal; this prevents other processes
+from being inadvertantly stopped while the terminal is under its control.
+The shell then assigns each job it creates a distinct process group.
+When a job is to be run in the foreground,
+the shell gives the terminal to the process group of the job using
+the TIOCSPGRP ioctl
+(See
+.IR ioctl (2)
+and
+.IR tty (4)).
+When a job stops or completes, the shell reclaims the terminal
+by resetting the terminals process group to that of the shell using
+TIOCSPGRP again.
+.PP
+Shells which are running shell scripts or running non-interactively do
+not manipulate process groups of jobs they create.  Instead, they
+leave the process group of sub-processes and the terminal unchanged.
+This assures that if any sub-process they create blocks for terminal i/o,
+the shell and all its sub-processes will be blocked
+(since they are a single process group).
+The first interactive parent of the non-interactive shell
+can then be used to deal with the stoppage.
+.PP
+Processes which are orphans (whose parents have exited), and descendants
+of these processes are protected by the system from stopping, since there
+can be no interactive parent.  Rather than blocking, reads from the
+control terminal return end-of-file and writes to the control
+terminal are permitted (i.e. LTOSTOP has no effect for these processes.)
+Similarly processes which ignore or hold the SIGTTIN or SIGTTOU signal are not
+sent these signals when accessing their control terminal; if they are not in the
+process group of the control terminal reads simply return end-of-file.
+Output and mode setting are also allowed.
+.PP
+Before a shell
+.I suspends
+itself, it places itself back in the process group in which it was
+created, and then sends this original group a stopping signal, stopping
+the shell and any other intermediate processes back to an interactive parent.
+The shell also restores the process group of the terminal when it finishes,
+as the process which then resumes would not necessarily be in control of
+the terminal otherwise.
+.PP
+.B "Naive processes."
+.PP
+A process which does not alter the state of the terminal,
+and which does no job control can invoke subprocesses normally
+without worry.  If such a process issues a
+.IR system (3)
+call and this command is then stopped, both of the processes will stop
+together.  Thus simple processes need not worry about job control, even
+if they have \*(lqshell escapes\*(rq or invoke other processes.
+.PP
+.B "Processes which modify the terminal state."
+.PP
+When first setting the terminal into an unusual mode, the process
+should check, with the stopping signals held,
+that it is in the foreground.  It should then change the state of the
+terminal, and set the catches for SIGTTIN, SIGTTOU and SIGTSTP.
+The following is a sample of the code that will be needed, assuming
+that unit 2 is known to be a terminal.
+.PP
+.nf
+.ft B
+       short   tpgrp;
+       \&...
+
+retry:
+       sigset(SIGTSTP, SIG_HOLD);
+       sigset(SIGTTIN, SIG_HOLD);
+       sigset(SIGTTOU, SIG_HOLD);
+       if (ioctl(2, TIOCGPGRP, &tpgrp) != 0)
+               goto nottty;
+       if (tpgrp != getpgrp(0)) { /* not in foreground */
+               sigset(SIGTTOU, SIG_DFL);
+               kill(0, SIGTTOU);
+               /* job stops here waiting for SIGCONT */
+               goto retry;
+       }
+       \fI\&...save old terminal modes and set new modes\&...\fB
+       sigset(SIGTTIN, onstop);
+       sigset(SIGTTOU, onstop);
+       sigset(SIGTSTP, onstop);
+.ft R
+.fi
+.PP
+It is necessary to ignore SIGTSTP in this code because otherwise our process
+could be moved from the foreground to the background in the middle of checking
+if it is in the foreground.
+The process holds all the stopping signals in this critical section so no other
+process in our process group can mess us up by blocking us on one of these
+signals in the middle of our check.
+(This code assumes that the command interpreter will not move a process from
+foreground to background without stopping it; if it did we would have
+no way of making the check correctly.)
+.PP
+The routine which handles the signal should clear the catch for the stop
+signal and
+.IR kill (2)
+the processes in its process group with the same signal.  The statement
+after this
+.I kill
+will be executed when the process is later continued with SIGCONT.
+.PP
+Thus the code for the catch routine might look like:
+.PP
+.ft B
+.nf
+       \&...
+       sigset(SIGTSTP, onstop);
+       sigset(SIGTTIN, onstop);
+       sigset(SIGTTOU, onstop);
+       \&...
+
+onstop(signo)
+       int signo;
+{
+       \fI... restore old terminal state ...\fB
+       sigset(signo, SIG_DFL);
+       kill(0, signo);
+       /* stop here until continued */
+       sigset(signo, onstop);
+       \fI... restore our special terminal state ...\fB
+}
+.fi
+.ft R
+.PP
+This routine can also be used to simulate a stop signal.
+.PP
+If a process does not need to save and restore state when it is stopped,
+but wishes to be notified when it is continued after a stop it can catch
+the SIGCONT signal; the SIGCONT handler will be run when the process
+is continued.
+.PP
+Processes which lock data bases such as the password file should ignore
+SIGTTIN, SIGTTOU, and SIGTSTP signals while the data bases are being
+manipulated.  While a process is ignoring SIGTTIN signals, reads which
+would normally have hung will return end-of-file; writes which would
+normally have caused SIGTTOU signals are instead permitted while SIGTTOU
+is ignored.
+.PP
+.B "Interrupt-level process handling."
+.PP
+Using the mechanisms of
+.IR sigset (3J)
+it is possible to handle process state changes as they occur by providing
+an interrupt-handling routine for the SIGCHLD signal which occurs
+whenever the status of a child process changes.  A signal handler for this
+signal is established by:
+.PP
+.RS
+.B "sigset(SIGCHLD, onchild);"
+.RE
+.LP
+The shell or other process would then await a change in child status
+with code of the form:
+.PP
+.nf
+.ft B
+recheck:
+       sighold(SIGCHLD);               /* start critical section */
+       if (\fIno children to process\fB) {
+               sigpause(SIGCHLD);      /* release SIGCHLD and pause */
+               goto recheck;
+       }
+       sigrelse(SIGCHLD);              /* end critical region */
+       /* now have a child to process */
+.fi
+.ft R
+.PP
+Here we are using
+.IR sighold
+to temporarily block the SIGCHLD signal during the checking of the
+data structures telling us whether we have a child to process.
+If we didn't block the signal we would have a race condition since the
+signal might corrupt our decision by arriving shortly after we had
+finished checking the condition but before we paused.
+.PP
+If we need to wait for something to happen, we call
+.I sigpause
+which automically releases the hold on the SIGCHLD signal and waits for a
+signal to occur by starting a
+.IR pause (2).
+Otherwise we simply release the SIGCHLD signal and process the child.
+.I Sigpause
+is similar to the PDP-11
+.I wait
+instruction, which returns the priority of the processor to the base
+level and idles waiting for an interrupt.
+.PP
+It is important to note that the long-standing bug in the signal mechanism
+which would have lost a SIGCHLD signal which occurred while the signal
+was blocked has been fixed.  This is because
+.I sighold
+uses the SIG_HOLD signal set of
+.IR sigsys (2)
+to prevent the signal action from being taken without losing the signal
+if it occurs.  Similarly, a signal action set with
+.I sigset
+has the signal held while the action routine is running,
+much as a the interrupt priority of the processor is raised when
+a device interrupt is taken.
+.PP
+In this interrupt driven style of termination processing it is necessary
+that the
+.I wait
+calls used to retrieve status in the SIGCHLD signal handler not block.
+This is because a single invocation of the SIGCHLD handler may indicate
+an arbitrary number of process status changes: signals are not queued.
+This is similar to the case in a disk driver where several drives on
+a single controller may report status at once, while there is only
+one interrupt taken.
+It is even possible for no children to be ready to report status when
+the SIGCHLD handler is invoked, if the signal was posted while the SIGCHLD
+handler was active, and the child was noticed due to a SIGCHLD initially
+sent for another process.
+This causes no problem, since the handler will be called whenever there
+is work to do; the handler just has to collect all information by calling
+.I wait3
+until it says no more information is available.
+Further status changes are guaranteed to be reflected in another SIGCHLD
+handler call.
+.PP
+.B Restarting system calls.
+.PP
+In older versions of UNIX \*(lqslow\*(rq system calls
+were interrupted when signals occurred, returning EINTR.
+The new signal mechanism
+.IR sigset (3)
+normally restarts such calls rather than interrupting them.
+To summarize:
+.I pause
+and
+.I wait
+return error EINTR (as before),
+.I ioctl
+and
+.I wait3
+restart, and
+.I read
+and
+.I write
+restart unless some data was read or written in which case they
+return indicating how much data was read or written.
+In programs which use the older
+.IR signal (2)
+mechanisms, all of these calls return EINTR
+if a signal occurs during the call.
+.SH SEE ALSO
+csh(1),
+ioctl(2),
+killpg(2),
+setpgrp(2),
+sigsys(2),
+wait3(2),
+signal(2),
+psignal(3),
+tty(4)
+.SH BUGS
+The job control facilities are not available in standard version 7 UNIX.
+These facilities are still under development and may change in future
+releases of the system as better inter-process communication facilities
+and support for virtual terminals become available.  The options and
+specifications of these system calls and even the calls themselves
+are thus subject to change.
diff --git a/usr/man/man3/intro.3m b/usr/man/man3/intro.3m
new file mode 100644 (file)
index 0000000..0eb8b99
--- /dev/null
@@ -0,0 +1,38 @@
+.TH INTRO 3M "19 January 1983"
+.SH NAME
+intro \- introduction to mathematical library functions
+.SH DESCRIPTION
+These functions constitute the math library,
+.I libm.
+They are automatically loaded as needed by the Fortran compiler
+.IR f77 (1).
+The link editor searches this library under the \*(lq\-lm\*(rq option.
+Declarations for these functions may be obtained from the include file
+.RI < math.h >.
+.SH "LIST OF FUNCTIONS"
+.sp
+.ta 0.3i 2.5i
+.nf
+exp            exponential
+       log     natural logarithm (see exp.3m)
+       log10   logarithm to base 10 (see exp.3m)
+       pow     power (see exp.3m)
+       sqrt    square root (see exp.3m)
+fabs   absolute value
+       floor   floor (see fabs.3m)
+       ceil    ceiling (see fabs.3m)
+gamma          log gamma function
+hypot          Euclidean distance
+       cabs    Euclidean distance (see hypot.3m)
+j0, j1, jn, y0, y1, yn         bessel functions
+sin            trigonometric sine
+       cos     trigonometric cosine  (see sin.3m)
+       tan     trigonometric tangent  (see sin.3m)
+       asin    trigonometric arcsine  (see sin.3m)
+       acos    trigonometric arccosine  (see sin.3m)
+       atan    trigonometric arctangent  (see sin.3m)
+       atan2   trigonometric arctangent  (see sin.3m)
+sinh           hyperbolic sine
+       cosh    hyperbolic cosine  (see sinh.3m)
+       tanh    hyperbolic tangent  (see sinh.3m)
+.fi
diff --git a/usr/man/man3/intro.3s b/usr/man/man3/intro.3s
new file mode 100644 (file)
index 0000000..d9858a2
--- /dev/null
@@ -0,0 +1,188 @@
+.TH INTRO 3S  "19 January 1983"
+.UC 4
+.SH NAME
+stdio \- standard buffered input/output package
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.SM
+.B FILE
+.B *stdin;
+.br
+.SM
+.B FILE
+.B *stdout;
+.br
+.SM
+.B FILE
+.B *stderr;
+.SH DESCRIPTION
+The functions described in section 3S constitute a user-level buffering
+scheme.  The in-line macros
+.I getc
+and
+.IR  putc (3S)
+handle characters quickly.  The higher level routines
+.IR gets ,
+.IR fgets ,
+.IR scanf ,
+.IR fscanf ,
+.IR fread ,
+.IR puts ,
+.IR fputs ,
+.IR printf ,
+.IR fprintf ,
+.IR fwrite
+all use
+.I getc
+and
+.IR putc ;
+they can be freely intermixed.
+.PP
+A file with associated buffering is called a
+.I stream,
+and is declared to be a pointer to a defined type
+.SM
+.B FILE.
+.IR  Fopen (3S)
+creates certain descriptive data for a stream
+and returns a pointer to designate the stream in all further transactions.
+There are three normally open streams with constant pointers declared in
+the include file and associated with the standard open files:
+.TP 10n
+.BR stdin
+standard input file
+.br
+.ns
+.TP
+.B stdout
+standard output file
+.br
+.ns
+.TP
+.BR stderr
+standard error file
+.PP
+A constant `pointer'
+.SM
+.B NULL
+(0)
+designates no stream at all.
+.PP
+An integer constant
+.SM
+.B EOF
+(\-1) is returned upon end of file or error by integer functions that
+deal with streams.
+.PP
+Any routine that uses the standard input/output package
+must include the header file
+.RI < stdio.h >
+of pertinent macro definitions.
+The functions and constants mentioned in sections labeled 3S
+are declared in the include file and need no further declaration.
+The constants, and the following `functions' are
+implemented as macros; redeclaration of these names is perilous:
+.IR getc ,
+.IR getchar ,
+.IR putc ,
+.IR putchar ,
+.IR feof ,
+.IR ferror ,
+.IR fileno .
+.SH "SEE ALSO"
+open(2), close(2), read(2), write(2), fread(3S), fseek(3S), f*(3S)
+.SH DIAGNOSTICS
+The value
+.SM
+.B EOF
+is returned uniformly to indicate that a
+.SM
+.B FILE
+pointer has not been initialized with
+.I fopen,
+input (output) has been attempted on an output (input) stream, or a
+.SM
+.B FILE
+pointer designates corrupt or otherwise unintelligible
+.SM
+.B FILE
+data.
+.PP
+For purposes of efficiency, this implementation of the standard library
+has been changed to line buffer output to a terminal by default and attempts
+to do this transparently by flushing the output whenever a 
+.IR read (2)
+from the standard input is necessary.  This is almost always transparent,
+but may cause confusion or malfunctioning of programs which use
+standard i/o routines but use
+.IR read (2)
+themselves to read from the standard input.
+.PP
+In cases where a large amount of computation is done after printing
+part of a line on an output terminal, it is necessary to
+.IR fflush (3S)
+the standard output before going off and computing so that the output
+will appear.
+.SH BUGS
+The standard buffered functions do not interact well with certain other
+library and system functions, especially \fIvfork\fP and \fIabort\fP.
+.LP
+.sp 2
+.ce
+\fIFunctions Available in the Standard I/O Library\fP
+.sp
+.ta 0.4i 2.5i
+.nf
+fclose         close a stream
+       fflush  flush a stream (see fclose.3s)
+.sp
+feof           stream status inquiries
+       ferror  stream status inquiries (see ferror.3s)
+       clearerr        stream status inquiries (see ferror.3s)
+       fileno  stream status inquiries (see ferror.3s)
+.sp
+fopen          open a stream
+       freopen reopen a stream (see fopen.3s)
+       fdopen  open a stream (see fopen.3s)
+.sp
+fread          buffered binary input/output
+       fwrite  buffered binary input/output (see fread.3s)
+.sp
+fseek          reposition a stream
+       ftell   obtain position of a stream (see fseek.3s)
+       rewind  rewind a stream (see fseek.3s)
+.sp
+getc           get character from stream
+       getchar get character from stream (see getc.3s)
+       fgetc   get character from stream (see getc.3s)
+       getw    get word from stream (see getc.3s)
+.sp
+gets           get a string from a stream
+       fgets   get a string from a stream (see gets.3s)
+.sp
+popen          initiate I/O to/from a process
+       pclose  terminate I/O to/from a process (see popen.3s)
+.sp
+printf         formatted output conversion
+       fprintf formatted output conversion (see printf.3s)
+       sprintf formatted output conversion (see printf.3s)
+.sp
+putc           put character on a stream
+       putchar put character on a stream (see putc.3s)
+       fputc   put character on a stream (see putc.3s)
+       putw    put word on a stream (see putc.3s)
+.sp
+puts           put a string on a stream
+       fputs   put a string on a stream (see puts.3s)
+.sp
+scanf          formatted input conversion
+       fscanf  formatted input conversion (see scanf.3s)
+       sscanf  formatted input conversion (see scanf.3s)
+.sp
+setbuf         assign buffering to a stream
+       setbuffer       assign buffering to a stream (see setbuf.3s)
+.sp
+stdio          standard buffered input/output package
+ungetc         push character back into input stream
+.fi
diff --git a/usr/man/man3/j0.3m b/usr/man/man3/j0.3m
new file mode 100644 (file)
index 0000000..2a0b8df
--- /dev/null
@@ -0,0 +1,36 @@
+.TH J0 3M  "19 January 1983"
+.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 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 double x;
+.fi
+.SH DESCRIPTION
+These functions calculate Bessel functions of the first
+and second kinds for real arguments and integer orders.
+.SH DIAGNOSTICS
+Negative arguments cause
+.I y0, y1,
+and
+.I yn
+to return a huge negative value and set
+.I errno
+to EDOM.
diff --git a/usr/man/man3/kill.3f b/usr/man/man3/kill.3f
new file mode 100644 (file)
index 0000000..669a552
--- /dev/null
@@ -0,0 +1,18 @@
+.TH KILL 3F "19 January 1983"
+.SH NAME
+kill \- send a signal to a process
+.SH SYNOPSIS
+.B function kill (pid, signum)
+.br
+.B integer pid, signum
+.SH DESCRIPTION
+.I Pid
+must be the process id of one of the user's processes.
+.I Signum
+must be a valid signal number (see signal(2)).
+The returned value will be 0 if successful; an error code otherwise.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+kill(2), signal(2), signal(3F), fork(3F), perror(3F)
diff --git a/usr/man/man3/link.3f b/usr/man/man3/link.3f
new file mode 100644 (file)
index 0000000..8332077
--- /dev/null
@@ -0,0 +1,23 @@
+.TH LINK 3F "19 January 1983"
+.SH NAME
+link \- make a link to an existing file
+.SH SYNOPSIS
+.B function link (name1, name2)
+.br
+.B character*(*) name1, name2
+.SH DESCRIPTION
+.I Name1
+must be the pathname of an existing file.
+.I Name2
+is a pathname to be linked to file
+.I name1.
+.I Name2
+must not already exist.
+The returned value will be 0 if successful; a system error code otherwise.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+link(2), perror(3F), unlink(3F)
+.SH BUGS
+Pathnames can be no longer than 127 characters.
diff --git a/usr/man/man3/loc.3f b/usr/man/man3/loc.3f
new file mode 100644 (file)
index 0000000..bab4c46
--- /dev/null
@@ -0,0 +1,11 @@
+.TH LOC 3F "19 January 1983"
+.SH NAME
+loc \- return the address of an object
+.SH SYNOPSIS
+.B function loc (arg)
+.SH DESCRIPTION
+The returned value will be the address of
+.I arg.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
diff --git a/usr/man/man3/malloc.3 b/usr/man/man3/malloc.3
new file mode 100644 (file)
index 0000000..ed17438
--- /dev/null
@@ -0,0 +1,107 @@
+.TH MALLOC 3  "19 January 1983"
+.UC 4
+.SH NAME
+malloc, free, realloc, calloc \- main 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;
+.fi
+.SH DESCRIPTION
+.I Malloc
+and
+.I free
+provide a simple 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
+allocates the first big enough contiguous reach of free space
+found in a circular search from the last block allocated or freed,
+coalescing adjacent free blocks as it searches.
+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.
+.PP
+.I Realloc
+also works if
+.I ptr
+points to a block freed since the last call of
+.I malloc, realloc
+or
+.IR calloc ;
+thus sequences of
+.I free, malloc
+and
+.I realloc
+can exploit the search strategy of
+.I malloc
+to do storage compaction.
+.PP
+.I Calloc
+allocates space for an array of
+.I nelem
+elements of size
+.I elsize.
+The space is initialized to zeros.
+.PP
+Each of the allocation routines returns a pointer
+to space suitably aligned (after possible pointer coercion)
+for storage of any type of object.
+.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
+The current incarnation of the allocator is unsuitable for direct use in
+a large virtual environment where many small blocks are to be kept, since
+it keeps all allocated and freed blocks on a single circular list.  Just
+before more memory is allocated, all allocated and freed blocks are
+referenced; this can cause a huge number of page faults.
diff --git a/usr/man/man3/mktemp.3 b/usr/man/man3/mktemp.3
new file mode 100644 (file)
index 0000000..5c82ad0
--- /dev/null
@@ -0,0 +1,19 @@
+.TH MKTEMP 3  "19 January 1983"
+.SH NAME
+mktemp \- make a unique file name
+.SH SYNOPSIS
+.nf
+.B char *mktemp(template)
+.B char *template;
+.fi
+.SH DESCRIPTION
+.I Mktemp
+replaces
+.I template
+by a unique file name, and returns the
+address of the template.
+The template should look like a file name with six trailing
+X's, which will be replaced with the
+current process id and a unique letter.
+.SH "SEE ALSO"
+getpid(2)
diff --git a/usr/man/man3/monitor.3 b/usr/man/man3/monitor.3
new file mode 100644 (file)
index 0000000..518d0d5
--- /dev/null
@@ -0,0 +1,111 @@
+.TH MONITOR 3  "19 January 1983"
+.SH NAME
+monitor, monstartup \- prepare execution profile
+.SH SYNOPSIS
+.nf
+.B monitor(lowpc, highpc, buffer, bufsize, nfunc)
+.B int (*lowpc)(), (*highpc)();
+.B short buffer[];
+
+.B monstartup(lowpc, highpc)
+.B int (*lowpc)(), (*highpc)();
+.fi
+.SH DESCRIPTION
+There are two different forms of monitoring available:
+An executable program created by:
+.IP  "cc \-p . . ."
+.LP
+automatically includes calls for
+.I monstartup
+with default parameters;
+.I monitor
+need not be called explicitly except to gain fine control over profiling.
+An executable program created by:
+.IP  "cc \-pg . . ."
+.LP
+obtains a different monitor.
+.PP
+.I Monstartup
+is a high level interface to
+.IR profil (2).
+.I Lowpc
+and
+.I highpc
+specify the address range that is to be sampled; the lowest address sampled
+is that of
+.I lowpc
+and the highest is just below
+.IR highpc .
+.I Monstartup
+allocates space using 
+.IR sbrk (2)
+and passes it to
+.I monitor
+(see below) to record a histogram of periodically sampled values of
+the program counter, and of counts of calls of certain functions, in the buffer.
+Only calls of functions compiled with the profiling option
+.B \-p
+of
+.IR cc (1)
+are recorded.
+.PP
+To profile the entire program, it is sufficient to use
+.PP
+.nf
+       extern etext();
+       . . .
+       monstartup((int) 2, etext);
+.fi
+.PP
+.I Etext
+lies just above all the program text, see
+.IR end (3).
+.PP
+To stop execution monitoring and write the results on the file
+.I mon.out,
+use
+.PP
+       monitor(0);
+.LP
+then
+.IR prof (1)
+can be used to examine the results.
+.PP
+.I Monitor
+is a low level interface to
+.IR profil (2).
+.I Lowpc
+and
+.I highpc
+are the addresses of two functions;
+.I buffer
+is the address of a (user supplied) array of
+.I bufsize
+short integers.  At most
+.I nfunc
+call counts can be kept.
+For the results to be significant, especially where there are small, heavily
+used routines, it is suggested that the buffer be no more
+than a few times smaller than the range of locations sampled.
+.I Monitor
+divides the buffer into space to record the histogram
+of program counter samples over the range
+.I lowpc
+to
+.IR highpc ,
+and space to record call counts of functions compiled with the 
+.B \-p
+option to
+.IR cc (1).
+.PP
+To profile the entire program, it is sufficient to use
+.PP
+.nf
+       extern etext();
+       . . .
+       monitor((int) 2, etext, buf, bufsize, nfunc);
+.fi
+.SH FILES
+mon.out
+.SH "SEE ALSO"
+cc(1), prof(1), gprof(1), profil(2), sbrk(2)
diff --git a/usr/man/man3/nlist.3 b/usr/man/man3/nlist.3
new file mode 100644 (file)
index 0000000..61f0ca0
--- /dev/null
@@ -0,0 +1,44 @@
+.TH NLIST 3  "19 January 1983"
+.UC 4
+.SH NAME
+nlist \- get entries from name list
+.SH SYNOPSIS
+.nf
+.B #include <nlist.h>
+.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
+All type entries are set to 0 if the file cannot be found
+or if it is not a valid namelist.
+.SH BUGS
+On other versions of UNIX you must include
+.RI < a.out.h >
+rather than
+.RI < nlist.h >;
+this is unfortunate, but
+.RI < a.out.h >
+can't be used on the Sun system because it contains a
+.B union
+which can't be initialized.
diff --git a/usr/man/man3/perror.3 b/usr/man/man3/perror.3
new file mode 100644 (file)
index 0000000..bf00391
--- /dev/null
@@ -0,0 +1,41 @@
+.TH PERROR 3  "19 January 1983"
+.SH NAME
+perror, sys_errlist, sys_nerr \- system error messages
+.SH SYNOPSIS
+.nf
+.B perror(s)
+.B char *s;
+.PP
+.B int sys_nerr;
+.B char *sys_errlist[];
+.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.
+First the argument string
+.I s
+is printed, then a colon, then the message and a new-line.
+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 vector of message strings
+.I sys_errlist
+is provided;
+.I errno
+can be used as an index in this table to get the
+message string without the newline.
+.I Sys_nerr
+is the number of messages provided for in the table;
+it should be checked because new error codes may be added to the system before
+they are added to the table.
+.SH "SEE ALSO"
+intro(2),
+psignal(3)
diff --git a/usr/man/man3/perror.3f b/usr/man/man3/perror.3f
new file mode 100644 (file)
index 0000000..bb41838
--- /dev/null
@@ -0,0 +1,99 @@
+.TH PERROR 3F "19 January 1983"
+.SH NAME
+perror, gerror, ierrno \- get system error messages
+.SH SYNOPSIS
+.B subroutine perror (string)
+.br
+.B character*(*) string
+.sp 1
+.B subroutine gerror (string)
+.br
+.B character*(*) string
+.sp 1
+.B character*(*) function gerror()
+.sp 1
+.B function ierrno()
+.SH DESCRIPTION
+.I Perror
+will write a message to fortran logical unit 0
+appropriate to the last detected system error.
+.I String
+will be written preceeding the standard error message.
+.PP
+.I Gerror
+returns the system error message in character variable
+.I string.
+.I Gerror
+may be called as a subroutine or a function.
+.PP
+.I Ierrno
+will return the error number of the last detected system error.
+This number is updated only when an error actually occurs.
+Most routines and I/O statements that might generate such errors
+return an error code after the call;
+that value is a more reliable indicator of what caused the error condition.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+intro(2), perror(3), "The f77 I/O Library"
+.SH BUGS
+.I String
+in the call to
+.I perror
+can be no longer than 127 characters.
+.PP
+The length of the string returned by
+.I gerror
+is determined by the calling program.
+.SH NOTES
+UNIX system error codes are described in
+.IR intro (2).
+The f77 I/O error codes and their meanings are:
+.sp 1
+.in +5
+100    "error in format"
+.br
+101    "illegal unit number"
+.br
+102    "formatted io not allowed"
+.br
+103    "unformatted io not allowed"
+.br
+104    "direct io not allowed"
+.br
+105    "sequential io not allowed"
+.br
+106    "can't backspace file"
+.br
+107    "off beginning of record"
+.br
+108    "can't stat file"
+.br
+109    "no * after repeat count"
+.br
+110    "off end of record"
+.br
+111    "truncation failed"
+.br
+112    "incomprehensible list input"
+.br
+113    "out of free space"
+.br
+114    "unit not connected"
+.br
+115    "read unexpected character"
+.br
+116    "blank logical input field"
+.br
+117    "'new' file exists"
+.br
+118    "can't find 'old' file"
+.br
+119    "unknown system error"
+.br
+120    "requires seek ability"
+.br
+121    "illegal argument"
+.br
+122    "negative repeat count"
diff --git a/usr/man/man3/plot.3x b/usr/man/man3/plot.3x
new file mode 100644 (file)
index 0000000..46d7c97
--- /dev/null
@@ -0,0 +1,80 @@
+.TH PLOT 3X  "19 January 1983"
+.SH NAME
+plot: openpl, erase, label, line, circle, arc, move, cont, point, linemod, space, closepl \- graphics interface
+.SH SYNOPSIS
+.nf
+.B openpl()
+.PP
+.B erase()
+.PP
+.B label(s)
+.B char s[];
+.PP
+.B line(x1, y1, x2, y2)
+.PP
+.B circle(x, y, r)
+.PP
+.B arc(x, y, x0, y0, x1, y1)
+.PP
+.B move(x, y)
+.PP
+.B cont(x, y)
+.PP
+.B point(x, y)
+.PP
+.B linemod(s)
+.B char s[];
+.PP
+.B space(x0, y0, x1, y1)
+.PP
+.B closepl()
+.fi
+.PP
+.ft R
+.SH DESCRIPTION
+These subroutines generate graphic output in a relatively
+device-independent manner.  See
+.IR  plot (5)
+for a description of their effect.
+.I Openpl
+must be used before any of the others to open the device for writing.
+.I Closepl
+flushes the output.
+.PP
+String arguments to
+.I label
+and
+.I linemod
+are null-terminated, and do not contain newlines.
+.PP
+Various flavors of these functions exist for different output devices. 
+They are obtained by the following
+.IR ld (1)
+options:
+.TP 8n
+.B \-lplot
+device-independent graphics stream on standard output for 
+.IR plot (1)
+filters
+.br
+.ns
+.TP
+.B \-l300
+GSI 300 terminal
+.br
+.ns
+.TP
+.B \-l300s
+GSI 300S terminal
+.br
+.ns
+.TP
+.B \-l450
+DASI 450 terminal
+.br
+.ns
+.TP
+.B \-l4014
+Tektronix 4014 terminal
+.SH "SEE ALSO"
+plot(5), plot(1), graph(1)
diff --git a/usr/man/man3/popen.3s b/usr/man/man3/popen.3s
new file mode 100644 (file)
index 0000000..b548a2b
--- /dev/null
@@ -0,0 +1,66 @@
+.TH POPEN 3S "19 January 1983"
+.SH NAME
+popen, pclose \- initiate I/O to/from a process
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.SM
+.B FILE
+.B *popen(command, type)
+.br
+.B char *command, *type;
+.PP
+.B pclose(stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+The arguments to 
+.I popen
+are pointers to null-terminated strings containing respectively a
+shell command line and an I/O mode, either "r" for reading or "w" for
+writing.  It creates a pipe between the calling process and
+the command to be executed.  The value returned is a stream pointer that
+can be used (as appropriate) to write to the standard input
+of the command or read from its standard output.
+.PP
+A stream opened by
+.I popen
+should be closed by
+.I pclose,
+which waits for the associated process to terminate
+and returns the exit status of the command.
+.PP
+Because open files are shared, a type "r" command may be used as an input
+filter, and a type "w" as an output filter.
+.SH "SEE ALSO"
+pipe(2),
+fopen(3),
+fclose(3),
+system(3),
+wait(2),
+sh(1)
+.SH DIAGNOSTICS
+.I Popen
+returns a null pointer if files or processes cannot be created, or the shell 
+cannot be accessed.
+.PP
+.I Pclose
+returns \-1 if
+.I stream
+is not associated with a `popened' command.
+.SH BUGS
+Buffered reading before opening an input filter
+may leave the standard input of that filter mispositioned.
+Similar problems with an output filter may be
+forestalled by careful buffer flushing, for instance, with
+.I fflush,
+see
+.IR fclose (3).
+.LP
+.I Popen
+alwyas calls
+.IR sh ,
+never calls
+.IR csh .
diff --git a/usr/man/man3/printf.3s b/usr/man/man3/printf.3s
new file mode 100644 (file)
index 0000000..dc814fa
--- /dev/null
@@ -0,0 +1,245 @@
+.TH PRINTF 3S "1 April 1981"
+.SH NAME
+printf, fprintf, sprintf \- formatted output conversion
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B printf(format
+.RB [ ,
+arg ] ...
+.B )
+.br
+.B char *format;
+.PP
+.B fprintf(stream, format
+.RB [ ,
+arg ] ...
+.B )
+.br
+.SM
+.B FILE
+.B *stream;
+.br
+.B char *format;
+.PP
+.B sprintf(s, format
+.RB [ ,
+arg ] ...
+.B )
+.br
+.B char *s, format;
+.SH DESCRIPTION
+.I Printf
+places output on the standard output stream
+.BR stdout .
+.I Fprintf
+places output on the named output
+.IR stream .
+.I Sprintf
+places `output' in the string
+.I s,
+followed by the character `\\0'.
+.PP
+Each of these functions converts, formats, and prints its arguments after
+the first under control of the first argument.
+The first argument is a character string which contains 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
+.I arg
+.IR printf .
+.PP
+Each conversion specification is introduced by the character
+.BR % .
+Following the
+.BR % ,
+there may be
+.TP
+\-
+an optional minus sign `\-' which specifies
+.I "left adjustment"
+of the converted value in the indicated field;
+.TP
+\-
+an optional digit string specifying a
+.I "field width;"
+if the converted value has fewer characters than the field width
+it will be blank-padded on the left (or right,
+if the left-adjustment indicator has been given) to make up the field width;
+if the field width begins with a zero,
+zero-padding will be done instead of blank-padding;
+.TP
+\-
+an optional period
+.RB ` . '
+which serves to separate the field width from the next digit string;
+.TP
+\-
+an optional digit string specifying a
+.I precision
+which specifies the number of digits to appear after the
+decimal point, for e- and f-conversion, or the maximum number of characters
+to be printed from a string;
+.TP
+\-
+an optional `#' character
+specifying that the value should be converted to an ``alternate form''.
+For 
+.BR c ,
+.BR d ,
+.BR s ,
+and
+.BR u ,
+conversions, this option has no effect.  For 
+.B o
+conversions, the precision of the number is increased to force the first
+character of the output string to a zero.  For 
+.BR x ( X )
+conversion, a non-zero result has the string 
+.BR 0x ( 0X )
+prepended to it.  For 
+.BR e ,
+.BR E ,
+.BR f ,
+.BR g ,
+and
+.BR G ,
+conversions, the result will always contain a decimal point, even if no
+digits follow the point (normally, a decimal point only appears in the
+results of those conversions if a digit follows the decimal point).  For
+.B g
+and
+.B G
+conversions, trailing zeros are not removed from the result as they
+would otherwise be.
+.TP
+\-
+the character
+.B l
+specifying that a following
+.BR d ,
+.BR o ,
+.BR x ,
+or
+.B u
+corresponds to a long integer
+.IR arg .
+.TP
+\-
+a character which indicates the type of
+conversion to be applied.
+.PP
+A field width or precision may be `*' instead of a digit string.
+In this case an integer
+.I arg
+supplies
+the field width or precision.
+.PP
+The conversion characters
+and their meanings are
+.TP
+.B dox
+The integer
+.I arg
+is converted to decimal, octal, or
+hexadecimal notation respectively.
+.TP
+.B f
+The float or double
+.I arg
+is converted to decimal notation
+in the style `[\fB\-\fR]ddd.ddd'
+where the number of d's after the decimal point
+is equal to the precision specification
+for the argument.
+If the precision
+is missing,
+6 digits are given;
+if the precision is explicitly 0, no digits and
+no decimal point are printed.
+.TP
+.B e
+The float or double
+.I arg
+is 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;
+when the precision is missing,
+6 digits are produced.
+.TP
+.B g
+The float or double
+.I arg
+is printed in style
+.BR d ,
+in style
+.BR f ,
+or in
+style
+.BR e ,
+whichever gives full precision in minimum space.
+.TP
+.B c
+The character
+.I arg
+is printed.
+.TP
+.B s
+.I Arg
+is taken to be a string (character pointer)
+and characters from the string are printed until
+a null character or until
+the number of characters indicated by the precision
+specification is reached;
+however if the precision is 0 or missing
+all characters up to a null are printed.
+.TP
+.B u
+The unsigned integer
+.I arg
+is converted to decimal
+and printed (the result will be in the
+range 0 through MAXUINT, where MAXUINT equals 4294967295 on a VAX-11
+and 65535 on a PDP-11).
+.TP
+.B %
+Print a `%'; no argument is converted.
+.PP
+In no case does a non-existent or small field width
+cause truncation of a field;
+padding takes place only if the specified field
+width exceeds the actual width.
+Characters generated by
+.I printf
+are printed by 
+.IR putc (3).
+.PP
+.B Examples
+.br
+To print a date and time in the form `Sunday, July 3, 10:02',
+where
+.I weekday
+and
+.I month
+are pointers to null-terminated strings:
+.RS
+.HP
+.nh
+printf("%s, %s %d, %02d:%02d", 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));
+.SH "SEE ALSO"
+putc(3),
+scanf(3),
+ecvt(3)
+.SH BUGS
+Very wide fields (>128 characters) fail.
diff --git a/usr/man/man3/psignal.3 b/usr/man/man3/psignal.3
new file mode 100644 (file)
index 0000000..16d46a9
--- /dev/null
@@ -0,0 +1,42 @@
+.TH PSIGNAL 3 "25 February 1983"
+.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_signlist[];
+.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"
+signal(2),
+perror(3)
diff --git a/usr/man/man3/putc.3f b/usr/man/man3/putc.3f
new file mode 100644 (file)
index 0000000..64da2ee
--- /dev/null
@@ -0,0 +1,24 @@
+.TH PUTC 3F "19 January 1983"
+.SH NAME
+putc, fputc \- write a character to a fortran logical unit
+.SH SYNOPSIS
+.B integer function putc (char)
+.br
+.B character char
+.sp 1
+.B integer function fputc (lunit, char)
+.br
+.B character char
+.SH DESCRIPTION
+These funtions write a character to the file associated with a fortran logical
+unit bypassing normal fortran I/O.
+.I Putc
+writes to logical unit 6, normally connected to the control terminal output.
+.PP
+The value of each function will be zero unless some error occurred;
+a system error code otherwise. See perror(3F).
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+putc(3S), intro(2), perror(3F)
diff --git a/usr/man/man3/putc.3s b/usr/man/man3/putc.3s
new file mode 100644 (file)
index 0000000..f1c8409
--- /dev/null
@@ -0,0 +1,77 @@
+.TH PUTC 3S  "19 January 1983"
+.SH NAME
+putc, putchar, fputc, putw \- put character or word on a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B int putc(c, stream)
+.br
+.B char c;
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B putchar(c)
+.PP
+.B fputc(c, stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.PP
+.B putw(w, stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Putc
+appends the character
+.I c
+to the named output
+.IR stream .
+It returns the character written.
+.PP
+.I Putchar(c)
+is defined as 
+.IR putc ( c ,
+.BR stdout ).
+.PP
+.I Fputc
+behaves like 
+.I putc,
+but is a genuine function rather than a macro.
+.PP
+.I Putw
+appends word (that is,
+.BR int )
+.I w
+to the output
+.IR stream .
+It returns the word written.
+.I Putw
+neither assumes nor causes special alignment in the file.
+.SH "SEE ALSO"
+fopen(3), fclose(3), getc(3), puts(3), printf(3), fread(3)
+.SH DIAGNOSTICS
+These functions return the constant
+.SM
+.B EOF
+upon error.  Since this is a good integer,
+.IR  ferror (3)
+should be used to detect 
+.I putw
+errors.
+.SH BUGS
+Because it is implemented as a macro,
+.I putc
+treats a
+.I stream
+argument with side effects improperly.  In particular
+.IP "putc(c, *f++);"
+.PP
+doesn't work sensibly.
+.PP
+Errors can occur long after the call to
+.I putc.
diff --git a/usr/man/man3/puts.3s b/usr/man/man3/puts.3s
new file mode 100644 (file)
index 0000000..6770480
--- /dev/null
@@ -0,0 +1,45 @@
+.TH PUTS 3S  "19 January 1983"
+.SH NAME
+puts, fputs \- put a string on a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B puts(s)
+.br
+.B char *s;
+.PP
+.B fputs(s, stream)
+.br
+.B char *s;
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Puts
+copies the null-terminated string
+.I s
+to the standard output stream
+.B stdout
+and appends a
+newline character.
+.PP
+.I Fputs
+copies the null-terminated string
+.I s
+to the named output
+.IR stream .
+.PP
+Neither routine copies the terminal null character.
+.SH "SEE ALSO"
+fopen(3), gets(3),
+putc(3), printf(3),
+ferror(3)
+.br
+fread(3) for
+.I fwrite
+.SH BUGS
+.I Puts
+appends a newline,
+.I fputs
+does not, all in the name of backward compatibility.
diff --git a/usr/man/man3/qsort.3 b/usr/man/man3/qsort.3
new file mode 100644 (file)
index 0000000..806dbd3
--- /dev/null
@@ -0,0 +1,23 @@
+.TH QSORT 3  "19 January 1983"
+.SH NAME
+qsort \- quicker sort
+.SH SYNOPSIS
+.nf
+.B qsort(base, nel, width, compar)
+.B char *base;
+.B int (*compar)();
+.fi
+.SH DESCRIPTION
+.I Qsort
+is an implementation of the quicker-sort algorithm.
+The first argument is a pointer to the base of the data;
+the second is the number of elements;
+the third is the width of an element in bytes;
+the last is the name of the comparison routine
+to be called with two arguments which are pointers
+to the elements being compared.
+The routine must return an integer less than, equal to, or greater than 0
+according as the first argument is to be considered
+less than, equal to, or greater than the second.
+.SH "SEE ALSO"
+sort(1)
diff --git a/usr/man/man3/qsort.3f b/usr/man/man3/qsort.3f
new file mode 100644 (file)
index 0000000..83b35bd
--- /dev/null
@@ -0,0 +1,60 @@
+.TH QSORT 3F "19 January 1983"
+.SH NAME
+qsort \- quick sort
+.SH SYNOPSIS
+.B subroutine qsort (array, len, isize, compar)
+.br
+.B external compar
+.br
+.B integer*2 compar
+.SH DESCRIPTION
+One dimensional
+.I array
+contains the elements to be sorted.
+.I len
+is the number of elements in the array.
+.I isize
+is the size of an element, typically -
+.sp 1
+.in +5
+4 for
+.B integer
+and
+.B real
+.br
+8 for
+.B "double precision"
+or
+.B complex
+.br
+16 for
+.B "double complex"
+.br
+(length of character object) for
+.B character
+arrays
+.in -5
+.sp 1
+.I Compar
+is the name of a user supplied integer*2 function
+that will determine the sorting order.
+This function will be called with 2 arguments that will be elements of
+.I array.
+The function must return -
+.sp 1
+.in +5
+negative if arg 1 is precedent to arg 2
+.br
+zero if arg 1 is equivalent to arg 2
+.br
+positive if arg 1 is subsequent to arg 2
+.in -5
+.sp 1
+On return, the elements of
+.I array
+will be sorted.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+qsort(3)
diff --git a/usr/man/man3/rand.3 b/usr/man/man3/rand.3
new file mode 100644 (file)
index 0000000..2f4250d
--- /dev/null
@@ -0,0 +1,26 @@
+.TH RAND 3 "19 January 1983"
+.SH NAME
+rand, srand \- random number generator
+.SH SYNOPSIS
+.nf
+.B srand(seed)
+.B int seed;
+.PP
+.B rand()
+.fi
+.SH DESCRIPTION
+.I Rand
+uses a multiplicative congruential
+random number generator
+with period 2\u\s732\s0\d
+to return successive pseudo-random
+numbers in the range from 0 to 2\u\s731\s10\d\-1.
+.PP
+The generator is reinitialized by calling
+.I srand
+with 1 as argument.
+It can be set to a random starting point by calling
+.I srand
+with whatever you like as argument.
+.SH "SEE ALSO"
+random(3)
diff --git a/usr/man/man3/rand.3f b/usr/man/man3/rand.3f
new file mode 100644 (file)
index 0000000..e4c7ef5
--- /dev/null
@@ -0,0 +1,41 @@
+.TH RAND 3F "19 January 1983"
+.SH NAME
+rand, drand, irand \- return random values
+.SH SYNOPSIS
+.B function irand (iflag)
+.sp 1
+.B function rand (iflag)
+.sp 1
+.B double precision function drand (iflag)
+.SH DESCRIPTION
+These functions use
+.IR rand (3)
+to generate sequences of random numbers.
+If
+.I iflag
+is '1', the generator is restarted and the first random value is returned.
+If
+.I iflag
+is otherwise non-zero, it is used as a new seed for the random number
+generator, and the first new random value is returned.
+.PP
+.I Irand
+returns positive integers in the range 0 through 2147483647.
+.I Rand
+and
+.I drand
+return values in the range 0. through 1.0 .
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
+.SH "SEE ALSO"
+rand(3)
+.SH BUGS
+The algorithm returns a 15 bit quantity on the PDP11; a 31 bit quantity
+on the VAX.
+.I Irand
+on the PDP11 calls
+.IR rand (3)
+twice to form a 31 bit quantity, but bit 15 will always be 0.
+.LP
+But what does it do on the Sun ????????????????
diff --git a/usr/man/man3/random.3 b/usr/man/man3/random.3
new file mode 100644 (file)
index 0000000..5f0555e
--- /dev/null
@@ -0,0 +1,116 @@
+.TH RANDOM 3 "19 January 1983"
+.SH NAME
+random, srandom \- better random number generator
+.br
+initstate, setstate \- 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
+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 2\u\s731\s10\d\-1.  The period of this
+random number generator is very large, approximately 16*(2\u\s731\s10\d\-1).
+.PP
+.I Random/srandom
+have (almost) the same calling sequence and initialization properties as
+.I rand/srand.
+The difference is that
+.IR rand (3)
+produces a much less random sequence -- 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, \*(lqrandom()&01\*(rq will produce a random binary
+value.
+.PP
+Unlike
+.IR srand (3),
+.I 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
+.IR rand (3),
+however,
+.I random
+will by default produce a sequence of numbers that can be duplicated
+by calling
+.I srandom
+with 
+.I 1
+as the seed.
+.PP
+The
+.I 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
+.I initstate
+to decide how sophisticated a random number generator it should use -- 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
+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.
+.I Initstate
+returns a pointer to the previous state information array.
+.PP
+Once a state has been initialized, the
+.I setstate
+routine provides for rapid switching between states.
+.I Setstate 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
+or
+.I setstate.
+.PP
+Once a state array has been initialized, it may be restarted at a
+different point either by calling
+.I initstate
+(with the desired seed, the state array, and its size) or by calling
+both
+.I setstate
+(with the state array) and
+.I srandom
+(with the desired seed).
+The advantage of calling both
+.I setstate
+and
+.I srandom
+is that the size of the state array does not have to be remembered after
+it is initialized.
+.PP
+With 256 bytes of state information, the period of the random number
+generator is greater than 2\u\s769\s10\d, which should be sufficient for
+most purposes.
+.SH AUTHOR
+Earl T. Cohen
+.SH DIAGNOSTICS
+.PP
+If
+.I initstate
+is called with less than 8 bytes of state information, or if
+.I setstate
+detects that the state information has been garbled, error
+messages are printed on the standard error output.
+.SH "SEE ALSO"
+rand(3)
+.SH BUGS
+About 3/2 the speed of
+.IR rand (3).
diff --git a/usr/man/man3/range.3f b/usr/man/man3/range.3f
new file mode 100644 (file)
index 0000000..7249b63
--- /dev/null
@@ -0,0 +1,33 @@
+.TH RANGE 3F "19 January 1983"
+.SH NAME
+flmin, flmax, dflmin, dflmax, inmax \- return extreme values
+.SH SYNOPSIS
+.B function flmin()
+.sp 1
+.B function flmax()
+.sp 1
+.B double precision function dflmin()
+.sp 1
+.B double precision function dflmax()
+.sp 1
+.B function inmax()
+.SH DESCRIPTION
+Functions
+.I flmin
+and
+.I flmax
+return the minimum and maximum positive floating point values respectively.
+Functions
+.I dflmin
+and
+.I dflmax
+return the minimum and maximum positive double precision floating point values.
+Function
+.I inmax
+returns the maximum positive integer value.
+.PP
+These functions can be used by programs that must scale algorithms
+to the numerical range of the processor.
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
diff --git a/usr/man/man3/scandir.3 b/usr/man/man3/scandir.3
new file mode 100644 (file)
index 0000000..c2e4505
--- /dev/null
@@ -0,0 +1,43 @@
+.TH SCANDIR 3  "19 January 1983"
+.SH NAME
+scandir \- scan a directory
+.SH SYNOPSIS
+.nf
+.B #include <sys/types.h>
+.B #include <dir.h>
+.PP
+.B scandir(dirname, namelist, select, compar)
+.B char *dirname;
+.B struct direct *(*namelist[]);
+.B int (*select)();
+.B int (*compar)();
+.PP
+.B alphasort(d1, d2)
+.B struct direct **d1, **d2;
+.fi
+.SH DESCRIPTION
+.I Scandir
+reads the directory dirname and builds an array of pointers to directory
+entries using
+.IR malloc (3).
+The third parameter is a pointer to a routine which is called with a
+pointer to a directory entry and should return a non zero
+value if the directory entry should be included in the array.
+If this pointer is null, then all the directory entries will be included.
+The last argument is a pointer to a routine which is passed to
+.IR qsort (3)
+to sort the completed array. If this pointer is null, the array is not sorted.
+.I Alphasort
+is a routine which will sort the array alphabetically.
+.PP
+.I Scandir
+returns the number of entries in the array and a pointer to the
+array through the parameter namelist.
+.SH "SEE ALSO"
+directory(3),
+malloc(3),
+qsort(3)
+.SH DIAGNOSTICS
+Returns \-1 if the directory cannot be opened for reading or if
+.IR malloc (3)
+cannot allocate enough memory to hold all the data structures.
diff --git a/usr/man/man3/scanf.3s b/usr/man/man3/scanf.3s
new file mode 100644 (file)
index 0000000..313f5f9
--- /dev/null
@@ -0,0 +1,253 @@
+.TH SCANF 3S  "19 January 1983"
+.SH NAME
+scanf, fscanf, sscanf \- 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(s, format
+[ , pointer ] . . .
+.B )
+.br
+.B char *s, *format;
+.SH DESCRIPTION
+.I Scanf
+reads from the standard input stream
+.BR stdin .
+.I Fscanf
+reads from the named input
+.IR stream .
+.I Sscanf
+reads from the character string
+.IR s .
+Each function reads characters, interprets
+them according to a format, and stores the results in its arguments.
+Each expects as arguments
+a control string
+.I format,
+described below,
+and a set of
+.I pointer
+arguments
+indicating where the converted input should be stored.
+.PP
+The
+control string
+usually contains
+conversion specifications, which are used to direct interpretation
+of input sequences.
+The control string may contain:
+.TP 4
+1.
+Blanks, tabs or newlines,
+which match optional white space in the input.
+.TP 4
+2.
+An ordinary character (not %) which must match
+the next character of the input stream.
+.TP 4
+3.
+Conversion specifications, consisting of the
+character
+.BR % ,
+an optional assignment suppressing character
+.BR * ,
+an optional numerical maximum field width, and a conversion
+character.
+.PP
+A conversion specification directs the conversion of the
+next input field; the result
+is placed in the variable pointed to by the corresponding argument,
+unless assignment suppression was
+indicated by
+.BR * .
+An input field is defined as a string of non-space characters;
+it extends to the next inappropriate character or until the field
+width, if specified, is exhausted.
+.PP
+The conversion character indicates the interpretation of the
+input field; the corresponding pointer argument must
+usually be of a restricted type.
+The following conversion characters are legal:
+.TP 4
+.B  %
+a single `%' is expected
+in the input at this point;
+no assignment is done.
+.TP 4
+.B  d
+a decimal integer is expected;
+the corresponding argument should be an integer pointer.
+.TP 4
+.B  o
+an octal integer is expected;
+the corresponding argument should be a integer pointer.
+.TP 4
+.B  x
+a hexadecimal integer is expected;
+the corresponding argument should be an integer pointer.
+.ti -0.2i
+.TP 4
+.B  s
+a character string is expected;
+the corresponding argument should be a character pointer
+pointing to an array of characters large enough to accept the
+string and a terminating `\e0', which will be added.
+The input field is terminated by a space character
+or a newline.
+.TP 4
+.B  c
+a character is expected; the
+corresponding argument should be a character pointer.
+The normal skip over space characters is suppressed
+in this case;
+to read the next non-space character, try
+`%1s'.
+If a field width is given, the corresponding argument
+should refer to a character array, and the
+indicated number of characters is read.
+.TP 4
+\z\fBe\v'1'f\v'-1'\fR
+a
+floating point number is expected;
+the next field is converted accordingly and stored through the
+corresponding argument, which should be a pointer to a
+.IR float .
+The input format for
+floating point numbers is
+an optionally signed
+string of digits
+possibly containing a decimal point, followed by an optional
+exponent field consisting of an E or e followed by an optionally signed integer.
+.TP 4
+.B  [
+indicates a string not to be delimited by space characters.
+The left bracket is followed by a set of characters and a right
+bracket; the characters between the brackets define a set
+of characters making up the string.
+If the first character
+is not circumflex (\|^\|), the input field
+is all characters until the first character not in the set between
+the brackets; if the first character
+after the left bracket is ^, the input field is all characters
+until the first character which is in the remaining set of characters
+between the brackets.
+The corresponding argument must point to a character array.
+.PP
+The conversion characters
+.BR d ,
+.B o
+and
+.B x
+may be capitalized or preceeded by
+.B l
+to indicate that a pointer to
+.B long
+rather than to
+.B int
+is in the argument list.
+Similarly, the conversion characters
+.B e
+or
+.B f
+may be capitalized or
+preceded by
+.B l
+to indicate a pointer to 
+.B double
+rather than to 
+.BR float .
+The conversion characters
+.BR d ,
+.B o
+and
+.B x
+may be preceeded by
+.B h
+to indicate a pointer to
+.B short
+rather than to
+.BR int .
+.PP
+The
+.I scanf
+functions return the number of successfully matched and assigned input
+items.
+This can be used to decide how many input items were found.
+The constant
+.SM
+.B EOF
+is returned upon end of input; note that this is different
+from 0, which means that no conversion was done;
+if conversion was intended, it was frustrated by an
+inappropriate character in the input.
+.PP
+For example, the call
+.IP "" 10
+int i; float x; char name[50];
+.br
+scanf("%d%f%s", &i, &x, name);
+.PP
+with the input line
+.IP
+25   54.32E\(mi1  thompson
+.PP
+will assign to
+.I i
+the value
+25,
+.I x
+the value 5.432, and
+.I name
+will contain
+.IR `thompson\e0' .
+Or,
+.IP
+int i; float x; char name[50];
+.br
+scanf("%2d%f%*d%[1234567890]", &i, &x, name);
+.PP
+with input
+.IP
+56789 0123 56a72
+.PP
+will assign 56 to
+.I i,
+789.0 to
+.I x,
+skip `0123',
+and place the string `56\e0' in
+.IR name .
+The next call to
+.I getchar
+will return `a'.
+.SH "SEE ALSO"
+atof(3),
+getc(3), printf(3)
+.SH DIAGNOSTICS
+The 
+.I scanf
+functions return
+.SM
+.B EOF
+on end of input,
+and a short count for missing or illegal data items.
+.SH BUGS
+The success of literal matches and suppressed
+assignments is not directly
+determinable.
diff --git a/usr/man/man3/setjmp.3 b/usr/man/man3/setjmp.3
new file mode 100644 (file)
index 0000000..6ad3d3f
--- /dev/null
@@ -0,0 +1,41 @@
+.TH SETJMP 3 "19 January 1983"
+.SH NAME
+setjmp, longjmp \- non-local goto
+.SH SYNOPSIS
+.nf
+.B #include <setjmp.h>
+.PP
+.B setjmp(env)
+.B jmp_buf env;
+.PP
+.B longjmp(env, val)
+.B jmp_buf env;
+.fi
+.SH DESCRIPTION
+These routines are useful for dealing with errors 
+and interrupts encountered in
+a low-level subroutine of a program.
+.PP
+.I Setjmp 
+saves its stack environment in
+.I env
+for later use by
+.I longjmp.
+It returns value 0.
+.PP
+.I Longjmp
+restores the environment saved by the last call of
+.IR setjmp .
+It then returns in such a way that execution
+continues as if the call of 
+.I setjmp
+had just returned the value
+.I val
+to the function that invoked
+.I setjmp,
+which must not itself have returned in the interim.
+All accessible data have values as of the time
+.I longjmp
+was called.
+.SH "SEE ALSO"
+signal(2)
diff --git a/usr/man/man3/signal.3f b/usr/man/man3/signal.3f
new file mode 100644 (file)
index 0000000..a30ba43
--- /dev/null
@@ -0,0 +1,75 @@
+.TH SIGNAL 3F "19 January 1983"
+.SH NAME
+signal \- change the action for a signal
+.SH SYNOPSIS
+.B integer function signal(signum, proc, flag)
+.br
+.B integer signum, flag
+.br
+.B external proc
+.SH DESCRIPTION
+When a process incurs a signal (see
+.IR signal (2))
+the default action
+is usually to clean up and abort.
+The user may choose to write an alternative signal handling routine.
+A call to
+.I signal
+is the way this alternate action is specified to the system.
+.PP
+.I Signum
+is the signal number (see
+.IR signal (2)).
+If
+.I flag
+is negative, then
+.I proc
+must be the name of the user signal handling routine.
+If
+.I flag
+is zero or positive, then
+.I proc
+is ignored and the value of
+.I flag
+is passed to the system as the signal action definition.
+In particular, this is how previously saved signal actions can be restored.
+Two possible values for
+.I flag
+have specific meanings:
+0 means "use the default action" (See NOTES below),
+1 means "ignore this signal".
+.PP
+A positive returned value is the previous action definition.
+A value greater than 1 is the address of a routine that
+was to have been called on occurance of the given signal.
+The returned value can be used in subsequent calls to
+.I signal
+in order to restore a previous action definition.
+A negative returned value is the negation of a system error code.
+(See
+.IR perror (3F))
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+signal(2), kill(3F), kill(1)
+.SH NOTES
+.B f77
+arranges to trap certain signals when a process is started.
+The only way to restore the default
+.B f77
+action is to save the returned
+value from the first call to
+.I signal.
+.PP
+When a user signal handling routine is called, UNIX resets the signal action
+definition to its original default value.
+Thus it is necessary to call
+.IR signal (3F)
+from within the user signal handler in order to catch subsequent occurrances
+of the same signal. See
+.IR signal (2)
+for a fuller explanation.
+.PP
+If the user signal handler is called, it will be passed the signal number
+as an integer argument.
diff --git a/usr/man/man3/sigset.3j b/usr/man/man3/sigset.3j
new file mode 100644 (file)
index 0000000..9fa81ce
--- /dev/null
@@ -0,0 +1,141 @@
+.TH SIGSET 3J "19 January 1983"
+.UC 4
+.SH NAME
+sigset, signal, sighold, sigignore, sigrelse, sigpause \- manage signals
+.SH SYNOPSIS
+.nf
+.B #include <signal.h>
+.B void action();
+.B int sig;
+.PP
+.B sigset(sig, action)
+.B signal(sig, action)
+.PP
+.B sighold(sig)
+.B sigignore(sig)
+.B sigrelse(sig)
+.PP
+.B sigpause(sig)
+.PP
+.fi
+.B cc ... \-ljobs
+.nf
+.SH DESCRIPTION
+This is a package of signal management functions to manage the signals
+as described in
+.IR sigsys (2).
+These functions are available only in this version of UNIX, and should
+not be used when the mechanisms of
+.IR signal (2)
+would suffice, as they would then impair portability.
+These functions are contained in the \fIjobs\fR library, obtained by
+specifying the loader option \fB\-ljobs\fR.
+.PP
+.I Sigset
+is used to provide a default signal handler for signal
+.I sig.
+This function is remembered across subsequent calls to the other
+functions, and need not be specified again.
+After
+.I sigset
+instances of
+.I sig
+will cause an interrupt to be taken at
+.I func,
+with the signal then held so that recursive trapping due to
+the signal will not occur.  During normal return from
+.I func,
+the routines arrange for the signal action to be restored so that
+subsequent signals will also trap to
+.I func.
+If a non-local exit is to be taken, then
+.I sigrelse
+must be called to un-hold the signal action, restoring the
+original catch.
+.I Func
+may also be specified as
+SIG_DFL, SIG_IGN or SIG_HOLD, as described in
+.IR sigsys (2).
+The value specified on the previous call to
+.I sigset
+is returned; if
+.I sigset
+has never been called, then the default action inherited from the
+system is returned.
+.PP
+.I Signal
+is like
+.I sigset,
+but the signal will not be held when the action routine is called;
+rather it will have reverted to SIG_DFL.
+This is generally unsafe, but is included for backwards compatibility
+to the old signal mechanism.
+It should not be used.
+.PP
+.I Sighold
+and
+.I sigrelse
+may be used to block off
+.I sig
+in a piece of code where it cannot be tolerated.
+After
+.I sigrelse
+the catch initially set with
+.I sigset
+will be restored.
+.PP
+.I Sigignore
+can be used to temporarily set the action for
+.I sig
+to ignore the signal.  If the signal had been held before
+the call to
+.I sigignore,
+any pending instance of the signal will be discarded.
+.PP
+.I Sigpause
+may be used by a routine which wishes to check for some condition
+produced at interrupt level by the
+.I sig
+signal, and then to pause waiting for the condition to arise with
+the catch of the signal enabled.
+In correct usage it must be preceded by an instance of
+.I sighold
+to block the signal.
+.I Sigpause
+is like
+.I pause
+in that it will return after
+.I any
+signal is processed.
+The usual thing to do then is to reenable the hold with
+.I sighold,
+check the condition
+again, and
+.I sigpause
+again if the condition has not arisen.
+.SH "SEE ALSO"
+sigsys(2),
+signal(2),
+intro(3J),
+psignal(3),
+tty(4)
+.SH BUGS
+.I Sighold
+and
+.I sigrelse
+do not nest; the first
+.I sigrelse
+restores the default catch.
+.PP
+These functions store information in data space.  You thus
+.B must
+call
+.IR sigsys (2)
+rather than any of
+.I sigset
+or
+.I signal
+after a
+.IR vfork (2)
+in the child which is to then
+.IR execve (2).
diff --git a/usr/man/man3/sin.3m b/usr/man/man3/sin.3m
new file mode 100644 (file)
index 0000000..a3f14df
--- /dev/null
@@ -0,0 +1,64 @@
+.TH SIN 3M  "19 January 1983"
+.SH NAME
+sin, cos, tan, asin, acos, atan, atan2 \- trigonometric functions
+.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 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(x, y)
+.B double x, y;
+.fi
+.SH DESCRIPTION
+.I Sin, cos
+and
+.I tan
+return trigonometric functions of radian arguments.
+The magnitude of the argument should be checked
+by the caller to make sure the result is meaningful.
+.PP
+.I Asin
+returns the arc sin in the range \-\(*p/2 to \(*p/2.
+.PP
+.I Acos
+returns the arc cosine in the range 0 to \(*p.
+.PP
+.I Atan
+returns the arc tangent of
+.I x
+in the range \-\(*p/2 to \(*p/2.
+.PP
+.I Atan2
+returns the arc tangent of
+.I x/y
+in the range \-\(*p to \(*p.
+.SH DIAGNOSTICS
+Arguments of magnitude greater than 1 cause
+.I asin
+and
+.I acos
+to return value 0;
+.I errno
+is set to EDOM.  The value of
+.I tan
+at its singular points is a huge number, and
+.I errno
+is set to ERANGE.
+.SH BUGS
+The value of
+.I tan
+for arguments greater than about 2**31 is garbage.
diff --git a/usr/man/man3/sinh.3m b/usr/man/man3/sinh.3m
new file mode 100644 (file)
index 0000000..4a3f3c6
--- /dev/null
@@ -0,0 +1,22 @@
+.TH SINH 3M "19 January 1983"
+.SH NAME
+sinh, cosh, tanh \- hyperbolic functions
+.SH SYNOPSIS
+.nf
+.B #include <math.h>
+.PP
+.B double sinh(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 DIAGNOSTICS
+.I Sinh
+and
+.I cosh
+return a huge value of appropriate sign when the correct value would overflow.
diff --git a/usr/man/man3/sleep.3 b/usr/man/man3/sleep.3
new file mode 100644 (file)
index 0000000..3dcc580
--- /dev/null
@@ -0,0 +1,24 @@
+.TH SLEEP 3  "19 January 1983"
+.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 alarm clock signal
+and pausing until it occurs.
+The previous state of this signal is saved and restored.
+If the sleep time exceeds the time to the alarm signal,
+the process sleeps only until the signal would have occurred, and the
+signal is sent 1 second later.
+.SH "SEE ALSO"
+alarm(2), pause(2)
diff --git a/usr/man/man3/sleep.3f b/usr/man/man3/sleep.3f
new file mode 100644 (file)
index 0000000..517dae5
--- /dev/null
@@ -0,0 +1,18 @@
+.TH SLEEP 3F "19 January 1983"
+.SH NAME
+sleep \- sleep for awhile
+.SH SYNOPSIS
+.B subroutine sleep (itime)
+.SH DESCRIPTION
+.I Sleep
+causes the calling process to be suspended for
+.I itime
+seconds.
+The actual time can be up to 1 second less than
+.I itime
+due to granularity in system timekeeping.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+sleep(3)
diff --git a/usr/man/man3/stat.3f b/usr/man/man3/stat.3f
new file mode 100644 (file)
index 0000000..00937f3
--- /dev/null
@@ -0,0 +1,35 @@
+.TH STAT 3F "19 January 1983"
+.SH NAME
+stat, fstat \- get file status
+.SH SYNOPSIS
+.B integer function stat (name, statb)
+.br
+.B character*(*) name
+.br
+.B integer statb(11)
+.sp 1
+.B integer function fstat (lunit, statb)
+.br
+.B integer statb(11)
+.SH DESCRIPTION
+These routines return detailed information about a file.
+.I Stat
+returns information about file
+.IR name ;
+.I fstat
+returns information about the file associated with fortran logical unit
+.I lunit.
+The order and meaning of the information returned in array
+.I statb
+is as described for the structure
+.I stat
+under
+.IR stat (2)
+.PP
+The value of either function will be zero if successful;
+an error code otherwise.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+stat(2), access(3F), perror(3F), time(3F)
diff --git a/usr/man/man3/string.3 b/usr/man/man3/string.3
new file mode 100644 (file)
index 0000000..01c16c4
--- /dev/null
@@ -0,0 +1,98 @@
+.TH STRING 3  "19 January 1983"
+.SH NAME
+strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex \- string operations
+.SH SYNOPSIS
+.nf
+.B char *strcat(s1, s2)
+.B char *s1, *s2;
+.PP
+.B char *strncat(s1, s2, n)
+.B char *s1, *s2;
+.PP
+.B strcmp(s1, s2)
+.B char *s1, *s2;
+.PP
+.B strncmp(s1, s2, n)
+.B char *s1, *s2;
+.PP
+.B char *strcpy(s1, s2)
+.B char *s1, *s2;
+.PP
+.B char *strncpy(s1, s2, n)
+.B char *s1, *s2;
+.PP
+.B strlen(s)
+.B char *s;
+.PP
+.B char *index(s, c)
+.B char *s, c;
+.PP
+.B char *rindex(s, c)
+.B char *s, c;
+.fi
+.SH DESCRIPTION
+These functions operate on null-terminated strings.
+They do not check for overflow of any receiving string.
+.PP
+.I Strcat
+appends a copy of string
+.I s2
+to the end of string
+.IR s1 .
+.I Strncat
+copies at most
+.I n
+characters.  Both return a pointer to the null-terminated result.
+.PP
+.I Strcmp
+compares its arguments 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 .
+.I Strncmp
+makes the same comparison but looks at at most
+.I n
+characters.
+.PP
+.I Strcpy
+copies string
+.I s2
+to
+.I s1,
+stopping after the null character has been moved.
+.I Strncpy
+copies exactly
+.I n
+characters, truncating or null-padding
+.I s2;
+the target may not be null-terminated if the length of
+.I s2
+is
+.I n
+or more.  Both return
+.IR s1 .
+.PP
+.I Strlen
+returns the number of non-null characters in
+.IR s .
+.PP
+.I Index
+.RI ( rindex )
+returns a pointer to the first (last) occurrence of character 
+.I c
+in string
+.I s,
+or zero if
+.I c
+does not occur in  the string.
+.SH BUGS
+.I Strcmp 
+uses native character comparison, which is signed
+on the Sun Processor.
+.LP
+On PDP-11's and VAX'en, a source pointer of zero (0) can generally be
+used to indicate a null string.  On the Sun processor (and on some other
+machines), a zero pointer is an error and results in an abort of the
+program.  Programmers using NULL to represent an empty string should be
+aware of this portability issue.
diff --git a/usr/man/man3/swab.3 b/usr/man/man3/swab.3
new file mode 100644 (file)
index 0000000..e99a993
--- /dev/null
@@ -0,0 +1,21 @@
+.TH SWAB 3  "19 January 1983"
+.SH NAME
+swab \- swap bytes
+.SH SYNOPSIS
+.nf
+.B swab(from, to, nbytes)
+.B char *from, *to;
+.fi
+.SH DESCRIPTION
+.I Swab
+copies
+.I nbytes
+bytes pointed to by
+.I from
+to the position pointed to by
+.I to,
+exchanging adjacent even and odd bytes.
+It is useful for carrying binary data between
+PDP11's and other machines.
+.I Nbytes
+should be even.
diff --git a/usr/man/man3/system.3 b/usr/man/man3/system.3
new file mode 100644 (file)
index 0000000..abdfe77
--- /dev/null
@@ -0,0 +1,23 @@
+.TH SYSTEM 3 "19 January 1983"
+.SH NAME
+system \- issue a shell command
+.SH SYNOPSIS
+.nf
+.B system(string)
+.B char *string;
+.fi
+.SH DESCRIPTION
+.I System
+causes the
+.I string
+to be given to
+.IR  sh (1)
+as input as if the string had been typed as a command
+at a terminal.
+The current process waits until the shell has
+completed, then returns the exit status of the shell.
+.SH "SEE ALSO"
+popen(3),
+exec(2), wait(2)
+.SH DIAGNOSTICS
+Exit status 127 indicates the shell couldn't be executed.
diff --git a/usr/man/man3/system.3f b/usr/man/man3/system.3f
new file mode 100644 (file)
index 0000000..db043a8
--- /dev/null
@@ -0,0 +1,32 @@
+.TH SYSTEM 3F "19 January 1983"
+.SH NAME
+system \- execute a unix command
+.SH SYNOPSIS
+.B integer function system (string)
+.br
+.B character*(*) string
+.SH DESCRIPTION
+.I System
+causes
+.I string
+to be given to your shell
+as input as if the string had been typed as a command at a terminal.
+If environment variable
+.B SHELL
+is not found,
+.IR sh (1)
+is used.
+.PP
+The current process waits until the command terminates.
+The returned value will be the exit status of the shell.
+See
+.IR wait (2)
+for an explanation of this value.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+exec(2), wait(2), system(3)
+.SH BUGS
+.I String
+can not be longer than 255 characters.
diff --git a/usr/man/man3/termcap.3x b/usr/man/man3/termcap.3x
new file mode 100644 (file)
index 0000000..e50f1f5
--- /dev/null
@@ -0,0 +1,145 @@
+.TH TERMCAP 3X "9 February 1983"
+.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
+These functions extract and use capabilities from the terminal capability data
+base
+.IR termcap (5).
+These are low level routines;
+see
+.IR curses (3)
+for a higher level package.
+.PP
+.I Tgetent
+extracts the entry for terminal
+.I name
+into the buffer at
+.I bp.
+.I Bp
+should be a character buffer of size
+1024 and must be retained through all subsequent calls
+to
+.I tgetnum,
+.I tgetflag,
+and
+.I tgetstr.
+.I Tgetent
+returns \-1 if it cannot open the
+.I termcap
+file, 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.
+If found, and the value does not begin with a slash,
+and the terminal type
+.B name
+is the same as the environment string TERM,
+the TERMCAP string is used instead of reading the termcap file.
+If it does begin with a slash, the string is used as a path name rather than
+.I /etc/termcap.
+This can speed up entry into programs that call
+.IR tgetent ,
+as well as to help debug new terminal descriptions
+or to make one for your terminal if you can't write the file
+.I /etc/termcap.
+.PP
+.I Tgetnum
+gets the numeric value of capability
+.I id,
+returning \-1 if is not given for the terminal.
+.I Tgetflag
+returns 1 if the specified capability is present in
+the terminal's entry, 0 if it is not.
+.I Tgetstr
+gets the string value of capability
+.I id,
+placing it in the buffer at
+.I area,
+advancing the
+.I area
+pointer.
+It decodes the abbreviations for this field described in
+.IR termcap (5),
+except for cursor addressing and padding information.
+.PP
+.I Tgoto
+returns a cursor addressing string decoded from
+.I cm
+to go to column
+.I destcol
+in line
+.I destline.
+It uses the external variables
+.B UP
+(from the \fBup\fR capability)
+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
+the returned string.
+(Programs which call tgoto should be sure to turn off the XTABS bit(s),
+since
+.I tgoto
+may now output a tab.
+Note that programs using termcap should in general turn off XTABS
+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
+decodes the leading padding information of the string
+.IR cp ;
+.I affcnt
+gives the number of lines affected by the operation, or 1 if this is
+not applicable,
+.I outc
+is a routine which is called with each character in turn.
+The external variable
+.I ospeed
+should contain the output speed of the terminal as encoded by
+.IR stty (2).
+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
+.br
+/etc/termcap   data base
+.DT
+.SH SEE ALSO
+ex(1), curses(3X), termcap(5)
+.SH AUTHOR
+William Joy
diff --git a/usr/man/man3/time.3f b/usr/man/man3/time.3f
new file mode 100644 (file)
index 0000000..66db01b
--- /dev/null
@@ -0,0 +1,42 @@
+.TH TIME 3F "19 January 1983"
+.SH NAME
+time, ctime, ltime, gmtime \- return system time
+.SH SYNOPSIS
+.B integer function time()
+.sp 1
+.B character*(*) function ctime (stime)
+.br
+.B integer stime
+.sp 1
+.B subroutine ltime (stime, tarray)
+.br
+.B integer stime, tarray(9)
+.sp 1
+.B subroutine gmtime (stime, tarray)
+.br
+.B integer stime, tarray(9)
+.SH DESCRIPTION
+.I Time
+returns the time since 00:00:00 GMT, Jan. 1, 1970, measured in seconds.
+This is the value of the UNIX system clock.
+.PP
+.I Ctime
+converts a system time to a 24 character ASCII string.
+The format is described under
+.IR ctime (3).
+No 'newline' or NULL will be included.
+.PP
+.I Ltime
+and
+.I gmtime
+disect a UNIX time into month, day, etc., either for the local time zone
+or as GMT.
+The order and meaning of each element returned in
+.I tarray
+is described under
+.IR ctime (3).
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+ctime(3), itime(3F), idate(3F), fdate(3F)
diff --git a/usr/man/man3/traper.3f b/usr/man/man3/traper.3f
new file mode 100644 (file)
index 0000000..e7e7012
--- /dev/null
@@ -0,0 +1,35 @@
+.TH TRAPER 3F  "19 January 1983"
+.SH NAME
+traper \- trap arithmetic errors
+.SH SYNOPSIS
+.B integer function traper (mask)
+.SH DESCRIPTION
+\fBNOTE: This routine applies only to the Vax. It is ignored on the pdp11.\fR
+.PP
+Integer overflow and floating point underflow are not normally
+trapped during execution. This routine enables these traps by setting
+status bits in the process status word. These bits are reset on
+entry to a subprogram, and the previous state is restored on return.
+Therefore, this routine must be called
+.I inside
+each subprogram in which these conditions should be trapped.
+If the condition occurs and trapping is enabled,
+signal SIGFPE is sent to the process. (See
+.IR signal (2))
+.PP
+The argument has the following meaning:
+.nf
+
+        value   meaning
+          0     do not trap either condition
+          1     trap integer overflow only
+          2     trap floating underflow only
+          3     trap both the above
+
+.fi
+The previous value of these bits is returned.
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
+.SH "SEE ALSO"
+signal(2), signal(3f)
diff --git a/usr/man/man3/trapov.3f b/usr/man/man3/trapov.3f
new file mode 100644 (file)
index 0000000..c79e7fe
--- /dev/null
@@ -0,0 +1,24 @@
+.TH TRAPOV 3F "19 January 1983"
+.SH NAME
+trapov \- trap and repair floating point overflow
+.SH SYNOPSIS
+.B subroutine trapov (numesg, rtnval)
+.br
+.B double precision rtnval
+.SH DESCRIPTION
+\fBNOTE: This routine applies only to the Vax. It is ignored on the pdp11.\fR
+.PP
+This call sets up the signal handler to trap and repair floating point overflow.
+The first
+.I numesg
+occurrences of an overflow error will cause the message ``Overflow!''
+to appear on the standard error file.
+The value given for
+.I rtnval
+will replace the value generated by the overflow.
+This must be a double precision value. For example, ``0d0'' or ``dflmax()''.
+.SH FILES
+.ie \nM /usr/ucb/lib/libF77.a
+.el /usr/lib/libF77.a
+.SH SEE ALSO
+signal(3f), range(3f)
diff --git a/usr/man/man3/ttynam.3f b/usr/man/man3/ttynam.3f
new file mode 100644 (file)
index 0000000..dc567da
--- /dev/null
@@ -0,0 +1,31 @@
+.TH TTYNAM 3F "19 January 1983"
+.SH NAME
+ttynam, isatty \- find name of a terminal port
+.SH SYNOPSIS
+.B character*(*) function ttynam (lunit)
+.sp 1
+.B logical function isatty (lunit)
+.SH DESCRIPTION
+.I Ttynam
+returns a blank padded path name
+of the terminal device associated with logical unit
+.IR lunit .
+.PP
+.I Isatty
+returns
+.B .TRUE.
+if
+.I lunit
+is associated with a terminal device,
+.B .FALSE.
+otherwise.
+.SH FILES
+/dev/\(**
+.br
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH DIAGNOSTICS
+.I Ttynam
+returns an empty string (all blanks) if
+.I lunit
+is not associated with a terminal device in directory `/dev'.
diff --git a/usr/man/man3/ttyname.3 b/usr/man/man3/ttyname.3
new file mode 100644 (file)
index 0000000..4cd5547
--- /dev/null
@@ -0,0 +1,44 @@
+.TH TTYNAME 3  "19 January 1983"
+.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
+.IR filedes .
+ (this is a system file descriptor and has nothin 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.
diff --git a/usr/man/man3/ungetc.3s b/usr/man/man3/ungetc.3s
new file mode 100644 (file)
index 0000000..8fddadb
--- /dev/null
@@ -0,0 +1,36 @@
+.TH UNGETC 3S  "19 January 1983"
+.SH NAME
+ungetc \- push character back into input stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B ungetc(c, stream)
+.br
+.SM
+.B FILE
+.B *stream;
+.SH DESCRIPTION
+.I Ungetc
+pushes the character
+.I c
+back on an input stream.  That character will be returned by the next
+.I getc
+call on that stream.
+.I Ungetc 
+returns 
+.IR c .
+.PP
+One character of pushback is guaranteed provided
+something has been read from the stream and the stream is actually buffered.
+Attempts to push EOF are rejected.
+.PP
+.IR  Fseek (3)
+erases all memory of pushed back characters.
+.SH "SEE ALSO"
+getc(3), setbuf(3), fseek(3)
+.SH DIAGNOSTICS
+.I Ungetc
+returns
+.SM
+.B EOF
+if it can't push a character back.
diff --git a/usr/man/man3/unlink.3f b/usr/man/man3/unlink.3f
new file mode 100644 (file)
index 0000000..5835fe7
--- /dev/null
@@ -0,0 +1,21 @@
+.TH UNLINK 3F "19 January 1983"
+.SH NAME
+unlink \- remove a directory entry
+.SH SYNOPSIS
+.B integer function unlink (name)
+.br
+.B character*(*) name
+.SH DESCRIPTION
+.I Unlink
+causes the directory entry specified by pathname
+.I name
+to be removed.
+If this was the last link to the file, the contents of the file are lost.
+The returned value will be zero if successful; a system error code otherwise.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+unlink(2), link(3F), filsys(5), perror(3F)
+.SH BUGS
+Pathnames can be no longer than 127 characters.
diff --git a/usr/man/man3/valloc.3 b/usr/man/man3/valloc.3
new file mode 100644 (file)
index 0000000..d3e6042
--- /dev/null
@@ -0,0 +1,26 @@
+.TH VALLOC 3 "19 January 1983"
+.UC
+.SH NAME
+valloc \- aligned memory allocator
+.SH SYNOPSIS
+.nf
+.B char *valloc(size)
+.B unsigned size;
+.fi
+.SH DESCRIPTION
+.I Valloc
+allocates
+.I size
+bytes aligned on a page boundary.
+It is implemented by calling
+.IR malloc (3)
+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.
diff --git a/usr/man/man3/varargs.3 b/usr/man/man3/varargs.3
new file mode 100644 (file)
index 0000000..84f84c5
--- /dev/null
@@ -0,0 +1,100 @@
+.TH VARARGS 3  "19 January 1983"
+.SH NAME
+varargs \- variable argument list
+.SH SYNOPSIS
+.B "#include <varargs.h>"
+.PP
+.I function\c
+.RB ( va_alist )
+.br
+.B va_dcl
+.br
+.B va_list
+.IR pvar ;
+.br
+.B va_start\c
+.RI ( pvar );
+.br
+f =
+.B va_arg\c
+.RI ( pvar ,
+.IR type );
+.br
+.B va_end\c
+.RI ( pvar );
+.SH DESCRIPTION
+This set of macros provides a means of writing portable procedures that
+accept variable argument lists.
+Routines having variable argument lists (such as
+.IR printf (3))
+that do not use varargs are inherently nonportable, since different
+machines use different argument passing conventions.
+.PP
+.B va_alist
+is used in a function header to declare a variable argument list.
+.PP
+.B va_dcl
+is a declaration for
+.BR va_alist .
+Note that there is no semicolon after
+.B va_dcl.
+.PP
+.B va_list
+is a type which can be used for the variable
+.IR pvar ,
+which is used to traverse the list.
+One such variable must always be declared.
+.PP
+.B va_start\c
+.RI (pvar)
+is called to initialize
+.I pvar
+to the beginning of the list.
+.PP
+.B va_arg\c
+.RI ( pvar ,
+.IR type )
+will return the next argument in the list pointed to by
+.IR pvar .
+.I Type
+is the type the argument is expected to be.
+Different types can be mixed, but it is up
+to the routine to know what type of argument is
+expected, since it cannot be determined at runtime.
+.PP
+.B va_end\c
+.RI ( pvar )
+is used to finish up.
+.PP
+Multiple traversals, each bracketted by
+.B va_start
+\&...
+.B va_end,
+are possible.
+.SH EXAMPLE
+.nf
+       \fB#include\fP <varargs.h>
+       execl(\fBva_alist\fP)
+       \fBva_dcl\fP
+       {
+               \fBva_list\fP ap;
+               \fBchar\fP *file;
+               \fBchar\fP *args[100];
+               \fBint\fP argno = 0;
+
+               \fBva_start\fP(ap);
+               file = \fBva_arg(ap, \fBchar\fP *);
+               \fBwhile\fP (args[argno++] = \fBva_arg\fP(ap, \fBchar\fP *))
+                       \fB;\fP
+               \fBva_end\fP(ap);
+               \fBreturn\fP execv(file, args);
+       }
+.fi
+.SH BUGS
+It is up to the calling routine to determine how many arguments
+there are, since it is not possible to determine this from the
+stack frame.  For example,
+.I execl
+passes a 0 to signal the end of the list.
+.I Printf
+can tell how many arguments are supposed to be there by the format.
diff --git a/usr/man/man3/wait.3f b/usr/man/man3/wait.3f
new file mode 100644 (file)
index 0000000..f6e6ddf
--- /dev/null
@@ -0,0 +1,26 @@
+.TH WAIT 3F "19 January 1983"
+.SH NAME
+wait \- wait for a process to terminate
+.SH SYNOPSIS
+.B integer function wait (status)
+.br
+.B integer status
+.SH DESCRIPTION
+.I Wait
+causes its caller to be suspended until a signal is received or one of
+its child processes terminates.
+If any child has terminated since the last
+.I wait,
+return is immediate; if there are no children, return is immediate
+with an error code.
+.PP
+If the returned value is positive, it is the process ID of the child and
+.I status
+is its termination status (see
+.IR wait (2)).
+If the returned value is negative, it is the negation of a system error code.
+.SH FILES
+.ie \nM /usr/ucb/lib/libU77.a
+.el /usr/lib/libU77.a
+.SH "SEE ALSO"
+wait(2), signal(3F), kill(3F), perror(3F)