1 /* Check that the syscalls implementing fdopen work trivially.
2 #output: This is the first line of this test.\npass\n
23 const char fname
[] = "sk1test.dat";
25 = "This is the first line of this test.\n";
26 char buf
[sizeof (tsttxt1
)] = "";
28 /* Write a line to stdout. */
31 || fwrite (tsttxt1
, 1, strlen (tsttxt1
), f
) != strlen (tsttxt1
))
32 perr ("fdopen or fwrite");
35 /* Unfortunately we can't get < /dev/null to the simulator with
36 reasonable test-framework surgery. */
38 /* Try to read from stdin. Expect EOF. */
41 || fread (buf
, 1, sizeof (buf
), f
) != 0