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

int main() {
	pid_t pid = getpid();
	pid_t parentPID = getppid();

	printf("Current: %d\nParent: %d\n", pid, parentPID);
	execlp("ps", "ps", (char*)NULL);
}