Lines Matching +full:wait +full:- +full:on +full:- +full:read

1 .\" Copyright (C) Caldera International Inc. 2001-2002.  All rights reserved.
32 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
57 For instance, to time-stamp the output of a program,
66 the in-memory formatting capabilities of
83 Low-Level Process Creation \(em Execl and Execv
92 routine is based on.
115 but this is seldom used except as a place-holder.
201 execl("/bin/sh", "sh", "-c", commandline, NULL);
206 .UL -c
213 Control of Processes \(em Fork and Wait
221 Since these routines simply overlay the new program on the old one,
241 is non-zero; it is the process number of the child.
246 execl("/bin/sh", "sh", "-c", cmd, NULL); /* in child */
261 returns non-zero
267 .UL -1 ).
269 More often, the parent wants to wait for the child to terminate
273 .UL wait :
279 wait(&status);
288 .UL wait
295 funny behavior on the part of the child
307 .UL wait
308 encodes in its low-order eight bits
310 it is 0 for normal termination and non-zero to indicate
341 that has been read by the caller.
378 if (stat == -1)
384 is the read side of the pipe and
388 .UL read ,
395 it will wait until data arrives;
397 is too full, it will wait until the pipe empties somewhat.
400 .UL read
412 read or write that process, according to
438 The child decides whether it is supposed to read or write,
444 These closes are necessary to make end-of-file tests work properly.
445 For example, if a child that intends to read
452 #define READ 0
454 #define tst(a, b) (mode == READ ? (b) : (a))
466 close(tst(p[WRITE], p[READ]));
468 dup(tst(p[READ], p[WRITE]));
469 close(tst(p[READ], p[WRITE]));
470 execl("/bin/sh", "sh", "-c", cmd, 0);
473 if (popen_pid == -1)
475 close(tst(p[READ], p[WRITE]));
476 return(tst(p[WRITE], p[READ]));
484 that the task is to create a child process that will read data from the parent.
488 leaving the read side open.
492 dup(tst(p[READ], p[WRITE]));
508 is to copy the file descriptor for the pipe (read side)
510 thus the read side of the pipe becomes the standard input.
512 Finally, the old read side of the pipe is closed.
526 is that it is desirable to wait for the termination of the child process.
531 is that only a bounded number of unwaited-for children
534 .UL wait
551 while ((r = wait(&status)) != popen_pid && r != -1);
552 if (r == -1)
553 status = -1;