没有合适的资源?快使用搜索试试~ 我知道了~
Advanced Programming in the UNIX Environment 3e-2013
需积分: 9 10 下载量 56 浏览量
2017-10-16
14:41:00
上传
评论
收藏 5.09MB PDF 举报
温馨提示
试读
1026页
Advanced Programming in the UNIX Environment 3e-2013 Advanced Programming in the UNIX Environment 3e-2013
资源推荐
资源详情
资源评论
ptg10805159
Advanced Programming
in the UNIX
®
Environment
Third Edition
W. Richard Stevens
Stephen A. Rago
Make sure to connect with us!
informit.com/socialconnect
The Addison-Wesley
Professional Computing Series
ptg10805159
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and the publisher was
aware of a trademark claim, the designations have been printed with initial capital letters or in all
capitals.
The authors and publisher have taken care in the preparation of this book, but make no expressed
or implied warranty of any kind and assume no responsibility for errors or omissions. No liability
is assumed for incidental or consequential damages in connection with or arising out of the use of
the information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases
or special sales, which may include electronic versions and/or custom covers and content
particular to your business, training goals, marketing focus, and branding interests. For more
information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
corpsales@pearsontechgroup.com
For sales outside the United States, please contact:
International Sales
international@pearsoned.com
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data
Stevens, W. Richard.
Advanced programming in the UNIX environment/W. Richard Stevens, Stephen A. Rago. —
Third edition.
pages cm
Includes bibliographical references and index.
ISBN 978-0-321-63773-4 (pbk. : alk. paper)
1. Operating systems (Computers) 2. UNIX (Computer file) I. Rago, Stephen A. II. Title.
QA76.76.O63S754 2013
005.4’32—dc23
2013004509
Copyright © 2013 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected
by copyright, and permission must be obtained from the publisher prior to any prohibited
reproduction, storage in a retrieval system, or transmission in any form or by any means,
electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use mate-
rial from this work, please submit a written request to Pearson Education, Inc., Permissions
Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request
to (201) 236-3290.
ISBN-13: 978-0-321-63773-4
ISBN-10: 0-321-63773-9
Text printed in the United States on recycled paper at Edwards Brothers Malloy in Ann Arbor,
Michigan.
First printing, May 2013
ptg10805159
Contents
Foreword tothe Second Edition xix
Preface xxi
Preface to the Second Edition xxv
Preface to the First Edition xxix
Chapter 1. UNIX System Overview1
1.1 Introduction 1
1.2 UNIX Architecture 1
1.3 Logging In 2
1.4 Files and Directories 4
1.5 Input and Output 8
1.6 Programs and Processes 10
1.7 Error Handling 14
1.8 User Identification 16
1.9 Signals 18
1.10 Time Values 20
1.11 System Calls and Librar y Functions 21
1.12 Summary23
Chapter 2. UNIX Standardization and Implementations 25
2.1 Introduction 25
ix
ptg10805159
x Contents
2.2 UNIX Standardization 25
2.2.1 ISO C25
2.2.2 IEEE POSIX 26
2.2.3 The Single UNIX Specification 30
2.2.4 FIPS 32
2.3 UNIX System Implementations 33
2.3.1 UNIX System V Release 4 33
2.3.2 4.4BSD 34
2.3.3 FreeBSD 34
2.3.4 Linux 35
2.3.5 Mac OS X 35
2.3.6 Solaris 35
2.3.7 Other UNIX Systems 35
2.4 Relationship of Standards and Implementations 36
2.5 Limits 36
2.5.1 ISO CLimits 37
2.5.2 POSIX Limits 38
2.5.3 XSI Limits 41
2.5.4 sysconf, pathconf,and fpathconf
Functions 42
2.5.5 Indeterminate Runtime Limits 49
2.6 Options 53
2.7 Feature Test Macros 57
2.8 PrimitiveSystem Data Types 58
2.9 Differences Between Standards 58
2.10 Summary60
Chapter 3. File I/O 61
3.1 Introduction 61
3.2 File Descr iptors 61
3.3 open and openat Functions 62
3.4 creat Function 66
3.5 close Function 66
3.6 lseek Function 66
3.7 read Function 71
3.8 write Function 72
3.9 I/O Efficiency 72
3.10 File Shar ing 74
3.11 Atomic Operations 77
3.12 dup and dup2 Functions 79
3.13 sync, fsync,and fdatasync Functions 81
3.14 fcntl Function 82
ptg10805159
Contents xi
3.15 ioctl Function 87
3.16 /dev/fd 88
3.17 Summary90
Chapter 4. Files and Directories 93
4.1 Introduction 93
4.2 stat, fstat, fstatat,and lstat Functions 93
4.3 File Ty pes 95
4.4 Set-User-ID and Set-Group-ID 98
4.5 File Access Per missions 99
4.6 Ownership of NewFiles and Directories 101
4.7 access and faccessat Functions 102
4.8 umask Function 104
4.9 chmod, fchmod,and fchmodat Functions 106
4.10 Sticky Bit 108
4.11 chown, fchown, fchownat,and lchown
Functions 109
4.12 File Size111
4.13 File Tr uncation 112
4.14 File Systems 113
4.15 link, linkat, unlink, unlinkat,and remove
Functions 116
4.16 rename and renameat Functions 119
4.17 Symbolic Links 120
4.18 Creating and Reading Symbolic Links 123
4.19 File Times 124
4.20 futimens, utimensat,and utimes Functions 126
4.21 mkdir, mkdirat,and rmdir Functions 129
4.22 Reading Director ies 130
4.23 chdir, fchdir,and getcwd Functions 135
4.24 Device Special Files 137
4.25 Summary of File Access Per mission Bits 140
4.26 Summary140
Chapter 5. StandardI/O Library143
5.1 Introduction 143
5.2 Streams and FILE Objects 143
5.3 Standard Input, Standard Output, and Standard
Error 145
5.4 Buffer ing 145
5.5 Opening aStream 148
剩余1025页未读,继续阅读
资源评论
wuzengde
- 粉丝: 1
- 资源: 37
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功