From 65bdc35e6f82ba0fa0259166005263a1fc9795c9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 25 Oct 2023 11:02:02 +0300 Subject: [SP/P4] Solved all exercises --- Year 3/System programming/Practicum4/ex3.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Year 3/System programming/Practicum4/ex3.c (limited to 'Year 3/System programming/Practicum4/ex3.c') diff --git a/Year 3/System programming/Practicum4/ex3.c b/Year 3/System programming/Practicum4/ex3.c new file mode 100644 index 0000000..8df352b --- /dev/null +++ b/Year 3/System programming/Practicum4/ex3.c @@ -0,0 +1,13 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int status = -1; + int fpid = fork(); + if (fpid == 0) + execl(argv[1], argv[1], (char*)NULL); + wait(&status); + printf("Exit status: %d\n", status); +} -- cgit v1.3.1-26-gb76a