r305_dm/TP3/Exo6/session.c

19 lines
244 B
C
Raw Normal View History

2023-09-27 17:17:45 +02:00
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if (fork()){
printf("session = %d\n",getsid(getpid()));
while(1);
} else {
setsid();
printf("session = %d\n",getsid(getpid()));
while(1);
}
return 0;
}