TOP
0
0
【簡體曬書節】 單本79折,5本7折,優惠只到5/31,點擊此處看更多!
Linux System Programming(簡體書)
滿額折

Linux System Programming(簡體書)

商品資訊

人民幣定價:78 元
定價
:NT$ 468 元
優惠價
87407
領券後再享88折起
海外經銷商無庫存,到貨日平均30天至45天
可得紅利積點:12 點
相關商品
商品簡介
作者簡介
名人/編輯推薦
目次
書摘/試閱

商品簡介

如何編寫那些直接依賴于Linux內核和核心系統庫提供的服務的軟件?通過《Linux系統編程(影印版第2版)》這本詳盡的書籍,Linux內核參與者Robert Love(洛夫)為你提供了Linux系統編程方面的教程,Linux系統調用的參考手冊,以及對于如何編寫更聰明和更快的代碼的來自內部人士的建議。 Love清晰地指出了POSIX標準函數和Linux特別提供服務之間的差異。通過關于多線程的新章節,這本修訂和擴展的版本在理論和實踐上相結合,從多個編程主題上提供了深入的見解。

作者簡介

作者:(美國)洛夫(Robert Love)

洛夫(Robert Love)在Linux早期就已經介入,他為Linux內核和GNOME桌面環境做出了自己的貢獻。Robert是Google公司的資深軟件工程師,他隸屬于設計和發布Android的開發隊伍。

名人/編輯推薦

如何編寫那些直接依賴于Linux內核和核心系統庫提供的服務的軟件?通過《Linux系統編程(影印版第2版)》這本詳盡的書籍,Linux內核參與者Robert Love(洛夫)為你提供了Linux系統編程方面的教程,Linux系統調用的參考手冊,以及對于如何編寫更聰明和更快的代碼的來自內部人士的建議。
Love清晰地指出了POSIX標準函數和Linux特別提供服務之間的差異。通過關于多線程的新章節,這本修訂和擴展的版本在理論和實踐上相結合,從多個編程主題上提供了深入的見解。

目次

Foreword
Preface
1.Introduction and Essential Concepts
System Programming
Why Learn System Programming
Cornerstones of System Programming
System Calls
The C Library
The C Compiler
APIs and ABIs
APIs
ABIs
Standards
POSIX and SUS History
C Language Standards
Linux and the Standards
This Book and the Standards
Concepts of Linux Programming
Files and the Filesystem
Processes
Users and Groups
Permissions
Signals
Interprocess Communication
Headers
Error Handling
Getting Started with System Programming
2.File I/O
Opening Files
The open() System Call
Owners of New Files
Permissions of New Files
The creat0 Function
Return Values and Error Codes
Reading via read()
Return Values
Reading All the Bytes
Nonblocking Reads
Other Error Values
Size Limits on read()
Writing with write()
Partial Writes
Append Mode
Nonblocking Writes
Other Error Codes
Size Limits on write()
Behavior of write()
Synchronized I/O
fsync0 and fdatasync0
sync0
The O SYNC Flag
O_DSYNC and O_RSYNC
Direct I/O
Closing Files
Error Values
Seeking with lseek0
Seeking Past the End of a File
Error Values
Limitations
Positional Reads and Writes
Error Values
Truncating Files
Multiplexed I/O
select()
poll()
poll() Versus select()
Kernel Internals
The Virtual Filesystem
The Page Cache
Page Writeback
Conclusion
3.Buffered I/O
User—Buffered I/O
Block Size
Standard I/O
File Pointers
Opening Files
Modes
Opening a Stream via File Descriptor
Closing Streams
Closing All Streams
Reading from a Stream
Reading a Character at a Time
Reading an Entire Line
Reading Binary Data
Writing to a Stream
Writing a Single Character
Writing a String of Characters
Writing Binary Data
Sample Program Using Buffered I/O
Seeking a Stream
Obtaining the Current Stream Position
Flushing a Stream
Errors and End—of—File
Obtaining the Associated File Descriptor
Controlling the Buffering
Thread Safety
Manual File Locking
Unlocked Stream Operations
Critiques of Standard I/O
Conclusion
4.Advanced File I/O
Scatter/Gather I/O
readv() and writev()
Event Poll
Creating a New Epolllnstance
Controlling Epoll
Waiting for Events with Epoll
Edge— Versus Level—Triggered Events
Mapping Files into Memory
mmap()
munmap()
Mapping Example
Advantages of mmap0
Disadvantages ofmmap()
Resizing a Mapping
Changing the Protection of a Mapping
Synchronizing a File with a Mapping
Giving Advice on a Mapping
Advice for Normal File I/O
The posix_fadvise() System Call
The readahead0 System Call
Advice Is Cheap
Synchronized, Synchronous, and Asynchronous Operations
Asynchronous I/O
I/O Schedulers and I/O Performance
Disk Addressing
The Life of an I/O Scheduler
Helping Out Reads
Selecting and Configuring Your I/O Scheduler
Optimzing I/O Performance
Conclusion
5.Process Management
Programs, Processes, and Threads
The Process ID
Process ID Allocation
The Process Hierarchy
pid_t
Obtaining the Process ID and Parent Process ID
Running a New Process
The Exec Family of Calls
The fork() System Call
Terminating a Process
Other Ways to Terminate
atexit()
on_ exit()
SIGCHLD
Waiting for Terminated Child Processes
Waiting for a Specific Process
Even More Waiting Versatility
BSD Wants to Play: wait3() and wait4()
Launching and Waiting for a New Process
Zombies
Users and Groups
Real, Effective, and Saved User and Group IDs
Changing the Real or Saved User or Group ID
Changing the Effective User or Group ID
Changing the User and Group IDs, BSD Style
Changing the User and Group IDs, HP—UX Style
Preferred User/Group ID Manipulations
Support for Saved User IDs
Obtaining the User and Group IDs
Sessions and Process Groups
Session System Calls
Process Group System Calls
Obsolete Process Group Functions
Daemons
Conclusion
……
6.Advanced Process Management
7.Threading
8.File and Directory Management
9.MemoryManagement
10.Signals
11.Time
A.GCC Extensions to the C Language
B.Bibliography
Index

