8 mk_boundary_string (const char *src)
10 static char dst[8192];
11 char *p = dst + (4096 - (uintptr_t) dst % 4096 - strlen (src) / 2);
12 strlcpy (p, src, 4096);
23 actual_p = mk_boundary_string (sample);
25 printf ("(read-boundary) begin\n");
27 handle = open ("sample.txt");
29 printf ("(read-boundary) fail: open() returned %d\n", handle);
31 byte_cnt = read (handle, actual_p, sizeof sample - 1);
32 if (byte_cnt != sizeof sample - 1)
33 printf ("(read-boundary) fail: read() returned %d instead of %zu\n",
34 byte_cnt, sizeof sample - 1);
35 else if (strcmp (sample, actual_p))
36 printf ("(read-boundary) fail: expected text differs from actual:\n%s",
39 printf ("(read-boundary) end\n");