Learning the C, C++17, and POSIX Standards
As stated in Chapter 1, Getting Started with System Programming, system programming is the act of making system calls to perform various actions in coordination with the underlying operating system. Each operating system has its own set of system calls, and how these system calls are made is different.
To prevent the system programmer from having to rewrite their program for each different operating system, several standards have been put into place that wrap the operating system's ABI with a well-defined API.
In this chapter, we will discuss three standards—the C standard, the C++ standard, and the POSIX standard. The C and POSIX standards provide the fundamental language syntax and APIs that wrap an operating system's ABI. Specifically, the C standard defines program linking and execution, the standard C syntax (which a number of higher-level languages, such as C++, are based on), and the C libraries that provide the ABI-to-API wrappers.
The C libraries can be thought of as a subset of the greater POSIX standard, which defines a much larger subset of APIs, including, but not limited to, filesystem, network, and threading libraries.
Finally, the C++ standard defines the C++ syntax, program linking and execution, and the C++ libraries that provide higher-level abstractions of the C and POSIX standards. The majority of this book will revolve around these standard APIs and how to use them with C++17.
This chapter has the following objectives:
- Learning about the C, C++, and POSIX standards
- Understanding program linking and execution, and the differences between C and C++
- Providing a brief overview of the facilities these standards provide, each of which will be discussed in greater detail later in the book