Limit search to available items
Book Cover
E-book
Author Persson, Jack-Benny

Title Linux System Programming Techniques Become a Proficient Linux System Programmer Using Expert Recipes and Techniques
Published Birmingham : Packt Publishing, Limited, 2021

Copies

Description 1 online resource (432 p.)
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 -- 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
Summary Find solutions to all your problems related to Linux system programming using practical recipes for developing your own system programs Key Features Develop a deeper understanding of how Linux system programming works Gain hands-on experience of working with different Linux projects with the help of practical examples Learn how to develop your own programs for Linux Book 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 learn Discover how to write programs for the Linux system using a wide variety of system calls Delve into the working of POSIX functions Understand and use key concepts such as signals, pipes, IPC, and process management Find out how to integrate programs with a Linux system Explore advanced topics such as filesystem operations, creating shared libraries, and debugging your programs Gain an overall understanding of how to debug your programs using Valgrind Who this book is for This 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
Notes Description based upon print version of record
SUBJECT Linux. http://id.loc.gov/authorities/names/n94087892
Linux fast
Subject Operating systems (Computers)
Computer programming.
operating systems.
computer programming.
COMPUTERS -- Programming Languages -- C.
COMPUTERS -- System Administration -- Linux & UNIX Administration.
COMPUTERS -- Operating Systems -- Linux.
Computer programming
Operating systems (Computers)
Form Electronic book
ISBN 1789959780
9781789959789