Skip to content

Commit

Permalink
[BZ #959]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Roland McGrath committed Jun 3, 2005
1 parent 6b4b971 commit 654fdda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions posix/tst-mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main (void)
for (c = 0; c < sizeof (buf); ++c)
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))
{
printf ("`fwrite' failed: %m\n");
Expand All @@ -40,7 +40,7 @@ main (void)
assert (ps + 1000 < c * sizeof (buf));

/* 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);
if (ptr != MAP_FAILED)
{
Expand Down

0 comments on commit 654fdda

Please sign in to comment.