The Linux Programming Interface
Processes 117 compiler and an application binary interface in which all arguments are passed on the stack. In practice, an optim ...
118 Chapter 6 An application binary interface (ABI) is a set of rules specifying how a binary exe- cutable should exchange infor ...
Processes 119 Figure 6-1: Typical memory layout of a process on Linux/x86-32 The upshot of locality of reference is that it is p ...
120 Chapter 6 Figure 6-2: Overview of virtual memory In order to support this organization, the kernel maintains a page table fo ...
Processes 121 Virtual memory management separates the virtual address space of a process from the physical address space of RAM. ...
122 Chapter 6 In virtual memory terms, the stack segment increases in size as stack frames are allocated, but on most implementa ...
Processes 123 two arguments to the function main(). The first argument, int argc, indicates how many command-line arguments ther ...
124 Chapter 6 Since the argv list is terminated by a NULL value, we could alternatively code the body of the program in Listing ...
Processes 125 6.7 Environment List Each process has an associated array of strings called the environment list, or simply the en ...
126 Chapter 6 The env command runs a program using a modified copy of the shell’s envi- ronment list. The environment list can b ...
Processes 127 and there is no variable (corresponding to argc) that specifies the size of the envi- ronment list. (For similar r ...
128 Chapter 6 z SUSv3 permits an implementation of getenv() to return its result using a stati- cally allocated buffer that may ...
Processes 129 The setenv() function creates a new environment variable by allocating a memory buffer for a string of the form na ...
130 Chapter 6 In some circumstances, the use of setenv() and clearenv() can lead to memory leaks in a program. We noted above th ...
Processes 131 Listing 6-4: Modifying the process environment ––––––––––––––––––––––––––––––––––––––––––––––––––––––––– proc/modi ...
132 Chapter 6 handled by its caller. This is perfectly valid, and, in many cases, the desirable method for handling this kind of ...
Processes 133 same env variable, to perform the fake return. Since the setjmp() and longjmp() calls are in different functions ( ...
134 Chapter 6 Listing 6-5: Demonstrate the use of setjmp() and longjmp() ––––––––––––––––––––––––––––––––––––––––––––––––––––––– ...
Processes 135 z as part of a comparison operation (==, !=, <, and so on), where the other oper- and is an integer constant ex ...
136 Chapter 6 This means that optimized variables may end up with incorrect values as a conse- quence of a longjmp() operation. ...
«
4
5
6
7
8
9
10
11
12
13
»
Free download pdf