Ajout de l'exo 6

This commit is contained in:
2023-09-27 17:17:45 +02:00
parent 2fff4e7471
commit fbd393debc
2 changed files with 54 additions and 1 deletions

18
TP3/Exo6/session.c Normal file
View File

@@ -0,0 +1,18 @@
#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;
}