changes in 2001-01-27 snapshot -- test suite question

Trevor Forbes trevorforbes@ozemail.com.au
Sun Jan 28 19:46:00 GMT 2001


I have reduced the /dev/zero test case (devzero.c) down to the area of
interest.  Not being an expert, but mmap seems to be returning an address
which is out of bounds.

I am still having problems debugging the cygwin1.dll so this is as far as I
can go at the moment.

I hope this is of some use.

Regards Trevor


------------------------devzero.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>

main()
{
  int fd, r, w, l;
  char buf[1024];
  char *v;

  fd = open("/dev/zero", O_RDWR);
  v = (char *)mmap(0, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
  if (v == (char *)-1)
    {
      fprintf(stderr, "mmap r/w /dev/zero failed\n");
      perror("The error was");
      exit(1);
    }

  for (r=0; r<65536; r++)
    if (v[r] != 0)
      {
 fprintf(stderr, "mmap'd r/w /dev/zero has byte %d at offset %d\n",
  v[r], r);
 exit(1);
      }
  munmap(v, 65536);
  close(fd);

  exit(0);
}




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list