Advanced Programming in the UNIX® Environment
ptg10805159 Section 15.3 popenandpcloseFunctions 547 parent filter program user at a terminal popenpipe stdout prompt stdout use ...
ptg10805159 548 Interprocess Communication Chapter 15 if ((fpin = popen("myuclc", "r")) == NULL) err_sys("popen error"); for ( ; ...
ptg10805159 Section 15.4 Coprocesses 549 parent child (coprocess) fd1[1] fd2[0] stdin stdout pipe1 pipe2 Figure 15.16Driving a c ...
ptg10805159 550 Interprocess Communication Chapter 15 main(void) { int n, fd1[2], fd2[2]; pid_t pid; char line[MAXLINE]; if (sig ...
ptg10805159 Section 15.4 Coprocesses 551 } exit(0); } static void sig_pipe(int signo) { printf("SIGPIPE caught\n"); exit(1); } F ...
ptg10805159 552 Interprocess Communication Chapter 15 If we invoke this new coprocess from the program in Figure15.18, it no lon ...
ptg10805159 Section 15.5 FIFOs 553 #include <sys/stat.h> int mkfifo(const char *path,mode_tmode); int mkfifoat(intfd,const ...
ptg10805159 554 Interprocess Communication Chapter 15 interleaved. As with pipes, the constantPIPE_BUFspecifies the maximum amou ...
ptg10805159 Section 15.5 FIFOs 555 input file prog1 tee FIFO prog3 prog2 Figure 15.21 Using a FIFO andteeto send a stream to two ...
ptg10805159 556 Interprocess Communication Chapter 15 client ... client well-known FIFO server readrequests client-specific FIFO ...
ptg10805159 Section 15.6 XSI IPC 557 given IPC structure is created and then removed, the identifier associated with that struct ...
ptg10805159 558 Interprocess Communication Chapter 15 thenftokusually returns two different keys for the two pathnames. However, ...
ptg10805159 Section 15.6 XSI IPC 559 Permission Bit user-read 0400 user-write (alter) 0200 group-read 0040 group-write (alter) 0 ...
ptg10805159 560 Interprocess Communication Chapter 15 Since these forms of IPC don’t use file descriptors, we can’t use the mult ...
ptg10805159 Section 15.7 Message Queues 561 15.7 Message Queues Amessage queue is a linked list of messages stored within the ke ...
ptg10805159 562 Interprocess Communication Chapter 15 The first function normally called ismsggetto either open an existing queu ...
ptg10805159 Section 15.7 Message Queues 563 We’ll see that these three commands (IPC_STAT,IPC_SET,andIPC_RMID)are also provided ...
ptg10805159 564 Interprocess Communication Chapter 15 Note how ungracefully the removal of a message queue is handled. Since a r ...
ptg10805159 Section 15.8 Semaphores 565 Example — Timing Comparison of Message Queues and Full-DuplexPipes If we need a bidirect ...
ptg10805159 566 Interprocess Communication Chapter 15 When a process is done with a shared resource that is controlled by a sema ...
«
25
26
27
28
29
30
31
32
33
34
»
Free download pdf