21 lines
424 B
C
Raw Permalink Normal View History

2020-05-02 00:01:44 +02:00
///********************/
///* 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;
}