《UNIX环境高级编程》简介:
If you are an experienced C programmer with a working knowledge of UNIX, you cannot afford to be without this up-to -date tutorial on the system call interface and the most important functions found in the ANSI C library. Richard Stevens describes more than 200 system calls and functions; since he believes the best way to learn code is to read code,a brief example accompanies each description. Building upon information presented in the first 15 chapters, the author offers chapter-long examples teaching you how to create a database library, a PostScript printer driver, a modem dialer, and a program that runs other programs under a pseudo terminal. To make your analysis and understanding ofthis code even easier, and to allow you to modify it, all of the code in the book is available via UUNET. Advanced Programming in the UNIX Environment is applicable to all major UNIX releases, especially System V Release the latest release of 4.3BSD, including 386BSD. These real-world implementations allow you to more clearly understand the status of the current and future standards,including IEEE POSIX and XPG3.
《UNIX环境高级编程》摘录:
与应用程序使用文件描述符(fd)访问文件一样,访问套接字也需要使用套接字描述符,其在unix系统中是用文件描述符实现的。 在AF_INET通信域中套接字SOCK_STREAM的默认协议是TCP,SOCK_DGRAM的默认协议是UDP。 不同处理器架构支持不同的字节序,小端(little-endian)freebsd linux on intel pentium,大端(big-endian)mac os on power pc solaris on sun sparc,有些处理器可以配置大端和小端,更加混乱。 TCP/IP 采用大端字节序。对于TCP/IP,地址是使用网络字节序来表示,所以应用程序有时候需要在处理器的字节序和网络字节序之间转换。 uint32_t htonl(uint32_t hostint32); uint16_t htons(uint16_t hostint16); uint32_t ntohl(uint32_t netint32); uint16_t ntohsl(uint16_t netint16); h 代表host n 代表network l 代表 long s 代表 short
《UNIX环境高级编程》目录:
Preface
Chapter 1 Introduction
Chapter 2 Unix Standardization and Implementations
Chapter 3 File I/O
Chapter 4 files and Directories
Chapter 5 Standard I/O Library
Chapter 6 System Data Files and Information
Chapter 7 The Environment of a Unix Process
Chapter 8 Process Control
Chapter 9 Process Relationships
Chapter 10 Signals
Chapter 11 Terminal I/O
Chapter 12 Advanced I/O
Chapter 13 Daemon Processes
Chapter 14 Interprocess Communication
Chapter 15 Advanced Interprocess Communication
· · · · · ·