Right, is there anyone here who knows how to code the canonical Hello, world C program? Okay, very amusing, let's check out the one meaningful line therein:
printf("Hello, world.\n");
The process is calling the printf(3) function. Have you written the code of the printf()? "No, of course not," you say, "it's within the standard libc C library, typically glibc (GNU libc) on Linux." But hang on, unless the code and data of printf (and similarly all other library APIs) is actually within the process VAS, how can we ever access it? (Recall, you can't look outside the box!) For that, the code (and data) of printf(3) (in fact, of the glibc library) must be mapped within the process box – the process VAS. It is indeed mapped within the process VAS, in the library segments or mappings (as we saw in Chapter 6, Kernel Internals Essentials – Processes...