The Linux Programming Interface
Process Credentials 177 The getresuid() system call returns the current values of the calling process’s real user ID, effective ...
178 Chapter 9 Although setresuid() and setresgid() provide the most straightforward API for changing process credentials, we can ...
Process Credentials 179 On Linux, as on most UNIX implementations, getgroups() simply returns the calling process’s supplementar ...
180 Chapter 9 The setgroups() system call replaces the calling process’s supplementary group IDs with the set given in the array ...
Process Credentials 181 Note the following supplementary information to Table 9-1: z The glibc implementations of seteuid() (as ...
182 Chapter 9 9.7.5 Example: Displaying Process Credentials The program in Listing 9-1 uses the system calls and library functio ...
Process Credentials 183 p = groupNameFromId(egid); printf("eff=%s (%ld); ", (p == NULL)? "???" : p, (long) egid); p = groupNameF ...
184 Chapter 9 9.9 Exercises 9-1. Assume in each of the following cases that the initial set of process user IDs is real=1000 eff ...
TIME Within a program, we may be interested in two kinds of time: z Real time: This is the time as measured either from some sta ...
186 Chapter 10 10.1 Calendar Time Regardless of geographic location, UNIX systems represent time internally as a measure of seco ...
Time 187 If the tz argument is supplied, then it returns a timezone structure whose fields contain whatever values were specifie ...
188 Chapter 10 Figure 10-1: Functions for retrieving and working with calendar time 10.2.1 Converting time_t to Printable Form T ...
Time 189 A reentrant version of ctime() is provided in the form of ctime_r(). (We explain reentrancy in Section 21.1.2.) This fu ...
190 Chapter 10 number of seconds that the represented time falls east of UTC. The second field, const char *tm_zone, is the abbr ...
Time 191 10.2.3 Converting Between Broken-Down Time and Printable Form In this section, we describe functions that convert a bro ...
192 Chapter 10 #define SECONDS_IN_TROPICAL_YEAR (365.24219 * 24 * 60 * 60) int main(int argc, char *argv[]) { time_t t; struct t ...
Time 193 The strftime() function provides us with more precise control when converting a broken-down time into printable form. G ...
194 Chapter 10 Listing 10-2: A function that returns a string containing the current time –––––––––––––––––––––––––––––––––––––– ...
Time 195 char currTime(const char format) { static char buf[BUF_SIZE]; / Nonreentrant / time_t t; size_t s; struct tm *tm; t = ...
196 Chapter 10 The conversion specifications are similar to those given to strftime() (Table 10-1). The major difference is that ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf