ASR31-valarche-2021/Exemples/04-Exec/apresExec.c

24 lines
628 B
C
Raw Normal View History

2021-09-29 11:31:40 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
char tabRef[1000];
int nbLu;
char c;
int main(void) {
printf("Caractéristiques après recouvrement\n");
printf(" => Identité du processus:%d\n",getpid());
printf(" => Identité du processus père:%d\n",getppid());
printf(" => Propriétaire réel : %d\n", getuid());
printf(" => Propriétaire effectif : %d\n", geteuid());
printf(" => Répertoire de travail:%s\n",getcwd(tabRef,1000));
if ((nbLu = read(STDIN_FILENO,&c,1)) == -1)
perror(" read");
else
printf(" Valeur du read : %d\n", nbLu);
return EXIT_SUCCESS;
}