25 lines
483 B
C
25 lines
483 B
C
|
#include <stdio.h>
|
||
|
#include <sys/types.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <unistd.h>
|
||
|
#include <string.h>
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
pid_t pid;
|
||
|
if ((pid = fork()) != -1)
|
||
|
{
|
||
|
if (pid == 0)
|
||
|
{
|
||
|
printf("dziecko\n");
|
||
|
char const *arg[2];
|
||
|
arg[0] = "touch";
|
||
|
arg[1] = "tt";
|
||
|
execvp(arg[0], arg);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
waitpid(pid);
|
||
|
printf("rodzic\n");
|
||
|
}
|
||
|
}
|
||
|
}
|