From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30902 invoked by alias); 25 Jun 2003 13:49:46 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 16757 invoked from network); 25 Jun 2003 13:09:59 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by sources.redhat.com with SMTP; 25 Jun 2003 13:09:58 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19VA1s-0007Ah-00 for ; Wed, 25 Jun 2003 15:09:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin@cygwin.com Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19VA1r-0007AT-00 for ; Wed, 25 Jun 2003 15:09:39 +0200 From: "Alex Vinokur" Subject: assertion "ptr != MAP_FAILED" failed while using mmap Date: Wed, 25 Jun 2003 15:17:00 -0000 Message-ID: X-Complaints-To: usenet@main.gmane.org X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-SW-Source: 2003-06/txt/msg01164.txt.bz2 =========================================== Windows 2000 CYGWIN_NT-5.0 1.3.22(0.78/3/2) GNU gcc version 3.2 20020927 (prerelease) =========================================== Here is some function. -------------------------------------- void read_file (char* filename_i) { int fd = open(filename_i, O_RDONLY); assert (fd > 2); off_t sz = lseek(fd, 0, SEEK_END); char* ptr = (char*)mmap(0, sz, PROT_READ, 0, fd, 0); assert (ptr != MAP_FAILED); // Here assertion failed if (ptr != MAP_FAILED) { string str(ptr, ptr+sz); munmap(ptr, sz); } close(fd); } -------------------------------------- Assertion "ptr != MAP_FAILED)" failed. What might cause that? Thanks, -- ========================================== Alex Vinokur mailto:alexvn@connect.to http://www.simtel.net/pub/oth/19088.html http://sourceforge.net/users/alexvn ========================================== -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/