7 "Amazing Electronic Fact: If you scuffed your feet long enough without\n"
8 "touching anything, you would build up so many electrons that your\n"
9 "finger would explode! But this is nothing to worry about unless you\n"
16 mk_boundary_string (const char *src)
18 static char dst[8192];
19 char *p = dst + (4096 - (uintptr_t) dst % 4096 - strlen (src) / 2);
20 strlcpy (p, src, 4096);
31 actual_p = mk_boundary_string (expected);
33 printf ("(read-boundary) begin\n");
35 handle = open ("sample.txt");
37 printf ("(read-boundary) fail: open() returned %d\n", handle);
39 byte_cnt = read (handle, actual_p, sizeof expected - 1);
40 if (byte_cnt != sizeof expected - 1)
41 printf ("(read-boundary) fail: read() returned %d instead of %d\n",
42 byte_cnt, sizeof expected - 1);
43 else if (strcmp (expected, actual_p))
44 printf ("(read-boundary) fail: expected text differs from actual:\n%s",
47 printf ("(read-boundary) end\n");