Linux system programming techniques become a proficient Linux system programmer using expert recipes and techniques
Find solutions to all your problems related to Linux system programming using practical recipes for developing your own system programsKey FeaturesDevelop a deeper understanding of how Linux system programming worksGain hands-on experience of working with different Linux projects with the help of pr...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing, Limited
[2021]
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631498806719 |
Tabla de Contenidos:
- Cover
- Title Page
- Contributors
- Table of Contents
- Copyright and Credits
- Chapter 1: Getting the Necessary Tools and Writing Our First Linux Programs
- Technical requirements
- Installing Git to download the code repository
- Installing GCC and GNU Make
- Getting ready
- How to do it...
- How it works...
- Installing GDB and Valgrind
- Getting ready
- How to do it...
- How it works...
- Writing a simple C program for Linux
- Getting ready
- How to do it...
- How it works...
- There's more...
- Writing a program that parses command-line options
- Getting ready
- How to do it...
- How it works...
- Looking up information in the built-in manual page
- Getting ready
- How to do it...
- How it works...
- There's more...
- Searching the manual for information
- Getting ready
- How to do it...
- How it works...
- There's more...
- Chapter 2: Making Your Programs Easy to Script
- Technical requirements
- Return values and how to read them
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Exiting a program with a relevant return value
- Getting ready
- How to do it...
- How it works...
- There's more...
- Redirecting stdin, stdout, and stderr
- Getting ready
- How to do it...
- How it works...
- There's more...
- Connecting programs using pipes
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Writing to stdout and stderr
- How to do it...
- How it works...
- There's more...
- Reading from stdin
- Getting ready
- How to do it...
- How it works...
- There's more...
- Writing a pipe-friendly program
- Getting ready
- How to do it...
- How it works...
- There's more...
- Redirecting the result to a file
- Getting ready
- How to do it...
- How it works...
- There's more...
- Reading environment variables
- Getting ready
- How to do it...
- How it works....
- Chapter 3: Diving Deep into C in Linux
- Technical requirements
- Linking against libraries using GCC
- Getting ready
- How to do it...
- How it works...
- There's more...
- Changing C standards
- Getting ready
- How to do it...
- How it works...
- There's more...
- Using system calls - and when not to use them
- Getting ready
- How to do it...
- How it works...
- There's more...
- Getting information about Linux- and Unix-specific header files
- Getting ready
- How to do it...
- How it works...
- There's more...
- Defining feature test macros
- Getting ready
- How to do it...
- How it works...
- There's more...
- Looking at the four stages of compilation
- Getting ready
- How to do it...
- How it works...
- Compiling with Make
- Getting ready
- How to do it...
- How it works...
- Writing a generic Makefile with GCC options
- Getting ready
- How to do it...
- How it works...
- There's more...
- Writing a simple Makefile
- Getting ready
- How to do it...
- How it works...
- Writing a more advanced Makefile
- Getting ready
- How to do it...
- How it works...
- Chapter 4: Handling Errors in Your Programs
- Technical requirements
- Why error handling is important in system programming
- Getting ready
- How to do it...
- How it works...
- Handling some common errors
- Getting ready
- How to do it...
- How it works...
- Error handling and errno
- Getting ready
- How to do it...
- How it works...
- Handling more errno macros
- Getting ready
- How to do it...
- How it works...
- There's more...
- Using errno with strerror()
- Getting ready
- How to do it...
- There's more...
- Using errno with perror()
- Getting ready
- How to do it...
- There's more...
- Returning an error value
- Getting ready
- How to do it...
- How it works...
- There's more...
- Chapter 5: Working with File I/O and Filesystem Operations
- Technical requirements.
- Reading inode information and learning the filesystem
- Getting ready
- How to do it...
- How it works...
- Creating soft links and hard links
- Getting ready
- How to do it...
- How it works...
- There's more...
- Creating files and updating the timestamp
- Getting ready
- How to do it...
- How it works...
- There's more...
- Deleting files
- Getting ready
- How to do it...
- How it works...
- Getting access rights and ownership
- Getting ready
- How to do it...
- How it works...
- Setting access rights and ownership
- Getting ready
- How to do it...
- How it works...
- There's more...
- Writing to files with file descriptors
- Getting ready
- How to do it...
- How it works...
- There's more...
- Reading from files with file descriptors
- Getting ready
- How to do it...
- How it works...
- There's more...
- Writing to files with streams
- Getting ready
- How to do it...
- How it works...
- See also
- Reading from files with streams
- Getting ready
- How to do it...
- How it works...
- There's more...
- Reading and writing binary data with streams
- Getting ready
- How to do it...
- How it works...
- There's more...
- Moving around inside a file with lseek()
- Getting ready
- How to do it...
- How it works...
- Moving around inside a file with fseek()
- Getting ready
- How to do it...
- How it works...
- There's more...
- Chapter 6: Spawning Processes and Using Job Control
- Technical requirements
- Exploring how processes are created
- Getting ready
- How to do it...
- How it works...
- There's more...
- Using job control in Bash
- Getting ready
- How to do it...
- How it works...
- Controlling and terminating processes using signals
- Getting ready
- How to do it...
- How it works...
- See also
- Replacing the program in a process with execl()
- Getting ready
- How to do it...
- How it works...
- See also
- Forking a process
- Getting ready.
- How to do it...
- How it works...
- There's more...
- Executing a new program in a forked process
- Getting ready
- How to do it...
- How it works...
- Starting a new process with system()
- Getting ready
- How to do it...
- How it works...
- Creating a zombie process
- Getting ready
- How to do it...
- How it works...
- There's more...
- Learning about what orphans are
- Getting ready
- How to do it...
- How it works...
- See also
- Creating a daemon
- Getting ready
- How to do it...
- How it works...
- There's more...
- Implementing a signal handler
- Getting ready
- How to do it...
- How it works...
- There's more...
- Chapter 7: Using systemd to Handle Your Daemons
- Technical requirements
- Getting to know systemd
- Getting ready
- How it works...
- There's more...
- See also
- Writing a unit file for a daemon
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Enabling and disabling a service - and starting and stopping it
- Getting ready
- How to do it...
- How it works...
- Creating a more modern daemon for systemd
- Getting ready
- How to do it...
- How it works...
- See also
- Making the new daemon a systemd service
- Getting ready
- How to do it...
- How it works...
- Reading the journal
- Getting ready
- How to do it...
- How it works...
- See also
- Chapter 8: Creating Shared Libraries
- Technical requirements
- The what and why of libraries
- Getting ready
- How to do it...
- How it works...
- There's more...
- Creating a static library
- Getting ready
- How to do it...
- How it works...
- See also
- Using a static library
- Getting ready
- How to do it...
- How it works...
- Creating a dynamic library
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Installing the dynamic library on the system
- Getting ready
- How to do it...
- How it works....
- Using the dynamic library in a program
- Getting ready
- How to do it...
- How it works...
- See also
- Compiling a statically linked program
- Getting ready
- How to do it...
- How it works...
- Chapter 9: Terminal I/O and Changing Terminal Behavior
- Technical requirements
- Viewing terminal information
- Getting ready
- How to do it...
- How it works...
- See also
- Changing terminal settings with stty
- Getting ready
- How to do it...
- How it works...
- Investigating TTYs and PTYs and writing to them
- How to do it...
- How it works...
- There's more...
- See also
- Checking if it's a TTY
- Getting ready
- How to do it...
- How it works...
- See also
- Creating a PTY
- Getting ready
- How to do it...
- How it works...
- See also
- Disabling echo for password prompts
- Getting ready
- How to do it...
- How it works...
- There's more...
- Reading the terminal size
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Chapter 10: Using Different Kinds of IPC
- Technical requirements
- Using signals for IPC - building a client for the daemon
- Getting ready
- How to do it...
- How it works...
- See also
- Communicating with a pipe
- Getting ready
- How to do it...
- How it works...
- See also
- FIFO - using it in the shell
- Getting ready
- How to do it...
- How it works...
- See also
- FIFO - building the sender
- Getting ready
- How to do it...
- How it works...
- See also
- FIFO - building the receiver
- Getting ready
- How to do it...
- How it works...
- See also
- Message queues - creating the sender
- Getting ready
- How to do it...
- How it works...
- See also
- Message queues - creating the receiver
- Getting ready
- How to do it...
- How it works...
- See also
- Communicating between child and parent with shared memory
- Getting ready
- How to do it...
- How it works...
- See also.
- Using shared memory between unrelated processes.