2 options
Linux system programming techniques : become a proficient Linux system programmer using expert recipes and techniques / Jack-Benny Persson.
- Format:
- Book
- Author/Creator:
- Persson, Jack-Benny, author.
- Language:
- English
- Subjects (All):
- Linux.
- Operating systems (Computers).
- Computer programming.
- Physical Description:
- 1 online resource (432 pages) : illustrations
- Place of Publication:
- Birmingham, England : Packt Publishing, Limited, [2021]
- Biography/History:
- Persson Jack-Benny: Jack-Benny Persson is a consultant and author based in Sweden. He has written several books about Linux and programming. His passion for Linux and other Unix-like systems started as a hobby more than 20 years ago. Since then, he has spent most of his spare time reading about Linux, tinkering with Linux servers, and writing about Linux administration. Today he has his own IT and media company in Sweden that focuses on Linux. Jack-Benny holds an Advanced Higher Vocational Education Diploma as a Linux system specialist. He has also studied electronics, networking, and security.
- Summary:
- 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 practical examplesLearn how to develop your own programs for LinuxBook DescriptionLinux is the world's most popular open source operating system (OS). Linux System Programming Techniques will enable you to extend the Linux OS with your own system programs and communicate with other programs on the system. The book begins by exploring the Linux filesystem, its basic commands, built-in manual pages, the GNU compiler collection (GCC), and Linux system calls. You'll then discover how to handle errors in your programs and will learn to catch errors and print relevant information about them. The book takes you through multiple recipes on how to read and write files on the system, using both streams and file descriptors. As you advance, you'll delve into forking, creating zombie processes, and daemons, along with recipes on how to handle daemons using systemd. After this, you'll find out how to create shared libraries and start exploring different types of interprocess communication (IPC). In the later chapters, recipes on how to write programs using POSIX threads and how to debug your programs using the GNU debugger (GDB) and Valgrind will also be covered. By the end of this Linux book, you will be able to develop your own system programs for Linux, including daemons, tools, clients, and filters.What you will learnDiscover how to write programs for the Linux system using a wide variety of system callsDelve into the working of POSIX functionsUnderstand and use key concepts such as signals, pipes, IPC, and process managementFind out how to integrate programs with a Linux systemExplore advanced topics such as filesystem operations, creating shared libraries, and debugging your programsGain an overall understanding of how to debug your programs using ValgrindWho this book is forThis book is for anyone who wants to develop system programs for Linux and gain a deeper understanding of the Linux system. The book is beneficial for anyone who is facing issues related to a particular part of Linux system programming and is looking for specific recipes or solutions.
- Contents:
- 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
- Writing a simple C program for Linux
- There's more...
- Writing a program that parses command-line options
- Looking up information in the built-in manual page
- Searching the manual for information
- Chapter 2: Making Your Programs Easy to Script
- Return values and how to read them
- See also
- Exiting a program with a relevant return value
- Redirecting stdin, stdout, and stderr
- Connecting programs using pipes
- Writing to stdout and stderr
- Reading from stdin
- Writing a pipe-friendly program
- Redirecting the result to a file
- Reading environment variables
- How it works....
- Chapter 3: Diving Deep into C in Linux
- Linking against libraries using GCC
- Changing C standards
- Using system calls - and when not to use them
- Getting information about Linux- and Unix-specific header files
- Defining feature test macros
- Looking at the four stages of compilation
- Compiling with Make
- Writing a generic Makefile with GCC options
- Writing a simple Makefile
- Writing a more advanced Makefile
- Chapter 4: Handling Errors in Your Programs
- Why error handling is important in system programming
- Handling some common errors
- Error handling and errno
- Handling more errno macros
- Using errno with strerror()
- Using errno with perror()
- Returning an error value
- Chapter 5: Working with File I/O and Filesystem Operations
- Technical requirements.
- Reading inode information and learning the filesystem
- Creating soft links and hard links
- Creating files and updating the timestamp
- Deleting files
- Getting access rights and ownership
- Setting access rights and ownership
- Writing to files with file descriptors
- Reading from files with file descriptors
- Writing to files with streams
- Reading from files with streams
- Reading and writing binary data with streams
- Moving around inside a file with lseek()
- Moving around inside a file with fseek()
- Chapter 6: Spawning Processes and Using Job Control
- Exploring how processes are created
- Using job control in Bash
- Controlling and terminating processes using signals
- Replacing the program in a process with execl()
- Forking a process
- Getting ready.
- How to do it...
- Executing a new program in a forked process
- Starting a new process with system()
- Creating a zombie process
- Learning about what orphans are
- Creating a daemon
- Implementing a signal handler
- Chapter 7: Using systemd to Handle Your Daemons
- Getting to know systemd
- Writing a unit file for a daemon
- Enabling and disabling a service - and starting and stopping it
- Creating a more modern daemon for systemd
- Making the new daemon a systemd service
- Reading the journal
- Chapter 8: Creating Shared Libraries
- The what and why of libraries
- Creating a static library
- Using a static library
- Creating a dynamic library
- Installing the dynamic library on the system
- Using the dynamic library in a program
- Compiling a statically linked program
- Chapter 9: Terminal I/O and Changing Terminal Behavior
- Viewing terminal information
- Changing terminal settings with stty
- Investigating TTYs and PTYs and writing to them
- Checking if it's a TTY
- Creating a PTY
- Disabling echo for password prompts
- Reading the terminal size
- Chapter 10: Using Different Kinds of IPC
- Using signals for IPC - building a client for the daemon
- Communicating with a pipe
- FIFO - using it in the shell
- FIFO - building the sender
- FIFO - building the receiver
- Message queues - creating the sender
- Message queues - creating the receiver
- Communicating between child and parent with shared memory
- See also.
- Using shared memory between unrelated processes.
- Notes:
- Includes index.
- Description based on print version record.
- ISBN:
- 9781789959789
- 1789959780
- OCLC:
- 1247679504
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.