Advanced Programming in the UNIX R EnvironmentPDF电子书下载
- 电子书积分:20 积分如何计算积分?
- 作 者:W.Richard Stevens
- 出 版 社:机械工业出版社
- 出版年份:2002
- ISBN:7111095081
- 页数:720 页
Chapter 1.Introduction 1
1.1 Introduction 1
1.2 Logging In 1
1.3 Files and Directories 3
1.4 Input and Output 6
1.5 Programs and Processes 9
1.6 ANSI C Features 12
1.7 Error Handling 14
1.8 User Identification 16
1.9 Signals 17
1.10 Unix Time Values 19
1.11 System Calls and Library Functions 20
1.12 Summary 23
Chapter 2.Unix Standardization and Implementations 25
2.1 Introduction 25
2.2 Unix Standardization 25
2.2.1 ANSI C 25
2.2.2 IEEE POSIX 26
2.2.3 X/Open XPG3 28
2.2.4 FIPS 28
2.3 Unix Implementations 28
2.3.1 System V Release 4 29
2.3.2 4.3+BSD 29
2.4 Relationship of Standards and Implementations 30
2.5 Limits 30
2.5.1 ANSI C Limits 31
2.5.2 POSIX Limits 32
2.5.3 XPG3 Limits 34
2.5.4 sysconf,pathconf,and fpathconf Functions 34
2.5.5 FIPS 151-1 Requirements 39
2.5.6 Summary of Limits 41
2.5.7 Indeterminate Run-Time Limits 41
2.6 Feature Test Macros 44
2.7 Primitive System Data Types 44
2.8 Conflicts Between Standards 45
2.9 Summary 46
Chapter 3.File I/O 47
3.1 Introduction 47
3.2 File Descriptors 47
3.3 open Function 48
3.4 creat Function 50
3.5 close Function 51
3.6 lseek Function 51
3.7 read Function 54
3.8 write Function 55
3.9 I/O Efficiency 55
3.10 File Sharing 56
3.11 Atomic Operations 60
3.12 dup and dup2 Functions 61
3.13 fcntl Function 63
3.14 ioctl Function 67
3.15 /dev/fd 69
3.16 Summary 70
Chapter 4.Files and Directories 73
4.1 Introduction 73
4.2 stat,fstat,and lstat Functions 73
4.3 File Types 74
4.4 Set-User-ID and Set-Group-ID 77
4.5 File Access Permissions 78
4.6 Ownership of New Files and Directories 81
4.7 access Function 82
4.8 umask Function 83
4.9 chmod and fchmod Functions 85
4.10 Sticky Bit 88
4.11 chown,fchown,and lchown Functions 89
4.12 File Size 90
4.13 File Truncation 91
4.14 Filesystems 92
4.15 link,unlink,remove,and rename Functions 95
4.16 Symbolic Links 99
4.17 symlink and readlink Functions 102
4.18 File Times 102
4.19 utime Function 103
4.20 mkdir and rmdir Functions 106
4.21 Reading Directories 107
4.22 chdir,fchdir,and getcwd Functions 112
4.23 Special Device Files 114
4.24 sync and fsync Functions 116
4.25 Summary of File Access Permission Bits 117
4.26 Summary 118
Chapter 5.Standard I/O Library 121
5.1 Introduction 121
5.2 Streams and FILE Objects 121
5.3 Standard Input,Standard Output,and Standard Error 122
5.4 Buffering 122
5.5 Opening a Stream 125
5.6 Reading and Writing a Stream 127
5.7 Line-at-a-Time I/O 130
5.8 Standard I/O Efficiency 131
5.9 Binary I/O 133
5.10 Positioning a Stream 135
5.11 Formatted I/O 136
5.12 Implementation Details 138
5.13 Temporary Files 140
5.14 Alternatives to Standard I/O 143
5.15 Summary 143
Chapter 6.System Data Files and Information 145
6.1 Introduction 145
6.2 Password File 145
6.3 Shadow Passwords 148
6.4 Group File 149
6.5 Supplementary Group IDs 150
6.6 Other Data Files 152
6.7 Login Accounting 153
6.8 System Identification 154
6.9 Time and Date Routines 155
6.10 Summary 159
Chapter 7.The Environment of a Unix Process 161
7.1 Introduction 161
7.2 main Function 161
7.3 Process Termination 162
7.4 Command-Line Arguments 165
7.5 Environment List 166
7.6 Memory Layout of a C Program 167
7.7 Shared Libraries 169
7.8 Memory Allocation 169
7.9 Environment Variables 172
7.10 setjmp and longjmp Functions 174
7.11 getrlimit and setrlimit Functions 180
7.12 Summary 184
Chapter 8.Process Control 187
8.1 Introduction 187
8.2 Process Identifiers 187
8.3 fork Function 188
8.4 vfork Function 193
8.5 exit Functions 195
8.6 wait and waitpid Functions 197
8.7 wait3 and wait4 Functions 202
8.8 Race Conditions 203
8.9 exec Functions 207
8.10 Changing User IDs and Group IDs 213
8.11 Interpreter Files 217
8.12 system Function 221
8.13 Process Accounting 226
8.14 User Identification 231
8.15 Process Times 232
8.16 Summary 235
Chapter 9.Process Relationships 237
9.1 Introduction 237
9.2 Terminal Logins 237
9.3 Network Logins 241
9.4 Process Groups 243
9.5 Sessions 244
9.6 Controlling Terminal 246
9.7 tcgetpgrp and tcsetpgrp Functions 247
9.8 Job Control 248
9.9 Shell Execution of Programs 252
9.10 Orphaned Process Groups 256
9.11 4.3+BSD Implementation 259
9.12 Summary 261
Chapter 10.Signals 263
10.1 Introduction 263
10.2 Signal Concepts 263
10.3 signal Function 270
10.4 Unreliable Signals 274
10.5 Interrupted System Calls 275
10.6 Reentrant Functions 278
10.7 SIGCLD Semantics 279
10.8 Reliable Signal Terminology and Semantics 282
10.9 kill and raise Functions 283
10.10 alarm and pause Functions 285
10.11 Signal Sets 291
10.12 sigprocmask Function 292
10.13 sigpending Function 293
10.14 sigaction Function 296
10.15 sigsetjmp and siglongjmp Functions 299
10.16 sigsuspend Function 303
10.17 abort Function 309
10.18 system Function 310
10.19 sleep Function 317
10.20 Job-Control Signals 319
10.21 Additional Features 320
10.22 Summary 323
Chapter 11.Terminal I/O 325
11.1 Introduction 325
11.2 Overview 325
11.3 Special Input Characters 331
11.4 Getting and Setting Terminal Attributes 335
11.5 Terminal Option Flags 336
11.6 stty Command 342
11.7 Baud Rate Functions 343
11.8 Line Control Functions 344
11.9 Terminal Identification 345
11.10 Canonical Mode 349
11.11 Noncanonical Mode 352
11.12 Terminal Window Size 358
11.13 termcap,terminfo,and curses 360
11.14 Summary 360
Chapter 12.Advanced I/O 363
12.1 Introduction 363
12.2 Nonblocking I/O 363
12.3 Record Locking 367
12.4 Streams 383
12.5 I/O Multiplexing 394
12.5.1 select Function 396
12.5.2 poll Function 400
12.6 Asynchronous I/O 402
12.6.1 System V Release 4 403
12.6.2 4.3+BSD 403
12.7 readv and writev Functions 404
12.8 readn and writen Functions 406
12.9 Memory Mapped I/O 407
12.10 Summary 413
Chapter 13.Daemon Processes 415
13.1 Introduction 415
13.2 Daemon Characteristics 415
13.3 Coding Rules 417
13.4 Error Logging 418
13.4.1 SVR4 Streams log Driver 419
13.4.2 4.3+BSD syslog Facility 421
13.5 Client-Server Model 424
13.6 Summary 424
Chapter 14.Interprocess Communication 427
14.1 Introduction 427
14.2 Pipes 428
14.3 popen and pclose Functions 435
14.4 Coprocesses 441
14.5 FIFOs 445
14.6 System V IPC 449
14.6.1 Identifiers and Keys 449
14.6.2 Permission Structure 450
14.6.3 Configuration Limits 451
14.6.4 Advantages and Disadvantages 451
14.7 Message Queues 453
14.8 Semaphores 457
14.9 Shared Memory 463
14.10 Client-Server Properties 470
14.11 Summary 472
Chapter 15.Advanced Interprocess Communication 475
15.1 Introduction 475
15.2 Stream Pipes 475
15.3 Passing File Descriptors 479
15.3.1 System V Release 4 481
15.3.2 4.3BSD 484
15.3.3 4.3+BSD 487
15.4 An Open Server,Version 1 490
15.5 Client-Server Connection Functions 496
15.5.1 System V Release 4 497
15.5.2 4.3+BSD 501
15.6 An Open Server,Version 2 505
15.7 Summary 514
Chapter 16.A Database Library 515
16.1 Introduction 515
16.2 History 515
16.3 The Library 516
16.4 Implementation Overview 518
16.5 Centralized or Decentralized? 521
16.6 Concurrency 522
16.7 Source Code 524
16.8 Performance 545
16.9 Summary 550
Chapter 17.Communicating with a PostScript Printer 551
17.1 Introduction 551
17.2 PostScript Communication Dynamics 551
17.3 Printer Spooling 554
17.4 Source Code 556
17.5 Summary 578
Chapter 18.A Modem Dialer 579
18.1 Introduction 579
18.2 History 579
18.3 Program Design 580
18.4 Data Files 582
18.5 Server Design 584
18.6 Server Source Code 586
18.7 Client Design 615
18.8 Client Source Code 617
18.9 Summary 629
Chapter 19.Pseudo Terminals 631
19.1 Introduction 631
19.2 Overview 631
19.3 Opening Pseudo-Terminal Devices 636
19.3.1 System V Release 4 638
19.3.2 4.3+BSD 640
19.4 pty_fork Function 641
19.5 pty Program 644
19.6 Using the pty Program 648
19.7 Advanced Features 655
19.8 Summary 656
Appendix A.Function Prototypes 659
Appendix B.Miscellaneous Source Code 679
B.1 Our Header File 679
B.2 Standard Error Routines 681
Appendix C.Solutions to Selected Exercises 687
Bibliography 713
Index 719
- 《战略性思维 大型商业项目成功的秘密》大卫·斯蒂文斯(David Stevens)著;曹祖平等译 1999
- 《中英马术俱乐部培训系列教材 调教原则》Michael J. Stevens著;天星调良国际马术俱乐部教练组翻译 2005
- 《你的营销不对路》(美)马克·史蒂文斯(Mark Stevens)著;漆仰平译 2005
- 《UNIX网络编程 第1卷 套接口API》(美)W. Richard Stevens,(美)Bill Fenner,(美)Andrew M. Rudoff著;杨继张译 2006
- 《评价量表 快捷有效的教学评价工具 第2版》(美)丹奈尔·D.史蒂文斯(DannelleD.Stevens),(美)安东尼娅·J.利维(AntoniaJ.Levi)著 2014
- 《人类梦史》(英)安东尼·史蒂文斯著(Anthony Stevens)著;杨晋译 2002
- 《C++大学自学教程 第7版》(美)Al Stevens著;林瑶等译 2004
- 《花园设计》(英)戴维·斯蒂文森(David Stevens)著;陈慈译 2002
- 《领袖的风险 世界顶级会计师事务所揭秘》(美)马克·史蒂文斯(Mark Stevens)著;陈玉新译 2003
- 《花园水景》(英)戴维·斯蒂文森(David Stevens)著;张敏,张维力译 2002
- 《高等教育双机械基础课程系列教材 高等学校教材 机械设计课程设计手册 第5版》吴宗泽,罗圣国,高志,李威 2018
- 《中国十大出版家》王震,贺越明著 1991
- 《近代民营出版机构的英语函授教育 以“商务、中华、开明”函授学校为个案 1915年-1946年版》丁伟 2017
- 《新工业时代 世界级工业家张毓强和他的“新石头记”》秦朔 2019
- 《智能制造高技能人才培养规划丛书 ABB工业机器人虚拟仿真教程》(中国)工控帮教研组 2019
- 《AutoCAD机械设计实例精解 2019中文版》北京兆迪科技有限公司编著 2019
- 《陶瓷工业节能减排技术丛书 陶瓷工业节能减排与污染综合治理》罗民华著 2017
- 《全国职业院校工业机器人技术专业规划教材 工业机器人现场编程》(中国)项万明 2019
- 《国之重器出版工程 云化虚拟现实技术与应用》熊华平 2019
- 《新闻出版博物馆 总第33期》新闻出版博物馆 2018