6 char actual[sizeof sample];
12 printf ("(read-normal) begin\n");
14 handle = open ("sample.txt");
16 printf ("(read-normal) fail: open() returned %d\n", handle);
18 byte_cnt = read (handle, actual, sizeof actual - 1);
19 if (byte_cnt != sizeof actual - 1)
20 printf ("(read-normal) fail: read() returned %d instead of %d\n",
21 byte_cnt, sizeof actual - 1);
22 else if (strcmp (sample, actual))
23 printf ("(read-normal) fail: expected text differs from actual:\n%s",
26 printf ("(read-normal) end\n");