Author | W. Richard Stevens |
---|---|
Language | English |
Published | 1992 |
Publisher | Addison-Wesley |
Publication place | United States |
Pages | +750 [1] |
Advanced Programming in the Unix Environment is a computer programming book by W. Richard Stevens describing the application programming interface of the UNIX family of operating systems. The book illustrates UNIX application programming in the C programming language.
The first edition of the book was published by Addison-Wesley in 1992. It covered programming for the two popular families of the Unix operating system, the Berkeley Software Distribution (in particular 4.3 BSD and 386BSD) and AT&T's UNIX System V (particularly SVR4). The book covers system calls for operations on single file descriptors, special calls like ioctl that operate on file descriptors, and operations on files and directories. It covers the stdio section of the C standard library, and other parts of the library as needed. The several chapters concern the APIs that control processes, process groups, daemons, inter-process communication, and signals. One chapter is devoted to the Unix terminal control and another to the pseudo terminal concept and to libraries like termcap and curses that build atop it. Stevens adds three chapters giving more concrete examples of Unix programming: he implements a database library, communicates with a PostScript printer, and with a modem. The book does not cover network programming: this is the subject of Stevens's 1990 book UNIX Network Programming and his subsequent three-volume TCP/IP Illustrated .
Stevens died in 1999, leaving a second edition incomplete. With the increasing popularity and technical diversification of Unix derivatives, and largely compatible systems like the Linux environment, the code and coverage of Stevens's original became increasingly outdated. Working with Stevens's unfinished notes, Stephen A. Rago completed a second edition which Addison-Wesley published in 2005. This added support for FreeBSD, Linux, Sun's Solaris, and Apple's Darwin, and added coverage of multithreaded programming with POSIX Threads. The second edition features a foreword by Dennis Ritchie and a Unix-themed Dilbert strip by Scott Adams.
The book has been widely lauded as well written, well crafted, and comprehensive. It received a "hearty recommendation" in a Linux Journal review. [1]
OSNews describes it as "one of the best tech books ever published" in a review of the second edition. [2]
Dennis MacAlistair Ritchie was an American computer scientist. He created the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B language. Ritchie and Thompson were awarded the Turing Award from the Association for Computing Machinery (ACM) in 1983, the IEEE Richard W. Hamming Medal from the Institute of Electrical and Electronics Engineers (IEEE) in 1990, and the National Medal of Technology from President Bill Clinton in 1999.
Berkeley sockets is an application programming interface (API) for Internet sockets and Unix domain sockets, used for inter-process communication (IPC). It is commonly implemented as a library of linkable modules. It originated with the 4.2BSD Unix operating system, which was released in 1983.
Version 7 Unix, also called Seventh Edition Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercialization of Unix by AT&T Corporation in the early 1980s. V7 was originally developed for Digital Equipment Corporation's PDP-11 minicomputers and was later ported to other platforms.
errno.h is a header file in the standard library of the C programming language. It defines macros for reporting and retrieving error conditions using the symbol errno
.
William Richard (Rich) Stevens was a Northern Rhodesia–born American author of computer science books, in particular books on Unix and TCP/IP.
In Unix and Unix-like computer operating systems, a file descriptor is a process-unique identifier (handle) for a file or other input/output resource, such as a pipe or network socket.
In computer networking, the Transport Layer Interface (TLI) was the networking API provided by AT&T UNIX System V Release 3 (SVR3) in 1987 and continued into Release 4 (SVR4). TLI was the System V counterpart to the BSD sockets programming interface, which was also provided in UNIX System V Release 4 (SVR4). TLI was later standardized as XTI, the X/Open Transport Interface.
stat is a Unix system call that returns file attributes about an inode. The semantics of stat vary between operating systems. As an example, Unix command ls uses this system call to retrieve information on files that includes:
File locking is a mechanism that restricts access to a computer file, or to a region of a file, by allowing only one user or process to modify or delete it at a specific time and to prevent reading of the file while it's being modified or deleted.
In computer networking, STREAMS is the native framework in Unix System V for implementing character device drivers, network protocols, and inter-process communication. In this framework, a stream is a chain of coroutines that pass messages between a program and a device driver. STREAMS originated in Version 8 Research Unix, as Streams.
In computing, control-\ is a control character in ASCII code and the Basic Latin code block of Unicode, also known as the file separator or field separator (FS) character. It is generated by pressing the \ key while holding down the Ctrl key on a computer keyboard, and has the decimal value 28. It is the highest-level of the four separators in the ASCII C0 and C1 control codes; the others are control-], control-^, and control-_. It was one of eight codes reserved as separators in the 1963 version of the ASCII standard; these were reduced to four separators in a 1965 revision of the standard.
Group is a name service database used to store group information on Unix-like operating systems. The sources for the group database are configured, like other name service databases, in nsswitch.conf. The database file is located at /etc/group
. It contains fields representing the group name, group id, encrypted password, and users belonging to the group. These fields are stored in a structure defined in the header file <grp.h>
.
In computing, mkstemp
is a POSIX function for creating a temporary file. It accepts an argument that determines the location of the temporary file, and the prefix of its generated filename. After mkstemp
was added to the Single UNIX Specification, the function tmpnam
was deprecated, because the latter carried the risk that a temporary file with the same name could be created by another thread or process within the time from when the caller obtains the temporary filename and attempts to create it. mkstemp
does not suffer from this problem.
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley. The term "BSD" commonly refers to its open-source descendants, including FreeBSD, OpenBSD, NetBSD, and DragonFly BSD.
Unix is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.
ptrace is a system call found in Unix and several Unix-like operating systems. By using ptrace one process can control another, enabling the controller to inspect and manipulate the internal state of its target. ptrace is used by debuggers and other code-analysis tools, mostly as aids to software development.
In Unix and operating systems inspired by it, the file system is considered a central component of the operating system. It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental version of Unix, dated 1969.
The X/Open Transport Interface (XTI) is an Open Group specification for network application programming present in UNIX System V operating systems. It provides OSI transport layer services with protocol independence. Although Open Group considers this specification withdrawn, an implementation is part of the standard programming interfaces on modern UNIX System V operating systems where it is implemented using the STREAMS character input/output mechanism.
Unix Network Programming is a book written by W. Richard Stevens. It was published in 1990 by Prentice Hall and covers many topics regarding UNIX networking and Computer network programming. The book focuses on the design and development of network software under UNIX. The book provides descriptions of how and why a given solution works and includes 15,000 lines of C code. The book's summary describes it as "for programmers seeking an in depth tutorial on sockets, transport level interface (TLI), interprocess communications (IPC) facilities under System V and BSD UNIX." The book has been translated into several languages, including Chinese, Italian, German, Japanese and others.
The AWK Programming Language is a well-known 1988 book written by Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger and published by Addison-Wesley, often referred to as the gray book. The book describes the AWK programming language and is the de facto standard for the language, written by its inventors. W. Richard Stevens, author of several UNIX books including Advanced Programming in the Unix Environment, cites the book as one of his favorite technical books. The book is translated to several languages and is cited by many technical papers in the ACM journals.