mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-31 23:11:09 +00:00
[BZ #959]
2005-06-01 Roland McGrath <roland@redhat.com> [BZ #959] * posix/tst-mmap.c (main): Fill the test file with enough data for the page size.
This commit is contained in:
parent
6b4b971373
commit
654fdda1e4
@ -30,7 +30,7 @@ main (void)
|
|||||||
for (c = 0; c < sizeof (buf); ++c)
|
for (c = 0; c < sizeof (buf); ++c)
|
||||||
buf[c] = '0' + (c % 10);
|
buf[c] = '0' + (c % 10);
|
||||||
|
|
||||||
for (c = 0; c < 20; ++c)
|
for (c = 0; c < (ps * 4) / sizeof (buf); ++c)
|
||||||
if (fwrite (buf, 1, sizeof (buf), fp) != sizeof (buf))
|
if (fwrite (buf, 1, sizeof (buf), fp) != sizeof (buf))
|
||||||
{
|
{
|
||||||
printf ("`fwrite' failed: %m\n");
|
printf ("`fwrite' failed: %m\n");
|
||||||
@ -40,7 +40,7 @@ main (void)
|
|||||||
assert (ps + 1000 < c * sizeof (buf));
|
assert (ps + 1000 < c * sizeof (buf));
|
||||||
|
|
||||||
/* First try something which is not allowed: map at an offset which is
|
/* First try something which is not allowed: map at an offset which is
|
||||||
not module the pagesize. */
|
not modulo the pagesize. */
|
||||||
ptr = mmap (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1);
|
ptr = mmap (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1);
|
||||||
if (ptr != MAP_FAILED)
|
if (ptr != MAP_FAILED)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user