jbc@ut-sally.UUCP (08/07/83)
Due to the requests we received at the Toronto USENIX
conference, we are posting a copy of the paper ``UNIX System
V and 4.1C BSD'' by John Chambers and John Quarterman on
several machines. It appears on decvax, seismo, ut-ngp, and
ut-sally for copying with uucp, as ~uucp/compare (this
message) and ~uucp/compare.[123] (the paper, 15 pages per
file). It is available over the ARPANET from utexas-11 as
~ftp/compare.doc (login ftp, password guest, retrieve
./compare.doc).
This posting to net.sources will be in 9 sections, 3 per day.
This copy is exactly like the one which will appear in the
proceedings. There will probably be a later version called
``UNIX System V and 4.2BSD'' when we get a 4.2 tape. That
version will also contain revisions according to comments we
received at USENIX and after; the present version does not,
as we cannot work on it now but nonetheless wish to satisfy
the numerous requests for copies.
John Chambers John Quarterman
ihnp4!ut-ngp!ut-sally!jbc ihnp4!ut-ngp!ut-sally!jsq
jbc@utexas-11.ARPA jsq@utexas-11.ARPA
409-761-1813 512-454-2668jbc@ut-sally.UUCP (08/07/83)
UNIX* System V and 4.1C BSD
John Chambers
Office of Academic Computing & Biostatistics
University of Texas Medical Branch, Galveston
John Quarterman
Computation Center
University of Texas at Austin
{ihnp4,decvax!{eagle,allegra}}!ut-ngp!{jbc,jsq}
{jbc,jsq}@{ut-sally.UUCP,{utexas-11,utexas-780}.ARPA}
Presented at the July 1983 USENIX Conference in Toronto.
cO Copyright 1983 by the Regents of the University of Texas.
_A_B_S_T_R_A_C_T
This paper compares System V (the UNIX system which
Western Electric is currently licensing) and 4.1C BSD (the
final precursor to 4.2BSD, the research UNIX system
developed for DARPA by the University of California at
Berkeley), based on experience with both systems on a DEC
VAX-11/780.
The comparison covers several areas and includes
comments organized by manual section on numerous specific
features (languages, shells, text editing and formatting,
devices, etc.), plus more general and detailed discussions
of such topics as: installation and configuration; sources
and documentation; groups and identifiers; file systems;
interprocess communications; networks; performance
(including some tentative benchmarks); and vendor support.
Common features are mostly left to the manuals, in
order to better concentrate on differences. This is meant
to be a _q_u_a_l_i_t_a_t_i_v_e comparison, intended to serve only as a
guide for further study.
________
* UNIX is a Trademark of Bell Telephone Laboratories, Inc.
CONTENTS
1. Introduction....................................... 2
1.1 Intent....................................... 2
1.2 Format of the Paper.......................... 2
1.3 Disclaimers and Acknowledgments.............. 3
2. Manual Sections.................................... 3
2.1 Commands..................................... 3
2.1.1 User convenience..................... 3
2.1.2 Programming support environments..... 4
2.1.3 Shells............................... 6
2.1.4 Formatting and typesetting........... 6
2.1.5 Graphics............................. 7
2.1.6 Ingres............................... 7
2.1.7 Text editors......................... 7
2.1.8 Electronic mail...................... 8
2.1.9 Printing............................. 8
2.2 System Calls................................. 9
2.2.1 Vfork and fork....................... 9
2.2.2 Reboot............................... 9
2.2.3 Setpgrp.............................. 10
2.2.4 Group system calls................... 10
2.2.5 Ioctls............................... 10
2.2.6 Open and fcntl....................... 10
2.2.7 4.1C BSD file system calls........... 11
2.2.8 Timing............................... 12
2.2.9 IPC.................................. 12
2.3 Libraries and Subroutines.................... 12
2.3.1 Common Object File Format
routines............................. 12
2.3.2 Utmp routines........................ 12
2.3.3 F77 library.......................... 12
2.3.4 Knuth algorithms..................... 12
2.3.5 Software signals and matherr......... 13
2.3.6 Stdio buffering...................... 13
2.3.7 Printf............................... 13
2.3.8 String routines...................... 14
2.3.9 Network library...................... 14
2.4 Devices...................................... 14
2.4.1 Tty.................................. 14
2.4.2 DH-11................................ 14
2.4.3 KMC-11B.............................. 15
2.4.4 VPM.................................. 15
2.4.5 Synchronous terminal................. 15
2.4.6 BLIT................................. 15
2.4.7 Ptys................................. 15
2.4.8 Generalized disk driver.............. 15
2.4.9 Generalized tape driver.............. 16
2.5 File Formats................................. 16
- i -
2.5.1 A.out................................ 16
2.5.2 Ar................................... 16
2.5.3 Fs................................... 17
2.5.4 Termcap and descendants.............. 17
2.6 Games........................................ 17
2.6.1 System V games....................... 17
2.6.2 4.1C BSD ASCII graphics games........ 17
2.6.3 PDP-11 compatibility................. 18
2.7 Miscellany................................... 18
2.7.1 File system hierarchy................ 18
2.8 Maintenance.................................. 18
2.8.1 Init, getty, and login............... 18
2.8.2 Shutdown, halt, and reboot........... 19
2.8.3 Backups.............................. 19
2.8.4 Fsck, fsdb, etc...................... 20
2.8.5 Monitoring and debugging............. 20
2.8.6 Accounting........................... 21
3. Installation and Configuration..................... 21
3.1 Installation................................. 21
3.2 Configuration................................ 22
3.3 Transition................................... 23
4. Sources and Documentation.......................... 23
4.1 Make......................................... 24
4.2 SCCS......................................... 24
4.3 Sources...................................... 24
4.4 Documentation................................ 25
5. Groups and Identifiers............................. 25
5.1 Groups....................................... 25
5.2 Identifiers.................................. 26
6. File Systems....................................... 26
6.1 System V..................................... 27
6.1.1 New file system block size........... 27
6.1.2 Faster access........................ 27
6.2 4.1C BSD..................................... 27
6.2.1 Reimplementation for efficiency...... 27
6.2.2 Other modifications.................. 28
6.2.3 Extended (network) file system....... 28
7. Interprocess Communications (IPC).................. 29
7.1 System V..................................... 29
7.2 4.1C BSD..................................... 29
8. Networks........................................... 30
8.1 System V..................................... 30
8.1.1 X.25................................. 30
8.1.2 PCL network.......................... 30
8.1.3 NSC network.......................... 30
- ii -
8.1.4 RJE to IBM........................... 31
8.2 4.1C BSD..................................... 31
8.2.1 General networking framework......... 31
8.2.2 Variety of hardware and protocols
supported............................ 31
8.2.3 Internet (TCP/IP).................... 32
8.2.4 Berkeley protocols................... 32
8.3 UUCP......................................... 32
8.4 USENET....................................... 33
9. Performance........................................ 33
9.1 Some Qualitative Remarks..................... 33
9.1.1 Paging vs. swapping.................. 33
9.1.2 Terminal I/O......................... 34
9.2 Tentative Benchmarks......................... 34
9.2.1 Load simulation...................... 35
9.2.2 File system throughput............... 36
10. Vendor Support..................................... 36
10.1 Western Electric............................. 36
10.2 U.C. Berkeley................................ 36
10.3 DEC.......................................... 36
10.4 Third Parties................................ 37
10.4.1 OEMs................................. 37
10.4.2 Emulations........................... 37
10.4.3 Consultants.......................... 37
10.4.4 Authors.............................. 38
11. Conclusion......................................... 38
11.1 Selection Criteria........................... 38
11.2 Combinations................................. 38
11.3 Future Directions............................ 39
11.3.1 UNIX standards committee............. 39
11.3.2 Berkeley features and Bell........... 39
11.3.3 Bell licensing and Berkeley.......... 39
Appendix A: Terminology........................... 39
Appendix B: Load Simulation Job................... 41
- iii -
UNIX* System V and 4.1C BSD
John Chambers
Office of Academic Computing & Biostatistics
University of Texas Medical Branch, Galveston
John Quarterman
Computation Center
University of Texas at Austin
{ihnp4,decvax!{eagle,allegra}}!ut-ngp!{jbc,jsq}
{jbc,jsq}@{ut-sally.UUCP,{utexas-11,utexas-780}.ARPA}
Presented at the July 1983 USENIX Conference in Toronto.
cO Copyright 1983 by the Regents of the University of Texas.
_A_B_S_T_R_A_C_T
This paper compares System V1 (the UNIX system which
Western Electric is currently licensing) and 4.1C BSD2 (the
final precursor to 4.2BSD, the research UNIX system
developed for DARPA3 by the University of California at
Berkeley), based on experience with both systems on a DEC
VAX-11/7804.
The comparison covers several areas and includes
comments organized by manual section on numerous specific
features (languages, shells, text editing and formatting,
devices, etc.), plus more general and detailed discussions
__________
* UNIX is a Trademark of Bell Telephone Laboratories, Inc.
1. See Appendix A for the official names of Bell UNIX
Systems.
2. See Appendix A for details about Berkeley Software
Distributions (BSD).
3. Defense Advanced Research Projects Agency (DARPA),
formerly ARPA.
4. VAX, PDP, UNIBUS, MASSBUS, and SBI are Trademarks of
Digital Equipment Corporation (DEC).jbc@ut-sally.UUCP (08/07/83)
- 2 -
of such topics as: installation and configuration; sources
and documentation; groups and identifiers; file systems;
interprocess communications; networks; performance
(including some tentative benchmarks); and vendor support.
Common features are mostly left to the manuals, in
order to better concentrate on differences. This is meant
to be a _q_u_a_l_i_t_a_t_i_v_e comparison, intended to serve only as a
guide for further study.
1. Introduction
1.1 Intent
This paper describes certain differences between
System V and 4.1C BSD, leaving details of common functions
to the manuals. This is a _q_u_a_l_i_t_a_t_i_v_e comparison, intended
to serve only as a guide for further study.
While performance is not a major theme of this paper,
some tentative benchmarks are included to indicate the
relative performance of the two systems. These benchmarks
should not be considered conclusive, since 4.1C is not 4.2
and since we have not had sufficient production experience
with System V.
This paper supersedes a previous paper, ``UNIX
System III and 4.1BSD, A Practical Comparison'', by the same
authors. In some cases, features are noted herein as having
been introduced in System V or 4.1C BSD when they were
actually introduced in System III or 4.1BSD. This usually
occurs when comparisons are being made with V7/32V and is
done simply to decrease the verbiage.
1.2 Format of the Paper
The first section following the Introduction contains
subsections corresponding to sections of the _U_N_I_X
_P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l* in order to provide a framework for
comparison of detailed features of the operating systems.
There follow several sections on subjects which are
wider than a single manual entry or which we consider
important.
__________
* The 4.1C BSD title; see section on Documentation.
- 3 -
Finally, there is a summary section which includes some
comments on recent cooperation among UNIX system developers.
1.3 Disclaimers and Acknowledgments
The authors of this paper are in no way affiliated with
the University of California, Bell Laboratories, or Western
Electric, and are solely responsible for the opinions
presented herein.
4.1C BSD is not a regular Berkeley Software
Distribution and inquiries should _n_o_t be sent to Berkeley
concerning it. Facilities in 4.1C may be represented
differently in 4.2. In cases in which we know what the
differences will be we have noted them but we do not claim
to have caught every case. When Berkeley is ready to
distribute 4.2BSD, they will announce it.
We would like to acknowledge Dr. Michael Molloy of the
Computer Science Department, University of Texas at Austin,
for the use of the departmental VAX-11/780 and for his
assistance, as well as Bill Lee of the U.T. Austin
Computation Center for his continued moral and material
support. We would also like to thank the following for
reviewing the paper: Sam Leffler of the University of
California at Berkeley, Nina McCloskey of AT&T Technology
and Licensing Division, Armando Stettner of DEC, Dan
Franklin of Bolt, Beranek, and Newman (BBN), and Doug Gwyn
of the U.S. Army Ballistic Research Laboratory (BRL).
2. Manual Sections
The subsections of this section generally follow the
order of the _U_N_I_X _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l.
2.1 Commands
The general utility commands supplied with the two
systems exhibit relatively minor differences, mainly in
terms of the options available. A few commands are included
in each distribution which do not occur in the other; many
of these are of questionable usefulness anyway and the
reader is referred to the manuals for further details.
Certain larger packages, however, such as language support
facilities, are rather different and are discussed in the
following sections.
2.1.1 _U_s_e_r__c_o_n_v_e_n_i_e_n_c_e Several utilities are considered
important for the convenience of the frequent user.
- 4 -
Berkeley UNIX provides the _p_a_g_e and _m_o_r_e file perusal
commands, used to examine a file a screenful at a time. No
equivalent is available in Bell UNIX.
The Berkeley _l_s command understands proper multicolumn
formatting of a directory listing (when stdout is a tty).
Under System V, _l_s generates a listing with one entry per
line; a multicolumn listing must be obtained by piping the
output into the _p_a_s_t_e command, e.g.
ls | paste - - - - -
The Berkeley _w program may be used to monitor user
activity; the System V equivalent uses a command file,
/etc/whodo, to generate similar information. However, it is
rather inconvenient to have to specify the absolute pathname
and few users actually have /etc as part of their default
path. (We note, of course, that the superuser's PATH
environment variable _d_o_e_s include /etc, perhaps to suggest
that only system administrators and the like should be
interested in such information.)
2.1.2 _P_r_o_g_r_a_m_m_i_n_g__s_u_p_p_o_r_t__e_n_v_i_r_o_n_m_e_n_t_s Several changes
have been made to the C programming support environment
(_S_o_f_t_w_a_r_e _G_e_n_e_r_a_t_i_o_n _S_y_s_t_e_m in WECo parlance) in System V.
Most of the #include files have been rearranged and
expanded, and it is advisable to recompile all C programs.
_P_c_c, the portable C compiler, includes reasonable
enumerations, changes to structure and union handling
(nonunique structure member names), correct handling of the
void data type, and several bug fixes. The _c_c command
itself has added the W flag to allow options to be
explicitly specified for a particular compilation subpass.
Certain bugs which are known to remain are documented in the
_S_y_s_t_e_m _R_e_l_e_a_s_e _D_e_s_c_r_i_p_t_i_o_n.
Two new tools are included: _c_x_r_e_f, which generates
cross-reference listings and obsoletes both _c_r_e_f and _x_r_e_f,
and _c_f_l_o_w, which builds a graph of external references
occurring in a collection of assorted source files (C,
assembler, etc.).
The System V f77 programming support environment also
includes two new tools: _a_s_a interprets the standard ASA
carriage control characters, and _f_s_p_l_i_t may be used to split
FORTRAN sources (f77, efl, ratfor) on a procedure-per-file
basis. In addition, the load-time library has been greatly
extended and enhanced.
- 5 -
The libraries for both C and f77 are available in
profiled versions, which must be loaded explicitly in place
of the default, non-profiled ones. These profiled libraries
allow program execution profiling at the library function
level rather than the user program function level.
Further, the symbolic debugger _s_d_b is very much
improved and may be used easily with either C or f77
programs.
The _a_s assembler and _l_d linker have been modified to
utilize the new Common Object File Format, which is
discussed below. Note that any change to a source file for
a program thus necessitates recompilation of all sources
before the objects may be relinked using _l_d, since the old
and new object formats are radically different.
The C compiler in 4.1C (_p_c_c) is very similar to the one
in System III, including void, union, enum, and structure
elements named per structure, some of which were added after
32V. Berkeley added very long identifiers in 4.1BSD, while
System III and System V retained the old 7/8 character
identifiers. The _a_s assembler, the _l_d linker, and
associated libraries are similar to the ones in 32V,
although in 4.1 _l_d was reworked to be four to five times
faster and this improvement is preserved in 4.1C and 4.2.
The _d_b_x symbolic debugger is new.
4.1C BSD has some bug fixes and other improvements to
_f_7_7 (an overlaid version of this compiler is available for
2.8bsd).
4.2 has an extensively reworked version of _f_7_7 and its
associated libraries: early versions of this new FORTRAN
package were apparently the source for the new System V
FORTRAN facilities.
Both systems support Ratfor and the Extended FORTRAN
Language (EFL), but 4.1C additionally provides the _s_t_r_u_c_t
utility, used to convert FORTRAN sources into reasonably
clean Ratfor.
System V has _b_s, essentially derived from _B_A_S_I_C. There
is no equivalent in 4.1C BSD; however, the University of
British Columbia _B_A_S_I_C sytem is compatible with 4BSD.
Similarly, System V includes the classic _s_n_o SNOBOL
system, while 4.1C includes _P_A_S_C_A_L, _F_R_A_N_Z _L_I_S_P, _A_P_L, and _f_p.
_A_P_L is a user contributed software package from Purdue. _F_p
(Functional Programming language compiler/interpreter)
implements the applicative language proposed by John Backus
- 6 -
in his Turing award lecture. 4.2 may include _I_c_o_n as user
contributed software.
There is a _C_O_B_O_L compiler commercially available for
4BSD, and possibly for System V.
2.1.3 _S_h_e_l_l_s System V supports the Bourne shell (_s_h), with
few noticeable changes from V7. 4.1C BSD has much the same
Bourne shell plus the Cshell (_c_s_h), often a new user's first
command language.
The Cshell has most of the capabilities of the Bourne
shell (though the syntax is different), plus the history,
alias and directory stack features. History and alias allow
editing and replaying of saved commands. Such features are
the main reason many users prefer the Cshell (although some
cite its extensive C-like control structures as another
reason).
The 4.1C Cshell also has a set of job control features
(requiring the Berkeley `new tty' terminal driver) which
allow the user to suspend and resume subprocesses.
The 4.1C resource limitation facilities are normally
accessed via the _c_s_h _l_i_m_i_t command. The only close
equivalent in System V _s_h is the _u_l_i_m_i_t command, used to
control the size of the file a child process may write.
2.1.4 _F_o_r_m_a_t_t_i_n_g__a_n_d__t_y_p_e_s_e_t_t_i_n_g 4.1C offers the -me macro
package, while System V has the -mm package, somewhat
augmented from PWB. The -ms macros have been removed from
System V but are still found in 4.1C. In 4.2, they have
been extended to provide support for tables of contents and
the like.
System V includes additional macro support for
generating slides and viewgraphs.
An improved interface to the Versatec is provided in
System V, along with new _i_o_c_t_l calls for state control. The
_v_c_a_t filter for _t_r_o_f_f which was documented but absent in
System III seems to have disappeared entirely in System V.
Both systems have Versatec drivers expecting a single
interrupt address, whereas the Versatec itself has two
configured into the hardware. 4.1C at least has comments in
the code to tell you this (and #ifdefs to deal with it).
The 4.1 Versatec user programs expected a unit wide
enough to handle four pages abreast; this problem has been
fixed in 4.2 (but not 4.1C) by extensions to the printerjbc@ut-sally.UUCP (08/07/83)
- 7 -
spooling facility.
The Berkeley font library seems rather more extensive
than that provided with System V. These fonts are used by
the Versatec filters to simulate the mounted fonts of a
C/A/T phototypesetter, the standard destination device for
non-device independent _t_r_o_f_f.
The best version of _t_r_o_f_f comes with neither of these
systems. This is the Typesetter Independent Troff (TITroff)
package (commonly known as DITroff, for Device Independent
Troff). It is available separately from Western Electric
and includes useful graphics packages (_p_i_c and _i_d_e_a_l) which
can be used to augment the basic typesetting facilities.
In 4.2, the printer spooling facilities have hooks for
TITroff so that the package can be used immediately when
obtained (though TITroff itself is still distributed
separately by Western Electric). See below under _P_r_i_n_t_i_n_g.
The Writer's Workbench facilities _s_t_y_l_e, _d_i_c_t_i_o_n and
_e_x_p_l_a_i_n, which analyze surface characteristics and
readability of written text, are supplied with 4.1C. This
is apparently a Bell Research Group package and is available
separately from Western Electric. _S_t_y_l_e ignores macros from
-ms, -me, -mm, and -ma, although the manual page only
mentions -ms and -mm.
4.2 also includes an improved _r_e_f_e_r and _b_i_b.
2.1.5 _G_r_a_p_h_i_c_s 4.1C has rather rudimentary graphics
capability.
In contrast, System V has the PWB graphics package,
including _g_e_d, a graphical editor, and numerous data
generation, transformation, and display commands. This
graphics capability has been used extensively in conjunction
with the accounting packages.
2.1.6 _I_n_g_r_e_s The relational database system Ingres is part
of 4.1C, and a commercial version of Ingres is available for
4BSD. We do not know if it will work under System V.
2.1.7 _T_e_x_t__e_d_i_t_o_r_s Both systems have the traditional UNIX
editor, _e_d, and System V has adopted the Berkeley _v_i
(screen) and _e_x (line) editors, which are also of course in
4.1C.
System V documents a new screen editor named _s_e but it
was not included on the distribution. Apparently it does
not utilize the terminal independence capability provided by
- 8 -
_t_e_r_m_c_a_p but, rather, uses its own terminal description file,
/usr/lib/se.term (also not on the distribution).
Recent versions of the Rand Editor _e and UNIX Emacs can
presumably be made to run correctly on System V, although
this was not our experience.
Though the distributed versions of the two commonly
available versions of _E_m_a_c_s have problems running on 4.1C,
since they still attempt to use the obsolete MPX IPC
facility, at least one (Gosling's) has already been adapted
at Berkeley to use the superior Berkeley IPC mechanism. (No
problems were noted running them under 4.1.)
2.1.8 _E_l_e_c_t_r_o_n_i_c__m_a_i_l System V has a rudimentary mail
system, not much altered from V7 or System III.
4.1C has a more elaborate one, with most of the
commonly useful mail functions. 4.1C actually provides two
mail delivery routes, one unprotected and the other
encrypted. There is a new mail delivery program called
_s_e_n_d_m_a_i_l (a descendant of the _d_e_l_i_v_e_r_m_a_i_l of 4.1) which
provides a central mail handling system capable of dealing
with multiple networks and addressing formats.
The Rand _m_h system can be used as an alternative front
end to the Berkeley mail system and will be provided with
4.2 as user contributed software. Some people use _E_m_a_c_s for
this purpose.
We understand that the MMDF mail system from the
University of Maryland can be used with either the Bell or
the Berkeley version of the Unix System but we have no
direct experience with it.
2.1.9 _P_r_i_n_t_i_n_g The _l_p_r command and _l_p_d daemon have been
modified in 4.1C to use the file /etc/printcap (similar to
/etc/termcap) to define the characteristics of the various
printers attached to a system. Printers may be added or
deleted without changing the programs and output filter
programs are supported on a per-device basis. It is
possible to treat a printer on another machine as if it were
local (from the user's viewpoint) and have _l_p_d ship files
across a network to it. The Berkeley IPC mechanism is used
for queueing requests, editing the queue, monitoring queue
activity, etc.
In 4.2, _l_p_r, etc., provide support for various raster
devices (such as Varian or Versatec), laser printers (such
as Imagen), and numerous ordinary printers. Specifying a
new type of device in /etc/printcap is relatively easy.
- 9 -
The user specifies a printer either as a command line
option to _l_p_r or in the PRINTER environment variable.
The System V _l_p_r is considered obsolete and has been
replaced by a spooling system similar in flavor to that
provided with 4.1C but without the extensive network
support. The LP-11 is still considered the canonical
printing device, although a particular destination may be
specified by the LPDEST environment variable.
_M_D_Q_S (Multiple Device Queueing System) is available
from BRL and provides support for queueing output to a
variety of different devices.
2.2 System Calls
The user interface to most of the system calls is the
same, i.e., the interface routines in the C library have the
same calling sequence, but the actual system call numbers
differ.
4.1C has introduced a number of new system calls, some
intended to eventually replace older ones completely. Many
of the older ones are now simulated by interface routines
that call the new, extended ones.
2.2.1 _V_f_o_r_k__a_n_d__f_o_r_k The _f_o_r_k system call in System V has
been changed to require only one pass through the process
table per invocation. A resulting improvement in performance
is claimed; however, we did not attempt to measure this.
4BSD includes the _v_f_o_r_k version of the _f_o_r_k system
call, which allows creation of a new process without the
need for copying the entire address space of the parent.
This makes sense in any environment where processes get very
large, as in the paging environment provided by 4.1C (see
comments below), but the implementation also imposes certain
restrictions which can mislead the unwary. Performance
statistics relating to the use of _v_f_o_r_k are widely available
and are outside the domain of this presentation.
2.9BSD has _v_f_o_r_k for the PDP-11. 4.3BSD will eliminate
the need for _v_f_o_r_k by a reimplementation of _f_o_r_k.
2.2.2 _R_e_b_o_o_t 4.1C has the _r_e_b_o_o_t system call, which is
quite convenient for persons engaged in system development
work. (See below on the _r_e_b_o_o_t command.)
System V documents a _r_e_b_o_o_t system call for the WECo
3B20S but nothing seems to be available for DEC machines.
- 10 -
2.2.3 _S_e_t_p_g_r_p 4.1C has elaborated the _s_e_t_p_g_r_p system call
to be more compatible with the job control functions of the
Cshell.
2.2.4 _G_r_o_u_p__s_y_s_t_e_m__c_a_l_l_s 4.1C has a new method of dealing
with the concept of groups and group ids (see the major
section below on _G_r_o_u_p_s).
2.2.5 _I_o_c_t_l_s The _i_o_c_t_l system call is essentially
identical in the two systems. The interesting differences
are in the terminal driver ioctls. Both drivers utilize the
``line discipline'' notion, allowing dynamic choice among
several protocols by the user process.
Berkeley offers several new features in 4.1C BSD over
the V7 terminal driver. Some of these are accessed as a new
line discipline (the ``new tty'' discipline), while a few
others are implemented as additional _i_o_c_t_l calls. There is
a line discipline in 4.1C for an RS232 interface to an
Hitachi tablet (this is undocumented). All of these are
useful features, but the tty ioctls have become somewhat
baroque.
The System V terminal driver is radically different
from the V7 one. Many functions which always should have
been orthogonal now are. As one example, the conversion of
carriage return to new line on input and of new line to
carriage return and line feed on output are now separately
controllable functions. Of course, this driver is
hopelessly incompatible with any previous one (except
System III) and with the Berkeley one. Additionally, there
is peripheral processor support for this line discipline in
the KMC-11B (see below).
System V also provides support for a virtual terminal
protocol, allowing drivers for selected terminals to be
compiled directly into the kernel. The terminal type may be
manipulated by two related _i_o_c_t_l_s, LDSETT and LDGETT; a type
specifier may then be passed to, say, _g_e_t_t_y (see below).
Unfortunately, this feature is not well-documented and it is
particularly advisable to study the terminal driver code and
the file /usr/include/termio.h.
2.2.6 _O_p_e_n__a_n_d__f_c_n_t_l The _o_p_e_n system call in System V
presents essentially the same interface as in System III but
now claims substantially improved performace due to the use
of a hashed inode table.
The _d_u_p_2 function of V7 and 4BSD has been replaced and
elaborated upon in System V by the _f_c_n_t_l system call. 4.1C
preserves the 32V FIOEXCL _i_o_c_t_l call to give control over
- 11 -
the inheritance of file descriptors across an _e_x_e_c; this is
provided by _f_c_n_t_l in Systems III and V. In conjunction with
an additional argument (mode) to the _o_p_e_n system call, _f_c_n_t_l
permits access to the O_NDELAY (non-blocking I/O)
capability. (The System III O_NDELAY bug appears to be
fixed in System V.)
4.1C uses an _i_o_c_t_l to set up non-blocking I/O but also
has various _o_p_e_n modes in addition to the old read and write
modes, plus the optional third argument for some of them.
Non-blocking opens, for instance, are supported.
4.2 has adopted exactly the same _o_p_e_n and _f_c_n_t_l
interfaces as System V, even going so far as to duplicate
the names of the mode bits. A different include file is
used for _o_p_e_n, however.
2.2.7 _4_._1_C__B_S_D__f_i_l_e__s_y_s_t_e_m__c_a_l_l_s 4.1C has a number of new
system calls affecting file I/O, in addition to the
modifications to the _o_p_e_n call noted above.
There are now system calls for _m_k_d_i_r, _r_m_d_i_r, and
_r_e_n_a_m_e.
Equivalents of old calls that apply to file descriptors
instead of file names have been added: _f_c_h_o_w_n and _f_c_h_m_o_d.
Symbolic links require some specific calls: _l_s_t_a_t,
_s_y_m_l_i_n_k, _r_e_a_d_l_i_n_k.
File truncation is supported by _t_r_u_n_c_a_t_e and _f_t_r_u_n_c_a_t_e,
and file locking by _f_l_o_c_k.
Scatter/gather I/O is supported by _r_e_a_d_v and _w_r_i_t_e_v.
The notion of ``file descriptor'' has been generalized
to include various other kinds of descriptors, such as
socket descriptors for use with IPC endpoints. Many of the
system calls, e.g. _c_l_o_s_e, that apply to file descriptors
also have meaning with other types of descriptors, and there
are several new system calls to deal with descriptors, such
as _g_e_t_d_t_a_b_l_e_s_i_z_e. The most generally useful of the new
descriptor system calls is _s_e_l_e_c_t, which is used to do
synchronous multiplexing of operations by determining (among
other things) whether it is possible to read or write data
on any of a set of descriptors.
See also the major sections below on _F_i_l_e _S_y_s_t_e_m_s and
_I_P_C.