Messages in this thread | | | Date | Sun, 23 Jul 2000 13:46:59 +1200 | From | Chris Wedgwood <> | Subject | Re: msync bug or RTFM ?? |
| |
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/
| |