From: Simone Piccardi Date: Thu, 3 Apr 2003 22:33:29 +0000 (+0000) Subject: Aggiunte i listati per poter usare le modifiche di Mirko, con la generazione X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=commitdiff_plain;h=1bdb3c6f5316edaf8e9943a99c210ecc0ec70751 Aggiunte i listati per poter usare le modifiche di Mirko, con la generazione separata delle figure con gli esempi di codice. Qui ci va tutto quello che prima era messo in un environment lstlisting --- diff --git a/listati/ForkTest.c b/listati/ForkTest.c new file mode 100644 index 0000000..3ca965f --- /dev/null +++ b/listati/ForkTest.c @@ -0,0 +1,44 @@ +#include /* error definitions and routines */ +#include /* C standard library */ +#include /* unix standard library */ +#include /* standard I/O library */ +#include /* string functions */ + +/* Help printing routine */ +void usage(void); + +int main(int argc, char *argv[]) +{ +/* + * Variables definition + */ + int nchild, i; + pid_t pid; + int wait_child = 0; + int wait_parent = 0; + int wait_end = 0; + ... /* handling options */ + nchild = atoi(argv[optind]); + printf("Test for forking %d child\n", nchild); + /* loop to fork children */ + for (i=0; i