Bell 32V development
authorTom London <tbl@research.uucp>
Mon, 6 Nov 1978 03:56:43 +0000 (22:56 -0500)
committerTom London <tbl@research.uucp>
Mon, 6 Nov 1978 03:56:43 +0000 (22:56 -0500)
Work on file usr/man/man3/abs.3
Work on file usr/man/man3/abort.3
Work on file usr/man/man3/crypt.3
Work on file usr/man/man3/atof.3
Work on file usr/man/man3/fopen.3s
Work on file usr/man/man3/exp.3m
Work on file usr/man/man3/fread.3s
Work on file usr/man/man3/getpw.3
Work on file usr/man/man3/getpass.3
Work on file usr/man/man3/getlogin.3
Work on file usr/man/man3/getenv.3
Work on file usr/man/man3/gamma.3m
Work on file usr/man/man3/getgrent.3
Work on file usr/man/man3/fseek.3s
Work on file usr/man/man3/l3tol.3
Work on file usr/man/man3/gets.3s
Work on file usr/man/man3/intro.3
Work on file usr/man/man3/j0.3m
Work on file usr/man/man3/monitor.3
Work on file usr/man/man3/mktemp.3
Work on file usr/man/man3/perror.3
Work on file usr/man/man3/plot.3x
Work on file usr/man/man3/nlist.3
Work on file usr/man/man3/qsort.3
Work on file usr/man/man3/sin.3m
Work on file usr/man/man3/scanf.3s
Work on file usr/man/man3/setjmp.3
Work on file usr/man/man3/puts.3s
Work on file usr/man/man3/sinh.3m
Work on file usr/man/man3/setbuf.3s
Work on file usr/man/man3/sleep.3
Work on file usr/man/man3/string.3
Work on file usr/man/man3/swab.3
Work on file usr/man/man3/stdio.3s
Work on file usr/man/man3/ungetc.3s

Co-Authored-By: John Reiser <jfr@research.uucp>
Synthesized-from: 32v

