This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
mmap not share
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Subject: mmap not share
- From: Dirk Freyer <dfreyer at telecom dot insa-lyon dot fr>
- Date: Mon, 25 Jun 2001 20:48:59 +0200
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