Linux system programming
This book is about writing software that makes the most effective use of the system you're running on -- code that interfaces directly with the kernel and core system libraries, including the shell, text editor, compiler, debugger, core utilities, and system daemons. The majority of both Unix a...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Beijing ; Cambridge :
O'Reilly
2007.
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627115206719 |
Tabla de Contenidos:
- Linux System Programming; Preface; Contents of This Book; Versions Covered in This Book; Conventions Used in This Book; Safari® Books Online; Using Code Examples; How to Contact Us; Acknowledgments; 1. Introduction and Essential Concepts; The C Library; The C Compiler; APIs and ABIs; ABIs; Standards; C Language Standards; Linux and the Standards; This Book and the Standards; Concepts of Linux Programming; Directories and links; Hard links; Symbolic links; Special files; Filesystems and namespaces; Processes; Process hierarchy; Users and Groups; Permissions; Signals; Interprocess Communication
- HeadersError Handling; Getting Started with System Programming; 2. File I/O; Owners of New Files; Permissions of New Files; The creat( ) Function; Return Values and Error Codes; Reading via read( ); Reading All the Bytes; Nonblocking Reads; Other Error Values; Size Limits on read( ); Writing with write( ); Append Mode; Nonblocking Writes; Other Error Codes; Size Limits on write( ); Behavior of write( ); Synchronized I/O; sync( ); The O_SYNC Flag; O_DSYNC and O_RSYNC; Direct I/O; Closing Files; Seeking with lseek( ); Error Values; Limitations; Positional Reads and Writes; Truncating Files
- Multiplexed I/Oselect( ) example; Portable sleeping with select( ); pselect( ); poll( ); poll( ) example; ppoll( ); poll( ) Versus select( ); Kernel Internals; The Page Cache; Page Writeback; Conclusion; 3. Buffered I/O; Standard I/O; Opening Files; Opening a Stream via File Descriptor; Closing Streams; Reading from a Stream; Reading an Entire Line; Reading Binary Data; Writing to a Stream; Writing a String of Characters; Writing Binary Data; Sample Program Using Buffered I/O; Seeking a Stream; Flushing a Stream; Errors and End-of-File; Obtaining the Associated File Descriptor
- Controlling the BufferingThread Safety; Unlocked Stream Operations; Critiques of Standard I/O; Conclusion; 4. Advanced File I/O; writev( ) example; readv( ) example; Implementation; The Event Poll Interface; Controlling Epoll; Waiting for Events with Epoll; Edge- Versus Level-Triggered Events; Mapping Files into Memory; getpagesize( ); PAGE_SIZE; Return values and error codes; Associated signals; munmap( ); Mapping Example; Advantages of mmap( ); Disadvantages of mmap( ); 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/OThe readahead( ) System Call; Advice Is Cheap; Synchronized, Synchronous, and Asynchronous Operations; I/O Schedulers and I/O Performance; The Life of an I/O Scheduler; Helping Out Reads; The Anticipatory I/O Scheduler; The CFQ I/O Scheduler; The Noop I/O Scheduler; Selecting and Configuring Your I/O Scheduler; Optimizing I/O Performance; Sorting by inode; Sorting by physical block; Conclusion; 5. Process Management; The Process Hierarchy; pid_t; Obtaining the Process ID and Parent Process ID; Running a New Process; Error values; The fork( ) System Call; vfork( )
- Terminating a Process