書摘/試閱



Furthermore, when the process issues an exec call, the effective user is usually unchanged.But it is during the exec callthat the key difference between real and effective IDs emerges: by executing a setuid (suid) binary, the process can change its effective user ID.To be exact, the effective user ID is set to the user ID ofthe owner ofthe programFile.For instance, because the /usr/bin/passwd File is a setuid file and root is its owner,when a normal users shell spawns a process to exec this File, the process takes on the effective user ID of root regardless of who the executing user is.
Nonprivileged users may set the effective user ID to the real or the saved user ID, asyoull see momentarily The superuser may set the effective user ID to any value.The saved user ID is the processs original effective user ID.When a process forks, the child inherits the saved user ID ofits parent.Upon an exec call, however, the kernel sets the saved user ID to the effective user ID, thereby making a record of the effective userID at the time of the exec.Nonprivileged users may not change the saved user ID; thesuperuser can change it to the same value as the real user ID.What is the point of all these values? The effective user ID is the value that matters: itsthe user ID that is checked in the course of validating a processs credentials.The real user ID and saved user ID act as surrogates or potential user ID values that nonroot processes are allowed to switch to and from.The real user ID is the effective user ID belonging to the user actually running the program, and the saved user ID is the effectiveuser ID from before a suid binary caused a change during exec.
(hanging the Real or Saved User or Group ID
The user and group IDs are set via two system calls:
A call to setuid ( )sets the effective user ID ofthe current process.Ifthe current effective user ID of the process is O (root), the real and saved user IDs are also set.The root user may provide any value for uid, thereby setting all three of the user ID values to uid.A nonroot user is allowed only to provide the real or saved user ID for uid.In other words, a nonroot user can only set the effective user ID to one of those values.

您曾經瀏覽過的商品

購物須知

大陸出版品因裝訂品質及貨運條件與台灣出版品落差甚大,除封面破損、內頁脫落等較嚴重的狀態,其餘商品將正常出貨。

特別提醒:部分書籍附贈之內容(如音頻mp3或影片dvd等)已無實體光碟提供,需以QR CODE 連結至當地網站註冊“並通過驗證程序”,方可下載使用。

無現貨庫存之簡體書,將向海外調貨:
海外有庫存之書籍,等候約45個工作天;
海外無庫存之書籍,平均作業時間約60個工作天,然不保證確定可調到貨,尚請見諒。

為了保護您的權益,「三民網路書店」提供會員七日商品鑑賞期(收到商品為起始日)。

若要辦理退貨,請在商品鑑賞期內寄回,且商品必須是全新狀態與完整包裝(商品、附件、發票、隨貨贈品等)否則恕不接受退貨。

優惠價:87 407
海外經銷商無庫存,到貨日平均30天至45天