"debut TD0"
This commit is contained in:
20
2019-2020/S3T_TP_04_PROCESSUS-3-SGF-2/Demonstrations/demo_dup2.c
Executable file
20
2019-2020/S3T_TP_04_PROCESSUS-3-SGF-2/Demonstrations/demo_dup2.c
Executable file
@@ -0,0 +1,20 @@
|
||||
///********************/
|
||||
///* demo_dup2 : ... */
|
||||
///********************/
|
||||
# include <stdio.h>
|
||||
# include <fcntl.h>
|
||||
# include <unistd.h>
|
||||
|
||||
# define ENTREE_STANDARD 0
|
||||
int main()
|
||||
{ int descr_group;
|
||||
char c;
|
||||
descr_group = open ("/etc/passwd", O_RDONLY);
|
||||
dup2 (descr_group, ENTREE_STANDARD);/// retour a tester ...
|
||||
c = getchar();
|
||||
while (c != EOF)
|
||||
{
|
||||
putchar(c); c = getchar();
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user