mirror of git://sourceware.org/git/glibc.git
22 lines
362 B
C
22 lines
362 B
C
|
|
#include <stdio.h>
|
||
|
|
|
||
|
|
main()
|
||
|
|
{
|
||
|
|
char * filename = "xbug.c";
|
||
|
|
FILE *input;
|
||
|
|
int i;
|
||
|
|
char buf[256];
|
||
|
|
|
||
|
|
|
||
|
|
if (!freopen (filename, "r", stdin))
|
||
|
|
fprintf(stderr, "cannot open file\n");
|
||
|
|
|
||
|
|
if (!(input = popen("/bin/cat", "r")))
|
||
|
|
fprintf(stderr, "cannot run \n");
|
||
|
|
|
||
|
|
|
||
|
|
while(gets(buf) != NULL) {
|
||
|
|
fprintf(stdout, "read: %s\n", buf);
|
||
|
|
}
|
||
|
|
}
|