The Linux Programming Interface
Processes 137 However, when we compile with optimization, we get the following unexpected results: $ cc -O -o setjmp_vars setjmp ...
138 Chapter 6 6.9 Summary....................................................................................................... ...
MEMORY ALLOCATION Many system programs need to be able to allocate extra memory for dynamic data structures (e.g., linked lists ...
140 Chapter 7 After the program break is increased, the program may access any address in the newly allocated area, but no physi ...
Memory Allocation 141 z provide a simple interface that allows memory to be allocated in small units; and z allow us to arbitrar ...
142 Chapter 7 If the argument given to free() is a NULL pointer, then the call does nothing. (In other words, it is not an error ...
Memory Allocation 143 for (j = 0; j < numAllocs; j++) { ptr[j] = malloc(blockSize); if (ptr[j] == NULL) errExit("malloc"); } ...
144 Chapter 7 In this case, the (glibc) free() function is able to recognize that an entire region at the top end of the heap is ...
Memory Allocation 145 Looking at the implementation of free(), things start to become more interest- ing. When free() places a b ...
146 Chapter 7 To avoid these types of errors, we should observe the following rules: z After we allocate a block of memory, we s ...
Memory Allocation 147 settings are: 0, meaning ignore errors; 1, meaning print diagnostic errors on stderr; and 2, meaning call ...
148 Chapter 7 The numitems argument specifies how many items to allocate, and size specifies their size. After allocating a bloc ...
Memory Allocation 149 Since realloc() may relocate the block of memory, we must use the returned pointer from realloc() for futu ...
150 Chapter 7 The posix_memalign() function differs from memalign() in two respects: z The address of the allocated memory is re ...
Memory Allocation 151 Older versions of glibc, and some other UNIX implementations (mainly BSD derivatives), require the inclusi ...
152 Chapter 7 7.4 Exercises 7-1. Modify the program in Listing 7-1 (free_and_sbrk.c) to print out the current value of the progr ...
Chapter 8: Users and Groups Every user has a unique login name and an associated numeric user identifier (UID). Users can belong ...
154 Chapter 8 In order, these fields are as follows: z Login name: This is the unique name that the user must enter in order to ...
Users and Groups 155 On a stand-alone system, all the password information resides in the file /etc/passwd. However, if we are u ...
156 Chapter 8 or, if one or more usernames are supplied as command-line arguments, then the group memberships of those users.) T ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf