1 /* Check that the syscalls implementing fdopen work trivially. */
21 const char fname
[] = "sk1test.dat";
23 = "This is the first and only line of this file.\n";
24 char buf
[sizeof (tsttxt1
)] = "";
26 fd
= open (fname
, O_WRONLY
|O_TRUNC
|O_CREAT
, S_IRWXU
);
32 || fwrite (tsttxt1
, 1, strlen (tsttxt1
), f
) != strlen (tsttxt1
))
33 perr ("fdopen or fwrite");
38 fd
= open (fname
, O_RDONLY
);
44 || fread (buf
, 1, sizeof (buf
), f
) != strlen (tsttxt1
)
45 || strcmp (buf
, tsttxt1
) != 0