E-book: Linux System Programming Techniques
Become a proficient Linux system programmer using expert recipes and techniques. Get this ebook: “Linux System Programming Techniques” ($27.99 Value) FREE for a Limited Time!
Become a proficient Linux system programmer using expert recipes and techniques. Get this ebook: “Linux System Programming Techniques” for free!
Linux system programming is all about developing system programs for the Linux operating system. Linux is the world’s most popular open-source operating system and runs on everything from big servers to small Internet of Things (IoT) devices. Knowing how to write system programs for Linux will enable you to extend the operating system and connect it with other programs and systems.
In this ebook, we will start by learning how to make our programs easy to script and easy to interact with other programs. When we write system programs for Linux, we should always strive to make them small and do one thing only—and do it well. This is one of the key concepts in Linux: to create small programs that can exchange data with each other in simple ways.
As we move ahead, we’ll take a deep dive into C and look at how the compiler works, what the linker does, how to write Makefiles, and much more.Then, we’ll learn all about forking and daemons. We’ll also create our own daemon. We will then put our daemon under systemd’s control. This will enable us to start, stop, and restart the daemon using built-in Linux tools.
We will also learn how to make our processes exchange information using different kinds of Inter-Process Communication (IPC). We’ll also take a look at how to write threaded programs.
At the end of this book, we’ll cover how to debug our programs using the GNU Debugger (GDB) and Valgrind. By the end of this book, you’ll be able to write a wide variety of system programs for
Linux—everything from filters to daemons.
Who this book is for
This Linux System Programming Techniques e-book is intended for anyone who wants to develop system programs for Linux and wants to have a deep understanding of the Linux system. Anyone facing any issues related to a particular part of Linux system programming and looking for some specific recipes or solutions can take advantage of this book.
What this book covers
- Chapter 1, Getting the Necessary Tools and Writing Our First Linux Programs, shows you how to install the tools we need throughout this book. We also write our first program in this chapter.
- Chapter 2, Making Your Programs Easy to Script, covers how—and why—we should make our programs easy to script and easy to be used by other programs on the system.
- Chapter 3, Diving Deep into C in Linux, takes us on a journey into the inner workings of C programming in Linux. We learn how to use system calls, how the compiler works, how to use the Make tool, how to specify different C standards, and so on.
- Chapter 4, Handling Errors in Your Programs, teaches us how to handle errors gracefully.
- Chapter 5, Working with File I/O and Filesystem Operations, covers how to read and write to files, using both file descriptors and streams. This chapter also covers how to create and delete files and read file permissions using system calls.
- Chapter 6, Spawning Processes and Using Job Control, covers how forking works, how to create a daemon, what parent processes are, and how to send jobs to the background and foreground.
- Chapter 7, Using systemd to Handle Your Daemons, shows us how to put our daemon from the previous chapter under the control of systemd. This chapter also teaches us how to write logs to systemd’s journal and how to read those logs.
- Chapter 8, Creating Shared Libraries, teaches us what shared libraries are, why they’re important, and how to make our own shared libraries.
- Chapter 9, Terminal I/O and Changing Terminal Behavior, covers how to modify the terminal in different ways—for example, how to disable echoing for a password prompt.
- Chapter 10, Using Different Kinds of IPC, is all about IPC—that is, how to make processes communicate with each other on the system. This chapter covers FIFO, Unix sockets, message queues, pipes, and shared memory.
- Chapter 11, Using Threads in Your Programs, explains what threads are, how to write threaded programs, how to avoid race conditions, and how to optimize threaded programs.
- Chapter 12, Debugging Your Programs, covers debugging using GDB and Valgrind.
To get the most out of this book
To get the most out of this book, you’ll need a basic understanding of Linux, some basic commands, be familiar with moving around the filesystem, and installing new programs. It would help if you also have a basic understanding of programming, preferably the C language.
You will need a Linux computer with root access—either via su or sudo—to complete all the recipes. You’ll also need to install the GCC compiler, the Make tool, GDB, Valgrind, and some other smaller tools. The particular Linux distribution doesn’t matter that much. There are installation instructions in the book for these programs for Debian, Ubuntu, CentOS, Fedora, and Red Hat.
Linux has been around for many years, but it’s only recently that the operating system has become popular in the business world. In this ebook you will learn how to create programs on top of Linux, as well as how to install new packages or fix old ones. You will also learn about security issues with your code and how to prevent them from happening again in the future!
User Reviews
Be the first to review “E-book: Linux System Programming Techniques”
Original price was: $27.99.$0.00Current price is: $0.00.
There are no reviews yet.