Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3AD7732C.F448C20A@cfa.harvard.edu> Date: Fri, 13 Apr 2001 17:44:12 -0400 From: William Joye X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT cygwin DOT com CC: wjoye AT cfa DOT harvard DOT edu Subject: cygwin 1.1.8 mmap()/fork() bug still not fixed Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cygwin 1.1.8 mmap()/fork() bug is still not fixed. Works fine under cygwin 1.1.7. The following C++ code breaks under cygwin 1.1.8-2 and all current development snapshots... #include #include #include #include #include #include main(int argc, char **argv) { if( argc < 2 ) { cerr << "Usage: bug filename" << endl; exit(1); } int file = open(argv[1], O_RDONLY); if (file == -1) { cerr << "can't open data file " << argv[1] << endl; exit(-1); } struct stat statbuf; if (fstat(file, &statbuf) < 0) { cerr << "fstat failed" << endl; exit(-1); } int len = statbuf.st_size; if (!len) { cerr << "len is 0" << endl; exit(-1); } char *buf = mmap(NULL, len, PROT_READ, MAP_SHARED, file, 0); if (!buf) { cerr << "mmap() failed" << endl; exit(-1); } close(file); fork(); cerr << dec << len << ' ' << hex << (short*)buf << endl; munmap(buf, len); cerr << "OK" << endl; exit(0); } -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple