BUT2/SCR/SCR2/TP03/session.c

19 lines
244 B
C
Raw Permalink Normal View History

2023-10-12 16:39:49 +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;
}