Advanced Programming in the UNIX® Environment
ptg10805159 Section 8.9 Race Conditions 247 We assume that the headerapue.hdefines whatever variables arerequired. The five rout ...
ptg10805159 248 Process Control Chapter 8 mean that the race condition doesn’t exist; it simply means that we can’t see it on th ...
ptg10805159 Section 8.10 execFunctions 249 In the program shown in Figure8.13, the parent goes first. The child goes first if we ...
ptg10805159 250 Process Control Chapter 8 The first difference in these functions is that the first four take a pathname argumen ...
ptg10805159 Section 8.10 execFunctions 251 functions, however,use theenvironvariable in the calling process to copy the existing ...
ptg10805159 252 Process Control Chapter 8 Historically,the limit in older System V implementations was 5,120 bytes. Older BSD sy ...
ptg10805159 Section 8.10 execFunctions 253 function from Section 4.22) be closed across anexec.This is normally done by the open ...
ptg10805159 254 Process Control Chapter 8 Example The program in Figure8.16 demonstrates theexecfunctions. #include "apue.h" #in ...
ptg10805159 Section 8.11Changing User IDs and Group IDs 255 #include "apue.h" int main(int argc, char *argv[]) { int i; char **p ...
ptg10805159 256 Process Control Chapter 8 In general, we try to use theleast-privilegemodel when we design our applications. Acc ...
ptg10805159 Section 8.11Changing User IDs and Group IDs 257 Figure8.18 summarizes the various ways these three user IDs can be c ...
ptg10805159 258 Process Control Chapter 8 seteuidandsetegidFunctions POSIX.1 includes the two functionsseteuid and setegid.These ...
ptg10805159 Section 8.11Changing User IDs and Group IDs 259 Example To see the utility of the saved set-user-ID feature, let’s e ...
ptg10805159 260 Process Control Chapter 8 seteuidto set its effective user ID to our user ID. This prevents any accidental misus ...
ptg10805159 Section 8.12 Interpreter Files 261 Example Let’s look at an example to see what the kernel does with the arguments t ...
ptg10805159 262 Process Control Chapter 8 Example Acommon use for the optional argument following the interpreterpathnameis to s ...
ptg10805159 Section 8.12 Interpreter Files 263 When/bin/awkis executed, its command-line arguments are /bin/awk -f /usr/local/bi ...
ptg10805159 264 Process Control Chapter 8 instead of needing to know that the program is really anawkscript that we would otherw ...
ptg10805159 Section 8.13 systemFunction 265 #include <stdlib.h> int system(const char *cmdstring); Returns: (see below) If ...
ptg10805159 266 Process Control Chapter 8 #include <sys/wait.h> #include <errno.h> #include <unistd.h> int sys ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf