From a97b8f7687cdd75be72547a20222a50a56ee7b28 Mon Sep 17 00:00:00 2001 From: Matthew Strapp Date: Mon, 21 Sep 2020 08:26:21 -0500 Subject: Do second breakout --- csci4061/092120_breakout/main.c | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 csci4061/092120_breakout/main.c (limited to 'csci4061/092120_breakout') diff --git a/csci4061/092120_breakout/main.c b/csci4061/092120_breakout/main.c new file mode 100644 index 0000000..835dd88 --- /dev/null +++ b/csci4061/092120_breakout/main.c @@ -0,0 +1,49 @@ +/* +CSci 4061 - Recitation 2 - 21st Sept 2020 +Full Name : x500 +Full Name : x500 +Full Name : x500 +Full Name : x500 +Matthew Strapp : strap012 +*/ + +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + // take 'n' from the input and convert to integer + // hint: see cmd slide + if (argc < 2) { + printf("USAGE: ./main int\n"); + return -1; + } + int n = strtol(argv[1], NULL, 10); + // for i in n + // create child process + // print pid //hint: check week 2 slides + // call execl to print 'hello there' using 'echo' //hint: check recitation slide + pid_t pid; + for (int i=0; i