Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT sources DOT redhat DOT com> List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <01C0FDB8.43518680.dfreyer@telecom.insa-lyon.fr> From: Dirk Freyer <dfreyer AT telecom DOT insa-lyon DOT fr> To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com> Subject: mmap not share Date: Mon, 25 Jun 2001 20:48:59 +0200 X-Mailer: Microsoft Internet E-Mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Under Linux this file works fine. Two tasks increments one counter :-) With Windows 98 i have the problem that the two tasks increments two counters :-( Why ??? I use cygwin 1.8.2 int fd; void *ptr=NULL; int *counter; if ( (fd=open("tmem.sm",O_RDWR)) == -1) printf("File Error\n"); else if((ptr = mmap (NULL,sizeof(int), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) printf("mmap Error\n"); close(fd); printf("File=%i Ptr=%i\n",fd,ptr); counter=ptr; while (TRUE) { printf("counter=%i\n",(*counter)++); ... } -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple