1 /* Test for fdopen bugs. */
10 fputs ("test failed: " #x "\n", stderr); \
18 main (int argc
, char *argv
[])
26 fp
= fopen (name
, "w");
28 fputs ("foobar and baz", fp
);
32 fd
= open (name
, O_RDONLY
);
34 assert (lseek (fd
, 5, SEEK_SET
) == 5);
35 /* The file position indicator associated with the new stream is set to
36 the position indicated by the file offset associated with the file
38 fp
= fdopen (fd
, "r");
40 assert (getc (fp
) == 'r');
41 assert (getc (fp
) == ' ');