Bell 32V development
authorTom London <tbl@research.uucp>
Mon, 6 Nov 1978 03:55:56 +0000 (22:55 -0500)
committerTom London <tbl@research.uucp>
Mon, 6 Nov 1978 03:55:56 +0000 (22:55 -0500)
Work on file usr/man/man2/access.2
Work on file usr/man/man2/chown.2
Work on file usr/man/man2/dup.2
Work on file usr/man/man2/brk.2
Work on file usr/man/man2/creat.2
Work on file usr/man/man2/chmod.2
Work on file usr/man/man2/acct.2
Work on file usr/man/man2/getuid.2
Work on file usr/man/man2/ioctl.2
Work on file usr/man/man2/fork.2
Work on file usr/man/man2/lseek.2
Work on file usr/man/man2/getpid.2
Work on file usr/man/man2/exit.2
Work on file usr/man/man2/link.2
Work on file usr/man/man2/mknod.2
Work on file usr/man/man2/pause.2
Work on file usr/man/man2/open.2
Work on file usr/man/man2/pipe.2
Work on file usr/man/man2/profil.2
Work on file usr/man/man2/mount.2
Work on file usr/man/man2/nice.2
Work on file usr/man/man2/read.2
Work on file usr/man/man2/times.2
Work on file usr/man/man2/setuid.2
Work on file usr/man/man2/stime.2
Work on file usr/man/man2/sync.2
Work on file usr/man/man2/write.2
Work on file usr/man/man2/unlink.2
Work on file usr/man/man2/umask.2
Work on file usr/man/man2/wait.2
Work on file usr/man/man2/utime.2

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

31 files changed:
usr/man/man2/access.2 [new file with mode: 0644]
usr/man/man2/acct.2 [new file with mode: 0644]
usr/man/man2/brk.2 [new file with mode: 0644]
usr/man/man2/chmod.2 [new file with mode: 0644]
usr/man/man2/chown.2 [new file with mode: 0644]
usr/man/man2/creat.2 [new file with mode: 0644]
usr/man/man2/dup.2 [new file with mode: 0644]
usr/man/man2/exit.2 [new file with mode: 0644]
usr/man/man2/fork.2 [new file with mode: 0644]
usr/man/man2/getpid.2 [new file with mode: 0644]
usr/man/man2/getuid.2 [new file with mode: 0644]
usr/man/man2/ioctl.2 [new file with mode: 0644]
usr/man/man2/link.2 [new file with mode: 0644]
usr/man/man2/lseek.2 [new file with mode: 0644]
usr/man/man2/mknod.2 [new file with mode: 0644]
usr/man/man2/mount.2 [new file with mode: 0644]
usr/man/man2/nice.2 [new file with mode: 0644]
usr/man/man2/open.2 [new file with mode: 0644]
usr/man/man2/pause.2 [new file with mode: 0644]
usr/man/man2/pipe.2 [new file with mode: 0644]
usr/man/man2/profil.2 [new file with mode: 0644]
usr/man/man2/read.2 [new file with mode: 0644]
usr/man/man2/setuid.2 [new file with mode: 0644]
usr/man/man2/stime.2 [new file with mode: 0644]
usr/man/man2/sync.2 [new file with mode: 0644]
usr/man/man2/times.2 [new file with mode: 0644]
usr/man/man2/umask.2 [new file with mode: 0644]
usr/man/man2/unlink.2 [new file with mode: 0644]
usr/man/man2/utime.2 [new file with mode: 0644]
usr/man/man2/wait.2 [new file with mode: 0644]
usr/man/man2/write.2 [new file with mode: 0644]

