Re: msync bug or RTFM ??

From: Chris Wedgwood (cw@f00f.org)
Date: Sat Jul 22 2000 - 20:46:59 EST


            fd = open ("scribble.dat", O_RDWR | O_CREAT | O_TRUNC,
                       S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH );
            if (fd < 0) {
                    perror ("Couldn't open output file");
                    exit (-1);
            }

            ptr = start = mmap (0, flen, PROT_WRITE, MAP_PRIVATE, fd, 0);
            if ((long)ptr == -1) {
                    perror ("couldn't mmap output file");
                    exit (-1);
            }

you're mmap'ing a zero length file, use ftruncate or something before
you map it.

  --cw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:19 EST