Summary Files Commits Branches @commit @diff @stats
path: root / Year 3 / System programming / Practicum4 / ex3.c
blob: 8df352b2ed71784c08afecf1dd30c5c48af9a2af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>

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);
}