diff --git a/usr/man/man2/access.2 b/usr/man/man2/access.2
new file mode 100644 (file)
index 0000000..622d2f8
--- /dev/null
@@ -0,0 +1,47 @@
+.TH ACCESS 2 
+.SH NAME
+access \- determine accessibility of file
+.SH SYNOPSIS
+.B access(name, mode)
+.br
+.B char *name;
+.SH DESCRIPTION
+.I Access
+checks the given
+file
+.I name
+for accessibility according to
+.I mode,
+which is 4 (read), 2 (write) or 1 (execute) or a combination thereof.
+Specifying mode 0
+tests whether the directories leading to the file can be
+searched and the file exists.
+.PP
+An appropriate error indication is returned if 
+.I name
+cannot be found or if any
+of the desired access modes would not be granted.
+On disallowed accesses
+\-1 is returned and the error code is in
+.IR errno .
+0 is returned from successful tests.
+.PP
+The user and group IDs with respect to which permission is checked
+are the real UID and GID of the process, so this call is
+useful to set-UID programs.
+.PP
+Notice that it is only access bits that are checked.
+A directory may be announced as writable by
+.I access,
+but an attempt to open it for writing will fail
+(although files may be created there);
+a file may look executable, but
+.I exec
+will fail unless it is in proper format.
+.PP
+.SH SEE ALSO
+stat(2)
+.SH "ASSEMBLER (PDP-11)"
+(access = 33.)
+.br
+.B sys access; name; mode
diff --git a/usr/man/man2/acct.2 b/usr/man/man2/acct.2
new file mode 100644 (file)
index 0000000..ec11103
--- /dev/null
@@ -0,0 +1,36 @@
+.TH ACCT 2 
+.SH NAME
+acct \- turn accounting on or off
+.SH SYNOPSIS
+.B acct(file)
+.br
+.B char *file;
+.SH DESCRIPTION
+The system is prepared to write a record
+in an accounting
+.I file
+for each process as it terminates.
+This
+call, with a null-terminated string naming an existing file
+as argument, turns on accounting;
+records for each terminating process are appended to
+.IR file .
+An argument of 0 causes accounting to be turned off.
+.PP
+The accounting file format is given in
+.IR acct (5).
+.SH "SEE ALSO"
+acct(5), sa(1)
+.SH DIAGNOSTICS
+On error \-1 is returned.
+The file must exist and the call may be exercised only by the super-user.
+It is erroneous to try to turn on accounting when it is already on.
+.SH BUGS
+No accounting is produced for programs running
+when a crash occurs.
+In particular nonterminating programs are never
+accounted for.
+.SH "ASSEMBLER (PDP-11)"
+(acct = 51.)
+.br
+.B sys acct; file
diff --git a/usr/man/man2/brk.2 b/usr/man/man2/brk.2
new file mode 100644 (file)
index 0000000..f4b7d15
--- /dev/null
@@ -0,0 +1,60 @@
+.TH BRK 2 
+.SH NAME
+brk, sbrk, break \- change core allocation
+.SH SYNOPSIS
+.B char *brk(addr)
+.PP
+.B char *sbrk(incr)
+.SH DESCRIPTION
+.I Brk
+sets the system's idea of the lowest location not used by the program
+(called the break)
+to
+.I addr
+(rounded up to the next multiple of 64 bytes
+on the PDP11, 256 bytes on the Interdata 8/32,
+and 512 bytes on a VAX-11).
+Locations not less than
+.I addr
+and below the stack pointer
+are not in the address space and will thus
+cause a memory violation if accessed.
+.PP
+In the alternate function
+.I sbrk,
+.I incr
+more bytes are added to the
+program's data space and a pointer to the
+start of the new area is returned.
+.PP
+When a program begins execution via
+.I exec
+the break is set at the
+highest location defined by the program
+and data storage areas.
+Ordinarily, therefore, only programs with growing
+data areas need to use
+.IR break .
+.SH "SEE ALSO"
+exec(2),
+malloc(3),
+end(3)
+.SH DIAGNOSTICS
+Zero is returned if the break could be set;
+\-1 if the program requests more
+memory than the system limit
+or if too many segmentation
+registers would be required to implement the break.
+.SH BUGS
+Setting the break in the range
+0177701 to 0177777 (on the PDP11) is the same as setting it to zero.
+.SH "ASSEMBLER (PDP-11)"
+(break = 17.)
+.br
+.B sys break; addr
+.PP
+.I Break
+performs the function of
+.IR brk .
+The name of the routine differs from that in C
+for historical reasons.
diff --git a/usr/man/man2/chmod.2 b/usr/man/man2/chmod.2
new file mode 100644 (file)
index 0000000..1b4410d
--- /dev/null
@@ -0,0 +1,56 @@
+.TH CHMOD 2 
+.SH NAME
+chmod \- change mode of file
+.SH SYNOPSIS
+.B chmod(name, mode)
+.br
+.B char *name;
+.SH DESCRIPTION
+The file whose name
+is given as the null-terminated string pointed to by
+.I name
+has its mode changed to
+.IR mode .
+Modes are constructed by ORing together some
+combination of the following:
+.PP
+.RS
+ 04000 set user ID on execution
+ 02000 set group ID on execution
+ 01000 save text image after execution
+ 00400 read by owner
+ 00200 write by owner
+ 00100 execute (search on directory) by owner
+ 00070 read, write, execute (search) by group
+ 00007 read, write, execute (search) by others
+.RE
+.PP
+If an executable file is set up for sharing
+(\fB\-n\fR option of
+.IR ld (1))
+then mode 1000 prevents the system from
+abandoning the swap-space image of the program-text portion
+of the file when its last user
+terminates.
+Thus when the next user of the file executes it,
+the text need not be read from the file
+system but can simply be swapped in,
+saving time.
+Ability to set this bit is restricted to the super-user
+since swap space is consumed
+by the images; it is only worth while for heavily used commands.
+.PP
+Only the owner of a file (or the super-user) may change the mode.
+Only the super-user can set the 1000 mode.
+.SH "SEE ALSO"
+chmod(1)
+.SH DIAGNOSTIC
+Zero is returned if the mode is changed;
+\-1 is returned if
+.I name
+cannot be found or if current user
+is neither the owner of the file nor the super-user.
+.SH "ASSEMBLER (PDP-11)"
+(chmod = 15.)
+.br
+.B sys chmod; name; mode
diff --git a/usr/man/man2/chown.2 b/usr/man/man2/chown.2
new file mode 100644 (file)
index 0000000..376acf7
--- /dev/null
@@ -0,0 +1,32 @@
+.TH CHOWN 2 
+.SH NAME
+chown \- change owner and group of a file
+.SH SYNOPSIS
+.B chown(name, owner, group)
+.br
+.B char *name;
+.SH DESCRIPTION
+The file
+whose name is given by the null-terminated string pointed
+to by
+.I name
+has its
+.I owner
+and 
+.I group
+changed as specified.
+Only the super-user may
+execute this call,
+because if users were able to give files away,
+they could defeat the (nonexistent)
+file-space accounting procedures.
+.SH "SEE ALSO"
+chown(1), passwd(5)
+.SH DIAGNOSTICS
+Zero is returned if the owner is changed;
+\-1 is returned
+on illegal owner changes.
+.SH "ASSEMBLER (PDP-11)"
+(chown = 16.)
+.br
+.B sys chown; name; owner; group
diff --git a/usr/man/man2/creat.2 b/usr/man/man2/creat.2
new file mode 100644 (file)
index 0000000..3dc9dfe
--- /dev/null
@@ -0,0 +1,61 @@
+.TH CREAT 2 
+.SH NAME
+creat  \-  create a new file
+.SH SYNOPSIS
+.B creat(name, mode)
+.br
+.B char *name;
+.SH DESCRIPTION
+.I Creat
+creates a new file or prepares to rewrite an existing
+file called 
+.I name,
+given as the address of a null-terminated string.
+If the file did not exist, it is given
+mode
+.IR mode ,
+as modified by the process's mode mask (see
+.IR umask (2)).
+Also see
+.IR  chmod (2)
+for the
+construction of the
+.I mode
+argument.
+.PP
+If the file did exist, its mode and owner remain unchanged
+but it is truncated to 0 length.
+.PP
+The file is also opened for writing, and its file descriptor
+is returned.
+.PP
+The
+.I mode
+given is arbitrary; it need not allow
+writing.
+This feature is used by programs which deal with temporary
+files of fixed names.
+The creation is done with
+a mode that forbids writing.
+Then if a second
+instance of the program attempts a
+.I creat,
+an error is
+returned and the program knows that the name is unusable
+for the moment.
+.SH "SEE ALSO"
+write(2), close(2), chmod(2), umask (2)
+.SH DIAGNOSTICS
+The value \-1 is returned if:
+a needed directory is not searchable;
+the file does not exist and the directory
+in which it is to be created is not writable; the file
+does exist and is unwritable;
+the file is a directory;
+there are already too many files open.
+.SH "ASSEMBLER (PDP-11)"
+(creat = 8.)
+.br
+.B sys creat; name; mode
+.br
+(file descriptor in r0)
diff --git a/usr/man/man2/dup.2 b/usr/man/man2/dup.2
new file mode 100644 (file)
index 0000000..c57c9f6
--- /dev/null
@@ -0,0 +1,62 @@
+.TH DUP 2 
+.SH NAME
+dup, dup2 \- duplicate an open file descriptor
+.SH SYNOPSIS
+.B dup(fildes)
+.br
+.B int fildes;
+.PP
+.B dup2(fildes, fildes2)
+.br
+.B int fildes, fildes2;
+.SH DESCRIPTION
+Given
+a file descriptor returned from
+an
+.I open,
+.I pipe,
+or
+.I creat
+call,
+.I dup
+allocates another file descriptor
+synonymous
+with
+the original.
+The new file descriptor is returned.
+.PP
+In the second form of the call,
+.I fildes
+is a file descriptor referring to an open file, and
+.I fildes2
+is a non-negative integer less than the maximum value
+allowed for file descriptors (approximately 19).
+.I Dup2
+causes
+.I fildes2
+to refer to the same file as
+.I fildes.
+If
+.I fildes2
+already referred to an open file, it is closed first.
+.SH "SEE ALSO"
+creat(2), open(2), close(2), pipe(2)
+.SH DIAGNOSTICS
+The value \-1 is returned if:
+the given file descriptor is invalid;
+there are already too many open files.
+.SH "ASSEMBLER (PDP-11)"
+(dup = 41.)
+.br
+(file descriptor in r0)
+.br
+(new file descriptor in r1)
+.br
+.B sys dup
+.br
+(file descriptor in r0)
+.PP
+The
+.I dup2
+entry is implemented by adding 0100 to
+.I fildes.
diff --git a/usr/man/man2/exit.2 b/usr/man/man2/exit.2
new file mode 100644 (file)
index 0000000..6dd30aa
--- /dev/null
@@ -0,0 +1,39 @@
+.TH EXIT 2 
+.SH NAME
+exit \- terminate process
+.SH SYNOPSIS
+.B exit(status)
+.br
+.B int status;
+.PP
+.B _exit(status)
+.br
+.B int status;
+.SH DESCRIPTION
+.I Exit
+is the normal means of terminating a process.
+.I Exit
+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.
+.PP
+This call can never return.
+.PP
+The C function
+.I exit
+may cause cleanup actions before the
+final `sys exit'.
+The function
+.I _exit
+circumvents all cleanup.
+.SH "SEE ALSO"
+wait(2)
+.SH "ASSEMBLER (PDP-11)"
+(exit = 1.)
+.br
+(status in r0)
+.br
+.B sys exit
diff --git a/usr/man/man2/fork.2 b/usr/man/man2/fork.2
new file mode 100644 (file)
index 0000000..4b62b2d
--- /dev/null
@@ -0,0 +1,48 @@
+.TH FORK 2 
+.SH NAME
+fork  \-  spawn new process
+.SH SYNOPSIS
+.B fork( )
+.SH DESCRIPTION
+.I Fork
+is the only way new processes are created.
+The new process's core image is a copy of
+that of the caller of
+.IR fork .
+The only distinction
+is the fact
+that the value returned in the old (parent) process
+contains the process ID
+of the new (child) process,
+while the value returned in the child is 0.
+Process ID's range from 1 to 30,000.
+This process ID is used by
+.IR wait (2).
+.PP
+Files open before the fork
+are shared, and have a common read-write pointer.
+In particular,
+this is the way that standard input and output
+files are passed and also how
+pipes are set up.
+.SH "SEE ALSO"
+wait(2), exec(2)
+.SH DIAGNOSTICS
+Returns \-1 and fails to create a process if:
+there is inadequate swap space,
+the user is not super-user and has too many processes,
+or the system's process table is full.
+Only the super-user can take the last process-table slot.
+.SH "ASSEMBLER (PDP-11)"
+(fork = 2.)
+.br
+.B sys fork
+.br
+(new process return)
+.br
+(old process return, new process ID in r0)
+.PP
+The return locations in the old and new process
+differ by one word.
+The C-bit is set in the old process if a new
+process could not be created.
diff --git a/usr/man/man2/getpid.2 b/usr/man/man2/getpid.2
new file mode 100644 (file)
index 0000000..46becdc
--- /dev/null
@@ -0,0 +1,21 @@
+.TH GETPID 2 
+.SH NAME
+getpid  \-  get process identification
+.SH SYNOPSIS
+.B getpid( )
+.SH DESCRIPTION
+.I Getpid
+returns
+the process ID of
+the current process.
+Most often it is used to generate
+uniquely-named
+temporary files.
+.SH "SEE ALSO"
+mktemp(3)
+.SH "ASSEMBLER (PDP-11)"
+(getpid = 20.)
+.br
+.B sys getpid
+.br
+(pid in r0)
diff --git a/usr/man/man2/getuid.2 b/usr/man/man2/getuid.2
new file mode 100644 (file)
index 0000000..2d1bbb3
--- /dev/null
@@ -0,0 +1,40 @@
+.TH GETUID 2 
+.SH NAME
+getuid, getgid, geteuid, getegid \- get user and group identity
+.SH SYNOPSIS
+.B getuid( )
+.PP
+.B geteuid( )
+.PP
+.B getgid( )
+.PP
+.B getegid( )
+.SH DESCRIPTION
+.I Getuid
+returns the real user ID of the current process,
+.I geteuid
+the effective user ID.
+The real user ID identifies the person who is logged in,
+in contradistinction to the effective user ID, which
+determines his access permission at the moment.
+It is thus useful to programs which operate using
+the `set user ID' mode, to find out who invoked them.
+.PP
+.I Getgid
+returns the real group ID,
+.I getegid
+the effective group ID.
+.SH "SEE ALSO"
+setuid(2)
+.SH "ASSEMBLER (PDP-11)"
+(getuid = 24.)
+.br
+.B sys getuid
+.br
+(real user ID in r0, effective user ID in r1)
+.PP
+(getgid = 47.)
+.br
+.B sys getgid
+.br
+(real group ID in r0, effective group ID in r1)
diff --git a/usr/man/man2/ioctl.2 b/usr/man/man2/ioctl.2
new file mode 100644 (file)
index 0000000..5350611
--- /dev/null
@@ -0,0 +1,91 @@
+.TH IOCTL 2 
+.SH NAME
+ioctl, stty, gtty \- control device
+.SH SYNOPSIS
+.B #include <sgtty.h>
+.PP
+.B ioctl(fildes, request, argp)
+.br
+.B struct sgttyb *argp;
+.PP
+.B stty(fildes, argp)
+.br
+.B struct sgttyb *argp;
+.PP
+.B gtty(fildes, argp)
+.br
+.B struct sgttyb *argp;
+.SH DESCRIPTION
+.I Ioctl
+performs a variety of functions
+on character special files (devices).
+The writeups of various devices
+in section 4 discuss how
+.I ioctl
+applies to them.
+.PP
+For certain status setting and status inquiries
+about terminal devices, the functions
+.I stty
+and
+.I gtty
+are equivalent to
+.RS
+.B ioctl(fildes, TIOCSETP, argp)
+.br
+.B ioctl(fildes, TIOCGETP, argp)
+.RE
+.LP
+respectively; see
+.IR tty (4).
+.PP
+The following two calls, however, apply to any open file:
+.PP
+.RS
+.B ioctl(fildes, FIOCLEX, NULL);
+.br
+.B ioctl(fildes, FIONCLEX, NULL);
+.RE
+.LP
+The first causes the file to be closed automatically during
+a successful
+.I exec
+operation;
+the second reverses the effect of the first.
+.SH "SEE ALSO"
+stty(1), tty(4), exec(2)
+.SH DIAGNOSTICS
+Zero is returned if the call was successful;
+\-1 if the file descriptor does not refer to
+the kind of file for which it was intended.
+.SH BUGS
+Strictly speaking,
+since 
+.I ioctl
+may be extended in different ways to devices with
+different properties,
+.I argp
+should have an open-ended declaration like
+.IP
+.B union { struct sgttyb
+.RB ... ;
+\&...
+.B } *argp;
+.PP
+The important thing is that the size is fixed by `struct sgttyb'.
+.SH "ASSEMBLER (PDP-11)"
+(ioctl = 54.)
+.br
+.B sys ioctl; fildes; request; argp
+.PP
+(stty = 31.)
+.br
+(file descriptor in r0)
+.br
+.B stty; argp
+.PP
+(gtty = 32.)
+.br
+(file descriptor in r0)
+.br
+.B sys gtty; argp
diff --git a/usr/man/man2/link.2 b/usr/man/man2/link.2
new file mode 100644 (file)
index 0000000..1225830
--- /dev/null
@@ -0,0 +1,35 @@
+.TH LINK 2 
+.SH NAME
+link \- link to a file
+.SH SYNOPSIS
+.B link(name1, name2)
+.br
+.B char *name1, *name2;
+.SH DESCRIPTION
+A link
+to
+.I name1
+is created;
+the link has the name
+.IR name2 .
+Either name may be an arbitrary path name.
+.SH "SEE ALSO"
+ln(1), unlink(2)
+.SH DIAGNOSTICS
+Zero is returned when a link is made;
+\-1 is returned when
+.I name1
+cannot be found; when
+.I name2
+already exists; when the directory of
+.I name2
+cannot be written; when
+an attempt is made to link to a directory by a user
+other than the super-user;
+when an attempt is made to link
+to a file on another file system;
+when a file has too many links.
+.SH "ASSEMBLER (PDP-11)"
+(link = 9.)
+.br
+.B sys link; name1; name2
diff --git a/usr/man/man2/lseek.2 b/usr/man/man2/lseek.2
new file mode 100644 (file)
index 0000000..da25318
--- /dev/null
@@ -0,0 +1,66 @@
+.TH LSEEK 2 
+.SH NAME
+lseek, tell \- move read/write pointer
+.SH SYNOPSIS
+.B long lseek(fildes, offset, whence)
+.br
+.B long offset;
+.PP
+.B long tell(fildes)
+.SH DESCRIPTION
+The file
+descriptor refers to a file open for reading or writing.
+The read (resp. write) pointer for the file is set as follows:
+.IP
+If
+.I whence
+is 0, the pointer is set to
+.I offset
+bytes.
+.IP
+If
+.I whence
+is 1, the pointer is set to its current location plus
+.IR offset .
+.IP
+If
+.I whence
+is 2, the pointer is set to the size of the
+file plus
+.IR offset .
+.PP
+The returned value is the resulting pointer location.
+.PP
+The obsolete function
+.IR tell ( fildes )
+is identical to
+.IR lseek ( "fildes, 0L, 1" ).
+.PP
+Seeking far beyond the end of a file, then writing,
+creates a gap or `hole', which occupies no
+physical space and reads as zeros.
+.SH "SEE ALSO"
+open(2), creat(2), fseek(3)
+.SH DIAGNOSTICS
+\-1
+is returned for
+an undefined file descriptor,
+seek on a pipe,
+or seek to a position before the beginning of file.
+.SH BUGS
+.I Lseek
+is a no-op on character special files.
+.SH "ASSEMBLER (PDP-11)"
+(lseek = 19.)
+.br
+(file descriptor in r0)
+.br
+.B sys lseek; offset1; offset2; whence
+.PP
+.I Offset1
+and
+.I offset2
+are the high and low words of 
+.IR offset ;
+r0 and r1 contain
+the pointer upon return.
diff --git a/usr/man/man2/mknod.2 b/usr/man/man2/mknod.2
new file mode 100644 (file)
index 0000000..76042e5
--- /dev/null
@@ -0,0 +1,42 @@
+.TH MKNOD 2 
+.SH NAME
+mknod \- make a directory or a special file
+.SH SYNOPSIS
+.B mknod(name, mode, addr)
+.br
+.B char *name;
+.SH DESCRIPTION
+.I Mknod
+creates a new file
+whose name is the null-terminated string pointed
+to by
+.IR name .
+The mode of the new file
+(including directory and special file bits)
+is initialized from
+.IR mode .
+(The protection part of the mode
+is modified by the process's mode mask; see
+.IR umask (2)).
+The first block pointer of the i-node
+is initialized from
+.IR addr .
+For ordinary files and directories
+.I addr
+is normally zero.
+In the case of a special file,
+.I addr
+specifies which special file.
+.PP
+.I Mknod
+may be invoked only by the super-user.
+.SH "SEE ALSO"
+mkdir(1), mknod(1), filsys(5)
+.SH DIAGNOSTICS
+Zero is returned if the file has been made; \-1
+if the file already exists
+or if the user is not the super-user.
+.SH "ASSEMBLER (PDP-11)"
+(mknod = 14.)
+.br
+.B sys  mknod; name; mode; addr
diff --git a/usr/man/man2/mount.2 b/usr/man/man2/mount.2
new file mode 100644 (file)
index 0000000..e968ee0
--- /dev/null
@@ -0,0 +1,88 @@
+.TH MOUNT 2 
+.SH NAME
+mount, umount \- mount or remove file system
+.SH SYNOPSIS
+.B mount(special, name, rwflag)
+.br
+.B char *special, *name;
+.PP
+.B umount(special)
+.br
+.B char *special;
+.SH DESCRIPTION
+.I Mount
+announces to the system that a removable file system has
+been mounted on
+the block-structured special file
+.I special;
+from now on, references to file
+.I name
+will refer to
+the root file on the newly mounted file system.
+.I Special
+and
+.I name
+are pointers to null-terminated strings
+containing the appropriate path names.
+.PP
+.I Name
+must exist already. 
+.I Name
+must be a directory (unless the root of the mounted file system
+is not a directory).
+Its old contents
+are inaccessible while the file system
+is mounted.
+.PP
+The
+.I rwflag
+argument determines whether
+the file system can be written on; if it is 0 writing
+is allowed, if non-zero no writing is done.
+Physically write-protected and magnetic
+tape file systems must be mounted read-only or
+errors will occur when access times are updated,
+whether or not any
+explicit write is attempted.
+.PP
+.I Umount
+announces to the system that the
+.I special
+file is no longer to contain a removable file system.
+The associated file reverts to its ordinary interpretation.
+.SH "SEE ALSO"
+mount(1)
+.SH DIAGNOSTICS
+.I Mount
+returns 0 if the action occurred; \-1 if
+.I special
+is inaccessible or not an appropriate file; if
+.I name
+does not exist; if
+.I special
+is already mounted; if
+.I name
+is in use; or if
+there are already too many
+file systems mounted.
+.PP
+.I Umount
+returns 0 if the action occurred; \-1 if
+if the special file is inaccessible or
+does not have a mounted file system,
+or if there are active files in the mounted 
+file system.
+.SH BUGS
+If a file containing holes
+(unallocated blocks)
+is read, even on a file system mounted read-only,
+the system will attempt to fill in the holes
+by writing on the device.
+.SH "ASSEMBLER (PDP-11)"
+(mount = 21.)
+.br
+.B sys  mount; special; name; rwflag
+.PP
+(umount = 22.)
+.br
+.B sys  umount; special
diff --git a/usr/man/man2/nice.2 b/usr/man/man2/nice.2
new file mode 100644 (file)
index 0000000..29f088f
--- /dev/null
@@ -0,0 +1,39 @@
+.TH NICE 2 
+.SH NAME
+nice \- set program priority
+.SH SYNOPSIS
+.B nice(incr)
+.SH DESCRIPTION
+The scheduling
+priority of the process is augmented by
+.IR incr .
+Positive priorities get less
+service than normal.
+Priority 10 is recommended to users
+who wish to execute long-running programs
+without flak from the administration.
+.PP
+Negative increments are ignored except on behalf of 
+the super-user.
+The priority is limited to the range
+\-20 (most urgent) to 20 (least).
+.PP
+The priority of a process is
+passed to a child process by
+.IR fork (2).
+For a privileged process to return to normal priority
+from an unknown state,
+.I nice
+should be called successively with arguments
+\-40 (goes to priority \-20 because of truncation),
+20 (to get to 0),
+then 0 (to maintain compatibility with previous versions
+of this call).
+.SH "SEE ALSO"
+nice(1)
+.SH "ASSEMBLER (PDP-11)"
+(nice = 34.)
+.br
+(priority in r0)
+.br
+.B sys nice
diff --git a/usr/man/man2/open.2 b/usr/man/man2/open.2
new file mode 100644 (file)
index 0000000..816685f
--- /dev/null
@@ -0,0 +1,42 @@
+.TH OPEN 2 
+.SH NAME
+open \- open for reading or writing
+.SH SYNOPSIS
+.B open(name, mode)
+.br
+.B char *name;
+.SH DESCRIPTION
+.I Open
+opens the file
+.I name
+for reading
+(if
+.I mode
+is 0),
+writing (if
+.I mode
+is 1) or for both reading and writing
+(if
+.I mode
+is 2).
+.I Name
+is the address of a string of ASCII characters representing
+a path name, terminated by a null character.
+.PP
+The file is positioned at the beginning (byte 0).
+The returned file descriptor must be used for subsequent calls
+for other input-output functions on the file.
+.SH "SEE ALSO"
+creat(2), read(2), write(2), dup(2), close(2)
+.SH DIAGNOSTICS
+The value \-1 is returned
+if the file does not exist,
+if one of the necessary directories
+does not exist or is unreadable, if the file is not
+readable (resp. writable), or if too many files are open.
+.SH "ASSEMBLER (PDP-11)"
+(open = 5.)
+.br
+.B sys open; name; mode
+.br
+(file descriptor in r0)
diff --git a/usr/man/man2/pause.2 b/usr/man/man2/pause.2
new file mode 100644 (file)
index 0000000..d9c4866
--- /dev/null
@@ -0,0 +1,19 @@
+.TH PAUSE 2 
+.SH NAME
+pause \- stop until signal
+.SH SYNOPSIS
+.B pause( )
+.SH DESCRIPTION
+.I Pause
+never returns normally.
+It is used to give up control while waiting for
+a signal from
+.IR kill (2)
+or
+.IR alarm (2).
+.SH SEE ALSO
+kill(1), kill(2), alarm(2), signal(2), setjmp(3)
+.SH "ASSEMBLER (PDP-11)"
+(pause = 29.)
+.br
+.B sys pause
diff --git a/usr/man/man2/pipe.2 b/usr/man/man2/pipe.2
new file mode 100644 (file)
index 0000000..5de1c56
--- /dev/null
@@ -0,0 +1,62 @@
+.TH PIPE 2 
+.SH NAME
+pipe \- create an interprocess channel
+.SH SYNOPSIS
+.B pipe(fildes)
+.br
+.B int fildes[2];
+.SH DESCRIPTION
+The
+.I pipe
+system call
+creates an I/O mechanism called a pipe.
+The file descriptors returned can
+be used in read and write operations.
+When the pipe is written using the descriptor
+.IR fildes [1]
+up to 4096 bytes of data are buffered
+before the writing process is suspended.
+A read using the descriptor
+.IR fildes [0]
+will pick up the data.
+.PP
+It is assumed that after the
+pipe has been set up,
+two (or more)
+cooperating processes
+(created by subsequent
+.I fork
+calls)
+will pass data through the
+pipe with
+.I read
+and
+.I write
+calls.
+.PP
+The Shell has a syntax
+to set up a linear array of processes
+connected by pipes.
+.PP
+Read calls on an empty
+pipe (no buffered data) with only one end
+(all write file descriptors closed)
+returns an end-of-file.
+.SH "SEE ALSO"
+sh(1), read(2), write(2), fork(2)
+.SH DIAGNOSTICS
+The function value zero is returned if the
+pipe was created; \-1 if
+too many files are already open.
+A signal is generated if a write on a pipe with only one end is attempted.
+.SH BUGS
+Should more than 4096 bytes be necessary in any
+pipe among a loop of processes, deadlock will occur.
+.SH "ASSEMBLER (PDP-11)"
+(pipe = 42.)
+.br
+.B sys pipe
+.br
+(read file descriptor in r0)
+.br
+(write file descriptor in r1)
diff --git a/usr/man/man2/profil.2 b/usr/man/man2/profil.2
new file mode 100644 (file)
index 0000000..e9a24a4
--- /dev/null
@@ -0,0 +1,55 @@
+.TH PROFIL 2 
+.SH NAME
+profil \- execution time profile
+.SH SYNOPSIS
+.B profil(buff, bufsiz, offset, scale)
+.br
+.B char *buff;
+.br
+.B int bufsiz, offset, scale;
+.SH DESCRIPTION
+.I Buff
+points to an area of core whose length (in bytes) is given by
+.IR bufsiz .
+After this call, the user's program counter (pc)
+is examined each clock tick (60th second);
+.I offset
+is subtracted from it, and the result multiplied by
+.IR scale .
+If the resulting number corresponds to a word
+inside
+.I buff,
+that word is incremented.
+.PP
+The scale is interpreted as an unsigned,
+fixed-point fraction with binary point at the
+left: 0177777(8) gives a 1-1 mapping of pc's to words
+in
+.I buff;
+077777(8) maps each pair of instruction words
+together.
+02(8) maps all instructions onto the beginning of
+.I buff
+(producing a non-interrupting core clock).
+.PP
+Profiling is turned off by giving a
+.I scale
+of 0 or 1.
+It is rendered
+ineffective by giving a
+.I bufsiz
+of 0.
+Profiling is turned off when an
+.I exec
+is executed, but remains on in child and parent both
+after a
+.IR fork .
+Profiling may be turned off if an update in
+.I buff
+would cause a memory fault.
+.SH "SEE ALSO"
+monitor(3), prof(1)
+.SH "ASSEMBLER (PDP-11)"
+(profil = 44.)
+.br
+.B sys profil; buff; bufsiz; offset; scale
diff --git a/usr/man/man2/read.2 b/usr/man/man2/read.2
new file mode 100644 (file)
index 0000000..ab3e2a6
--- /dev/null
@@ -0,0 +1,51 @@
+.TH READ 2 
+.SH NAME
+read \- read from file
+.SH SYNOPSIS
+.B read(fildes, buffer, nbytes)
+.br
+.B char *buffer;
+.SH DESCRIPTION
+A file descriptor is a word
+returned from a successful
+.I "open, creat, dup,"
+or
+.I pipe
+call.
+.I Buffer
+is the location of
+.I nbytes
+contiguous
+bytes into which the input will be placed.
+It is not guaranteed
+that all
+.I nbytes
+bytes will be read; for example
+if the file refers to a typewriter at most one line
+will be returned.
+In any event the number of characters read is returned.
+.PP
+If the returned value is 0, then
+end-of-file has been reached.
+.SH "SEE ALSO"
+open(2), creat(2), dup(2), pipe(2)
+.SH DIAGNOSTICS
+As mentioned,
+0 is returned when the end of the file has been reached.
+If the read was otherwise unsuccessful
+the return value is \-1.
+Many conditions
+can generate an error:
+physical I/O errors, bad buffer address,
+preposterous
+.I nbytes,
+file descriptor not that of
+an input file.
+.SH "ASSEMBLER (PDP-11)"
+(read = 3.)
+.br
+(file descriptor in r0)
+.br
+.B sys read; buffer; nbytes
+.br
+(byte count in r0)
diff --git a/usr/man/man2/setuid.2 b/usr/man/man2/setuid.2
new file mode 100644 (file)
index 0000000..69e25d8
--- /dev/null
@@ -0,0 +1,30 @@
+.TH SETUID 2 
+.SH NAME
+setuid, setgid \- set user and group ID
+.SH SYNOPSIS
+.B setuid(uid)
+.PP
+.B setgid(gid)
+.SH DESCRIPTION
+The user ID (group ID) of the current process is set to
+the argument.
+Both the effective and the real ID are set.
+These calls are only permitted to the super-user
+or if the argument is the real ID.
+.SH "SEE ALSO"
+getuid(2)
+.SH DIAGNOSTICS
+Zero is returned if the user (group) ID is set;
+\-1 is returned otherwise.
+.SH "ASSEMBLER (PDP-11)"
+(setuid = 23.)
+.br
+(user ID in r0)
+.br
+.B sys setuid
+.PP
+(setgid = 46.)
+.br
+(group ID in r0)
+.br
+.B sys  setgid
diff --git a/usr/man/man2/stime.2 b/usr/man/man2/stime.2
new file mode 100644 (file)
index 0000000..22c6662
--- /dev/null
@@ -0,0 +1,26 @@
+.TH STIME 2 
+.SH NAME
+stime \- set time
+.SH SYNOPSIS
+.B stime(tp)
+.br
+.B long *tp;
+.SH DESCRIPTION
+.I Stime
+sets the system's idea of the time and date.
+Time, pointed to by
+.I tp,
+is measured in seconds from 0000 GMT Jan 1, 1970.
+Only the super-user may use this call.
+.SH "SEE ALSO"
+date(1), time(2), ctime(3)
+.SH DIAGNOSTICS
+Zero is returned if the time was set;
+\-1 if user is not the super-user.
+.SH "ASSEMBLER (PDP-11)"
+(stime = 25.)
+.br
+(time in r0-r1)
+.br
+.B sys stime
+.PP
diff --git a/usr/man/man2/sync.2 b/usr/man/man2/sync.2
new file mode 100644 (file)
index 0000000..ff0075b
--- /dev/null
@@ -0,0 +1,27 @@
+.TH SYNC 2 
+.SH NAME
+sync \- update super-block
+.SH SYNOPSIS
+.B sync( )
+.SH DESCRIPTION
+.I Sync
+causes all information in core
+memory that should be on disk to be written out.
+This includes modified super blocks,
+modified i-nodes, and delayed block I/O.
+.PP
+It should be used by programs which examine a file system,
+for example
+.I "icheck, df,"
+etc.
+It is mandatory before a boot.
+.SH "SEE ALSO"
+sync(1), update(8)
+.SH BUGS
+The writing, although scheduled, is not necessarily
+complete upon return from 
+.IR sync .
+.SH "ASSEMBLER (PDP-11)"
+(sync = 36.)
+.br
+.B sys sync
diff --git a/usr/man/man2/times.2 b/usr/man/man2/times.2
new file mode 100644 (file)
index 0000000..c8dd57c
--- /dev/null
@@ -0,0 +1,35 @@
+.TH TIMES 2 
+.SH NAME
+times \- get process times
+.SH SYNOPSIS
+.B times(buffer)
+.br
+.B struct tbuffer *buffer;
+.SH DESCRIPTION
+.I Times
+returns time-accounting information
+for the current process
+and for the terminated child processes
+of the current process.
+All times are in 1/60 seconds.
+.PP
+After the call, the buffer will appear as follows:
+.PP
+.nf
+struct tbuffer {
+       long    proc_user_time;
+       long    proc_system_time;
+       long    child_user_time;
+       long    child_system_time;
+};
+.PP
+.fi
+The children times are the sum
+of the children's process times and
+their children's times.
+.SH "SEE ALSO"
+time(1), time(2)
+.SH "ASSEMBLER (PDP-11)"
+(times = 43.)
+.br
+.B sys times; buffer
diff --git a/usr/man/man2/umask.2 b/usr/man/man2/umask.2
new file mode 100644 (file)
index 0000000..b995e36
--- /dev/null
@@ -0,0 +1,30 @@
+.TH UMASK 2
+.SH NAME
+umask \- set file creation mode mask
+.SH SYNOPSIS
+.B umask(complmode)
+.SH DESCRIPTION
+.I Umask
+sets a mask used whenever a file is created by
+.IR creat (2)
+or
+.IR mknod (2):
+the actual mode (see
+.IR chmod (2))
+of the newly-created file is the logical
+.B and
+of the given mode and the complement of the argument.
+Only the low-order 9 bits of the mask (the protection bits)
+participate.
+In other words, the mask shows the bits to be turned off
+when files are created.
+.PP
+The previous value of the mask is returned by the call.
+The value is initially 0 (no restrictions).
+The mask is inherited by child processes.
+.SH SEE ALSO
+creat(2), mknod(2), chmod(2)
+.SH "ASSEMBLER (PDP-11)"
+(umask = 60.)
+.br
+.B sys umask; complmode
diff --git a/usr/man/man2/unlink.2 b/usr/man/man2/unlink.2
new file mode 100644 (file)
index 0000000..d94d693
--- /dev/null
@@ -0,0 +1,34 @@
+.TH UNLINK 2 
+.SH NAME
+unlink \- remove directory entry
+.SH SYNOPSIS
+.B unlink(name)
+.br
+.B char *name;
+.SH DESCRIPTION
+.I Name
+points to a null-terminated string.
+.I Unlink
+removes the entry for the file pointed to by
+.I name
+from its directory.
+If this entry was the last link to the file,
+the contents of the file are freed and the file is destroyed.
+If, however, the file was open in any process, the actual
+destruction is delayed until it is closed, even though
+the directory entry has disappeared.
+.SH "SEE ALSO"
+rm(1), link(2)
+.SH DIAGNOSTICS
+Zero is normally returned;
+\-1 indicates that the file does not
+exist, that its directory cannot be written,
+or that the file contains pure procedure text
+that is currently in use.
+Write permission is not required on the file itself.
+It is also illegal to unlink a directory
+(except for the super-user).
+.SH "ASSEMBLER (PDP-11)"
+(unlink = 10.)
+.br
+.B sys  unlink; name
diff --git a/usr/man/man2/utime.2 b/usr/man/man2/utime.2
new file mode 100644 (file)
index 0000000..1a47e79
--- /dev/null
@@ -0,0 +1,31 @@
+.TH UTIME 2
+.SH NAME
+utime \- set file times
+.SH SYNOPSIS
+.B #include <sys/types.h>
+.br
+.B utime(file, timep)
+.br
+.B char *file;
+.br
+.B time_t timep[2];
+.SH DESCRIPTION
+The
+.I utime
+call
+uses the
+`accessed' and `updated' times in that order
+from the
+.I timep
+vector
+to set the corresponding recorded times for
+.I file.
+.PP
+The caller must be the owner of the file or the super-user.
+The `inode-changed' time of the file is set to the current time.
+.SH SEE ALSO
+stat (2)
+.SH "ASSEMBLER (PDP-11)"
+(utime = 30.)
+.br
+.B sys utime; file; timep
diff --git a/usr/man/man2/wait.2 b/usr/man/man2/wait.2
new file mode 100644 (file)
index 0000000..eeeda74
--- /dev/null
@@ -0,0 +1,70 @@
+.TH WAIT 2 
+.SH NAME
+wait \- wait for process to terminate
+.SH SYNOPSIS
+.B wait(status)
+.br
+.B int *status;
+.PP
+.B wait(0)
+.SH DESCRIPTION
+.I Wait
+causes its caller to delay until a signal is received or
+one of its child
+processes terminates.
+If any child has died since the last
+.I wait,
+return is immediate;
+if there are no children, return is immediate with
+the error bit set
+(resp. with a value of \-1 returned).
+The normal return yields the process ID of the terminated child.
+In the case of several children several
+.I wait
+calls are needed
+to learn of all the deaths.
+.PP
+If
+.RI (int) status
+is nonzero, the high byte of the word pointed to
+receives the low byte of the
+argument of
+.I exit
+when the child terminated.
+The low byte
+receives the termination status
+of the process.
+See
+.IR signal (2)
+for a list of termination statuses (signals);
+0 status indicates normal termination.
+A special status (0177) is returned for a stopped process
+which has not terminated and can be restarted.
+See
+.IR ptrace (2).
+If the 0200 bit of the termination status
+is set,
+a core image of the process was produced
+by the system.
+.PP
+If the parent process terminates without
+waiting on its children,
+the initialization process
+(process ID = 1)
+inherits the children.
+.SH "SEE ALSO"
+exit(2), fork(2), signal(2)
+.SH DIAGNOSTICS
+Returns
+\-1 if there are no children not previously waited for.
+.SH "ASSEMBLER (PDP-11)"
+(wait = 7.)
+.br
+.B sys  wait
+.br
+(process ID in r0)
+.br
+(status in r1)
+.PP
+The high byte of the status is
+the low byte of r0 in the child at termination.
diff --git a/usr/man/man2/write.2 b/usr/man/man2/write.2
new file mode 100644 (file)
index 0000000..9b6a62d
--- /dev/null
@@ -0,0 +1,44 @@
+.TH WRITE 2 
+.SH NAME
+write \- write on a file
+.SH SYNOPSIS
+.B write(fildes, buffer, nbytes)
+.br
+.B char *buffer;
+.SH DESCRIPTION
+A file descriptor is a word returned from a
+successful
+.I open,
+.I creat,
+.I dup,
+or
+.IR pipe (2)
+call.
+.PP
+.I Buffer
+is the address of
+.I nbytes
+contiguous
+bytes which are written on the output file.
+The number of characters actually written is returned.
+It should be regarded as an error
+if this is not the same as requested.
+.PP
+Writes which are multiples
+of 512 characters long and begin on a 512-byte boundary
+in the file
+are more efficient than any others.
+.SH "SEE ALSO"
+creat(2), open(2), pipe(2)
+.SH DIAGNOSTICS
+Returns
+\-1 on error: bad descriptor, buffer address, or
+count; physical I/O errors.
+.SH "ASSEMBLER (PDP-11)"
+(write = 4.)
+.br
+(file descriptor in r0)
+.br
+.B sys  write; buffer; nbytes
+.br
+(byte count in r0)