1 /* Check for a sim bug, whereby an invalid seek (to a negative offset)
2 did not return an error. */
16 const char fname
[] = "sk1test.dat";
18 = "A random line of text, used to test correct read, write and seek.\n";
19 char buf
[sizeof tsttxt
] = "";
22 f
= fopen (fname
, "wb");
24 || fwrite (tsttxt
, 1, strlen (tsttxt
), f
) != strlen (tsttxt
)
31 fd
= open (fname
, O_RDONLY
);
33 || lseek (fd
, -1L, SEEK_CUR
) != -1
35 || read (fd
, buf
, strlen (tsttxt
)) != strlen (tsttxt
)
36 || strcmp (buf
, tsttxt
) != 0)