35 files changed:
usr/man/man3/abort.3 [new file with mode: 0644]
usr/man/man3/abs.3 [new file with mode: 0644]
usr/man/man3/atof.3 [new file with mode: 0644]
usr/man/man3/crypt.3 [new file with mode: 0644]
usr/man/man3/exp.3m [new file with mode: 0644]
usr/man/man3/fopen.3s [new file with mode: 0644]
usr/man/man3/fread.3s [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/getenv.3 [new file with mode: 0644]
usr/man/man3/getgrent.3 [new file with mode: 0644]
usr/man/man3/getlogin.3 [new file with mode: 0644]
usr/man/man3/getpass.3 [new file with mode: 0644]
usr/man/man3/getpw.3 [new file with mode: 0644]
usr/man/man3/gets.3s [new file with mode: 0644]
usr/man/man3/intro.3 [new file with mode: 0644]
usr/man/man3/j0.3m [new file with mode: 0644]
usr/man/man3/l3tol.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/plot.3x [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/scanf.3s [new file with mode: 0644]
usr/man/man3/setbuf.3s [new file with mode: 0644]
usr/man/man3/setjmp.3 [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/stdio.3s [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/ungetc.3s [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..f13b33c
--- /dev/null
@@ -0,0 +1,12 @@
+.TH ABORT 3
+.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.
diff --git a/usr/man/man3/abs.3 b/usr/man/man3/abs.3
new file mode 100644 (file)
index 0000000..cdf763f
--- /dev/null
@@ -0,0 +1,14 @@
+.TH ABS 3 
+.SH NAME
+abs \- integer absolute value
+.SH SYNOPSIS
+.B abs(i)
+.SH DESCRIPTION
+.I Abs
+returns
+the absolute value of its integer operand.
+.SH SEE ALSO
+floor(3) for
+.I fabs
+.SH BUGS
+You get what the hardware gives on the smallest integer.
diff --git a/usr/man/man3/atof.3 b/usr/man/man3/atof.3
new file mode 100644 (file)
index 0000000..5504dd2
--- /dev/null
@@ -0,0 +1,39 @@
+.TH ATOF 3 
+.SH NAME
+atof, atoi, atol \- convert ASCII to numbers
+.SH SYNOPSIS
+.B double atof(nptr)
+.br
+.B char *nptr;
+.PP
+.B atoi(nptr)
+.br
+.B char *nptr;
+.PP
+.B long atol(nptr)
+.br
+.B char *nptr;
+.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
+recoginizes an optional string of tabs and 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 tabs and spaces,
+then an optional sign, then a string of
+digits.
+.SH SEE ALSO
+scanf(3)
+.SH BUGS
+There are no provisions for overflow.
diff --git a/usr/man/man3/crypt.3 b/usr/man/man3/crypt.3
new file mode 100644 (file)
index 0000000..1c057a1
--- /dev/null
@@ -0,0 +1,66 @@
+.TH CRYPT 3 
+.SH NAME
+crypt, setkey, encrypt \- DES encryption
+.SH SYNOPSIS
+.B char *crypt(key, salt)
+.br
+.B char *key, *salt;
+.PP
+.B setkey(key)
+.br
+.B char *key;
+.PP
+.B encrypt(block, edflag)
+.br
+.B char *block;
+.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 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/exp.3m b/usr/man/man3/exp.3m
new file mode 100644 (file)
index 0000000..4b78b09
--- /dev/null
@@ -0,0 +1,76 @@
+.TH EXP 3M 
+.SH NAME
+exp, log, log10, pow, sqrt \- exponential, logarithm, power, square root
+.SH SYNOPSIS
+.B #include <math.h>
+.PP
+.B double exp(x)
+.br
+.B double x;
+.PP
+.B double log(x)
+.br
+.B double x;
+.PP
+.B double log10(x)
+.br
+.B double x;
+.PP
+.B double pow(x, y)
+.br
+.B double x, y;
+.PP
+.B double sqrt(x)
+.br
+.B double x;
+.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/fopen.3s b/usr/man/man3/fopen.3s
new file mode 100644 (file)
index 0000000..4d95bbd
--- /dev/null
@@ -0,0 +1,89 @@
+.TH FOPEN 3S 
+.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
+.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.
diff --git a/usr/man/man3/fread.3s b/usr/man/man3/fread.3s
new file mode 100644 (file)
index 0000000..e2542f5
--- /dev/null
@@ -0,0 +1,51 @@
+.TH FREAD 3S 
+.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
+.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.
diff --git a/usr/man/man3/fseek.3s b/usr/man/man3/fseek.3s
new file mode 100644 (file)
index 0000000..2e4a5bf
--- /dev/null
@@ -0,0 +1,58 @@
+.TH FSEEK 3S 
+.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
+.I Rewind(stream)
+is equivalent to
+.I "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..382e53d
--- /dev/null
@@ -0,0 +1,36 @@
+.TH GAMMA 3M 
+.SH NAME
+gamma \- log gamma function
+.SH SYNOPSIS
+.B #include <math.h>
+.PP
+.B double gamma(x)
+.br
+.B double x;
+.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
+       y = gamma(x);
+.br
+       if (y > 88.)
+.br
+               error( );
+.br
+       y = exp(y);
+.br
+       if(signgam)
+.br
+               y = \-y;
+.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/getenv.3 b/usr/man/man3/getenv.3
new file mode 100644 (file)
index 0000000..79d6476
--- /dev/null
@@ -0,0 +1,20 @@
+.TH GETENV 3
+.SH NAME
+getenv \- value for environment name
+.SH SYNOPSIS
+.B char *getenv(name)
+.br
+.B char *name;
+.SH DESCRIPTION
+.I Getenv
+.a
+searches the environment list
+(see
+.IR environ (5))
+for a string of the form
+.IB name = value
+and returns
+.I value
+if such a string is present, otherwise 0 (NULL).
+.SH SEE ALSO
+environ(5), exec(2)
diff --git a/usr/man/man3/getgrent.3 b/usr/man/man3/getgrent.3
new file mode 100644 (file)
index 0000000..a4a650d
--- /dev/null
@@ -0,0 +1,93 @@
+.TH GETGRENT 3 
+.SH NAME
+getgrent, getgrgid, getgrnam, setgrent, endgrent \- get group file entry
+.SH SYNOPSIS
+.B #include <grp.h>
+.PP
+.B struct group *getgrent();
+.PP
+.B struct group *getgrgid(gid) int gid;
+.PP
+.B struct group *getgrnam(name) char *name;
+.PP
+.B int setgrent();
+.PP
+.B int endgrent();
+.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
+gr_name
+The name of the group.
+.br
+.ns
+.TP
+gr_passwd
+The encrypted password of the group.
+.br
+.ns
+.TP
+gr_gid
+The numerical group-ID.
+.br
+.ns
+.TP
+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/getlogin.3 b/usr/man/man3/getlogin.3
new file mode 100644 (file)
index 0000000..0f852aa
--- /dev/null
@@ -0,0 +1,42 @@
+.TH GETLOGIN 3 
+.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 getpwuid .
+.SH FILES
+/etc/utmp
+.SH "SEE ALSO"
+getpwent(3), getgrent(3), utmp(5)
+.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/getpass.3 b/usr/man/man3/getpass.3
new file mode 100644 (file)
index 0000000..ffea3d1
--- /dev/null
@@ -0,0 +1,24 @@
+.TH GETPASS 3 
+.SH NAME
+getpass \- read a password
+.SH SYNOPSIS
+.B char *getpass(prompt)
+.br
+.B char *prompt;
+.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/getpw.3 b/usr/man/man3/getpw.3
new file mode 100644 (file)
index 0000000..03694d6
--- /dev/null
@@ -0,0 +1,26 @@
+.TH GETPW 3  deprecated
+.SH NAME
+getpw \- get name from UID
+.SH SYNOPSIS
+.B getpw(uid, buf)
+.br
+.B char *buf;
+.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/gets.3s b/usr/man/man3/gets.3s
new file mode 100644 (file)
index 0000000..061824d
--- /dev/null
@@ -0,0 +1,62 @@
+.TH GETS 3S 
+.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
+.B 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/intro.3 b/usr/man/man3/intro.3
new file mode 100644 (file)
index 0000000..6e6f60a
--- /dev/null
@@ -0,0 +1,92 @@
+.TH INTRO 3
+.SH NAME
+intro \- introduction to library functions
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B #include <math.h>
+.SH DESCRIPTION
+This section describes functions that may be found
+in various libraries, other than those functions
+that directly invoke UNIX system primitives,
+which are described in section 2.
+Functions are divided into various libraries distinguished
+by the section number at the top of the page:
+.TP 6n
+(3)
+These functions, together with those of section 2 and those
+marked (3S), constitute library
+.I libc,
+which is automatically loaded by the C compiler
+.IR cc (1)
+and the Fortran compiler
+.IR f77 (1).
+The link editor
+.IR ld (1)
+searches this library under the `\-lc' option.
+Declarations for some of these functions may be obtained
+from include files indicated on the appropriate pages.
+.TP
+(3M)
+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 `\-lm' option.
+Declarations for these functions may be obtained from
+the include file <math.h>.
+.TP 
+(3S)
+These functions constitute the
+`standard I/O package',
+see
+.IR stdio (3).
+These functions are in the library
+.I libc
+already mentioned.
+Declarations for these functions may be obtained from
+the include file <stdio.h>.
+.TP
+(3X)
+Various
+specialized libraries have not been given distinctive
+captions.
+The files in which these libraries are found are named
+on the appropriate pages.
+.SH FILES
+/lib/libc.a
+.br
+/lib/libm.a, /usr/lib/libm.a (one or the other)
+.SH SEE ALSO
+stdio(3),
+nm(1), ld(1), cc(1), f77(1), intro(2)
+.SH DIAGNOSTICS
+Functions in the math library (3M) may return
+conventional values when the function is undefined for the
+given arguments or when the value is not representable.
+In these cases the external variable
+.I errno
+(see
+.IR intro (2))
+is set to the value EDOM
+or ERANGE.
+The values of EDOM and ERANGE are defined in
+the include file
+.I <math.h>.
+.SH "ASSEMBLER (PDP-11)"
+In assembly language these functions may be accessed
+by simulating the C calling sequence.
+For example,
+.IR ecvt (3)
+might be called this way:
+.IP ""
+.globl _ecvt
+.nf
+setd
+mov    $sign,\-(sp)
+mov    $decpt,\-(sp)
+mov    ndigit,\-(sp)
+movf   value,\-(sp)
+jsr    pc,_ecvt
+add    $14.,sp
+.fi
diff --git a/usr/man/man3/j0.3m b/usr/man/man3/j0.3m
new file mode 100644 (file)
index 0000000..f9dffcf
--- /dev/null
@@ -0,0 +1,41 @@
+.TH J0 3M 
+.SH NAME
+j0, j1, jn, y0, y1, yn \- bessel functions
+.SH SYNOPSIS
+.B #include <math.h>
+.PP
+.B double j0(x)
+.br
+.B double x;
+.PP
+.B double j1(x)
+.br
+.B double x;
+.PP
+.B double jn(n, x);
+.br
+.B double x;
+.PP
+.B double y0(x)
+.br
+.B double x;
+.PP
+.B double y1(x)
+.br
+.B double x;
+.PP
+.B double yn(n, x)
+.br
+.B double 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
+.I y0, y1,
+and
+.I yn
+to return a huge negative value
+and set
+.I errno
+to EDOM.
diff --git a/usr/man/man3/l3tol.3 b/usr/man/man3/l3tol.3
new file mode 100644 (file)
index 0000000..ac373b6
--- /dev/null
@@ -0,0 +1,35 @@
+.TH L3TOL 3 
+.SH NAME
+l3tol, ltol3 \- convert between 3-byte integers and long integers
+.SH SYNOPSIS
+.B l3tol(lp, cp, n)
+.br
+.B long *lp;
+.br
+.B char *cp;
+.PP
+.B ltol3(cp, lp, n)
+.br
+.B char *cp;
+.br
+.B long *lp;
+.SH DESCRIPTION
+.I L3tol
+converts a list of
+.I n
+three-byte integers packed into a character string
+pointed to by 
+.I cp
+into a list of long integers pointed to by
+.IR lp .
+.PP
+.I Ltol3
+performs the reverse conversion from long integers
+.RI ( lp )
+to three-byte integers
+.RI ( cp ).
+.PP
+These functions are useful for file-system maintenance
+where the i-numbers are three bytes long.
+.SH SEE ALSO
+filsys(5)
diff --git a/usr/man/man3/mktemp.3 b/usr/man/man3/mktemp.3
new file mode 100644 (file)
index 0000000..691bae6
--- /dev/null
@@ -0,0 +1,18 @@
+.TH MKTEMP 3 
+.SH NAME
+mktemp \- make a unique file name
+.SH SYNOPSIS
+.B char *mktemp(template)
+.br
+.B char *template;
+.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..611bc95
--- /dev/null
@@ -0,0 +1,86 @@
+.TH MONITOR 3 
+.SH NAME
+monitor \- prepare execution profile
+.SH SYNOPSIS
+.B monitor(lowpc, highpc, buffer, bufsize, nfunc)
+.br
+.B
+int (*lowpc)( ), (*highpc)( );
+.br
+.B short buffer[ ];
+.SH DESCRIPTION
+An executable program created by
+`cc \-p' automatically includes calls for
+.I monitor
+with default parameters;
+.I monitor
+needn't be called explicitly
+except to gain fine control over profiling.
+.PP
+.I Monitor
+is an 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.
+.I Monitor
+arranges to record a histogram of
+periodically sampled values of the program counter,
+and of counts of calls
+of certain functions, in the buffer.
+The lowest address sampled
+is that of
+.I lowpc
+and the highest is
+just below
+.IR highpc .
+At most
+.I nfunc
+call counts can be kept; only calls of functions
+compiled with the profiling option
+.B \-p
+of
+.IR cc (1)
+are recorded.
+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.
+.PP
+To profile the entire program,
+it is sufficient to use
+.PP
+       extern etext();
+.br
+       ...
+.br
+       monitor((int)2, etext, buf, bufsize, nfunc);
+.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.
+.SH FILES
+mon.out
+.SH "SEE ALSO"
+prof(1), profil(2), cc(1)
diff --git a/usr/man/man3/nlist.3 b/usr/man/man3/nlist.3
new file mode 100644 (file)
index 0000000..a318ba2
--- /dev/null
@@ -0,0 +1,45 @@
+.TH NLIST 3 
+.SH NAME
+nlist \- get entries from name list
+.SH SYNOPSIS
+.B #include <a.out.h>
+.br
+.B nlist(filename, nl)
+.br
+.B char *filename;
+.DT
+.nf
+.ft 3
+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 /unix .
+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.
diff --git a/usr/man/man3/perror.3 b/usr/man/man3/perror.3
new file mode 100644 (file)
index 0000000..cd9b7af
--- /dev/null
@@ -0,0 +1,43 @@
+.TH PERROR 3 
+.SH NAME
+perror, sys_errlist, sys_nerr \- system error messages
+.SH SYNOPSIS
+.B perror(s)
+.br
+.B char *s;
+.PP
+.B int sys_nerr;
+.br
+.B char *sys_errlist[];
+.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)
diff --git a/usr/man/man3/plot.3x b/usr/man/man3/plot.3x
new file mode 100644 (file)
index 0000000..fc40ec0
--- /dev/null
@@ -0,0 +1,87 @@
+.TH PLOT 3X 
+.SH NAME
+plot: openpl et al. \- graphics interface
+.SH SYNOPSIS
+.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/puts.3s b/usr/man/man3/puts.3s
new file mode 100644 (file)
index 0000000..7457fbb
--- /dev/null
@@ -0,0 +1,45 @@
+.TH PUTS 3S 
+.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
+.I 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..8a0e69b
--- /dev/null
@@ -0,0 +1,26 @@
+.TH QSORT 3 
+.SH NAME
+qsort \- quicker sort
+.SH SYNOPSIS
+.B qsort(base, nel, width, compar)
+.br
+.B char *base;
+.br
+.B int (*compar)( );
+.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/scanf.3s b/usr/man/man3/scanf.3s
new file mode 100644 (file)
index 0000000..eddd65d
--- /dev/null
@@ -0,0 +1,253 @@
+.TH SCANF 3S 
+.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
+.IR 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/setbuf.3s b/usr/man/man3/setbuf.3s
new file mode 100644 (file)
index 0000000..6d808b0
--- /dev/null
@@ -0,0 +1,48 @@
+.TH SETBUF 3S 
+.SH NAME
+setbuf \- assign buffering to a stream
+.SH SYNOPSIS
+.B #include <stdio.h>
+.PP
+.B setbuf(stream, buf)
+.br
+.SM
+.B FILE
+.B *stream;
+.br
+.B char *buf;
+.SH DESCRIPTION
+.I Setbuf
+is used after a stream has been opened but before it
+is read or written.
+It causes the character array
+.I buf
+to be used instead of an automatically allocated buffer.
+If
+.I buf
+is the constant pointer
+.SM
+.B NULL,
+input/output will be completely unbuffered.
+.PP
+A manifest constant 
+.SM
+.B BUFSIZ
+tells how big an array is needed:
+.PP
+.in +10
+char buf[BUFSIZ];
+.PP
+A buffer is normally obtained from
+.IR  malloc (3)
+upon the first
+.I getc
+or
+.IR  putc (3)
+on the file,
+except that output streams directed to terminals,
+and the standard error stream
+.I stderr
+are normally not buffered.
+.SH "SEE ALSO"
+fopen(3), getc(3), putc(3), malloc(3)
diff --git a/usr/man/man3/setjmp.3 b/usr/man/man3/setjmp.3
new file mode 100644 (file)
index 0000000..aae8841
--- /dev/null
@@ -0,0 +1,41 @@
+.TH SETJMP 3
+.SH NAME
+setjmp, longjmp \- non-local goto
+.SH SYNOPSIS
+.B #include <setjmp.h>
+.PP
+.B setjmp(env)
+.br
+.B jmp_buf env;
+.PP
+.B longjmp(env, val)
+.br
+.B jmp_buf env;
+.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/sin.3m b/usr/man/man3/sin.3m
new file mode 100644 (file)
index 0000000..b94767c
--- /dev/null
@@ -0,0 +1,71 @@
+.TH SIN 3M 
+.SH NAME
+sin, cos, tan, asin, acos, atan, atan2 \- trigonometric functions
+.SH SYNOPSIS
+.B #include <math.h>
+.PP
+.B double sin(x)
+.br
+.B double x;
+.PP
+.B double cos(x)
+.br
+.B double x;
+.PP
+.B double asin(x)
+.br
+.B double x;
+.PP
+.B double acos(x)
+.br
+.B double x;
+.PP
+.B double atan(x)
+.br
+.B double x;
+.PP
+.B double atan2(x, y)
+.br
+.B double x, y;
+.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..dd95735
--- /dev/null
@@ -0,0 +1,26 @@
+.TH SINH 3M
+.SH NAME
+sinh, cosh, tanh \- hyperbolic functions
+.SH SYNOPSIS
+.B #include <math.h>
+.PP
+.B double sinh(x)
+.br
+.B double x;
+.PP
+.B double cosh(x)
+.br
+.B double x;
+.PP
+.B double tanh(x)
+.br
+.B double x;
+.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..a62945c
--- /dev/null
@@ -0,0 +1,23 @@
+.TH SLEEP 3 
+.SH NAME
+sleep \- suspend execution for interval
+.SH SYNOPSIS
+.B sleep(seconds)
+.br
+.B unsigned seconds;
+.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/stdio.3s b/usr/man/man3/stdio.3s
new file mode 100644 (file)
index 0000000..0a8f606
--- /dev/null
@@ -0,0 +1,108 @@
+.TH STDIO 3S 
+.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 Sections 3S constitute an efficient
+user-level buffering scheme.
+The in-line macros
+.I getc
+and
+.IR  putc (3)
+handle characters quickly.
+The higher level routines
+.I "gets, fgets, scanf, fscanf, fread,"
+.I "puts, fputs, printf, fprintf, fwrite"
+all use
+.I getc
+and
+.I 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 (3)
+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 <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:
+.I getc,
+.I getchar,
+.I putc,
+.I putchar,
+.I feof,
+.I ferror,
+.IR fileno .
+.SH "SEE ALSO"
+open(2), close(2), read(2), write(2)
+.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.
diff --git a/usr/man/man3/string.3 b/usr/man/man3/string.3
new file mode 100644 (file)
index 0000000..45a0d69
--- /dev/null
@@ -0,0 +1,106 @@
+.TH STRING 3 
+.SH NAME
+strcat, strcatn, strcmp, strcmpn, strcpy, strcpyn, strlen, index, rindex \- string operations
+.SH SYNOPSIS
+.B char *strcat(s1, s2)
+.br
+.B char *s1, *s2;
+.PP
+.B char *strcatn(s1, s2, n)
+.br
+.B char *s1, *s2;
+.PP
+.B strcmp(s1, s2)
+.br
+.B char *s1, *s2;
+.PP
+.B strcmpn(s1, s2, n)
+.br
+.B char *s1, *s2;
+.PP
+.B char *strcpy(s1, s2)
+.br
+.B char *s1, *s2;
+.PP
+.B char *strcpyn(s1, s2, n)
+.br
+.B char *s1, *s2;
+.PP
+.B strlen(s)
+.br
+.B char *s;
+.PP
+.B char *index(s, c)
+.br
+.B char *s, c;
+.PP
+.B char *rindex(s, c)
+.br
+.B char *s;
+.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 Strcatn
+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 Strcmpn
+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 Strcpyn
+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 PDP11's and VAX-11's, unsigned on other machines.
diff --git a/usr/man/man3/swab.3 b/usr/man/man3/swab.3
new file mode 100644 (file)
index 0000000..7265581
--- /dev/null
@@ -0,0 +1,20 @@
+.TH SWAB 3 
+.SH NAME
+swab \- swap bytes
+.SH SYNOPSIS
+.B swab(from, to, nbytes)
+.br
+.B char *from, *to;
+.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/ungetc.3s b/usr/man/man3/ungetc.3s
new file mode 100644 (file)
index 0000000..a8fecad
--- /dev/null
@@ -0,0 +1,38 @@
+.TH UNGETC 3S 
+.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.