From 1bdb3c6f5316edaf8e9943a99c210ecc0ec70751 Mon Sep 17 00:00:00 2001 From: Simone Piccardi Date: Thu, 3 Apr 2003 22:33:29 +0000 Subject: [PATCH 1/1] 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 --- listati/ForkTest.c | 44 +++++++++++++++++++++++++++++++++++++++++++ listati/char_list.c | 1 + listati/env_ptr.c | 1 + listati/exec_sample.c | 1 + listati/main_def.c | 1 + listati/option_code.c | 28 +++++++++++++++++++++++++++ listati/pi.c | 1 + listati/vect.c | 1 + 8 files changed, 78 insertions(+) create mode 100644 listati/ForkTest.c create mode 100644 listati/char_list.c create mode 100644 listati/env_ptr.c create mode 100644 listati/exec_sample.c create mode 100644 listati/main_def.c create mode 100644 listati/option_code.c create mode 100644 listati/pi.c create mode 100644 listati/vect.c 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