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 sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Date: Wed, 26 Jan 2000 14:28:19 +0300 From: Pakoulin Konstantin X-Mailer: The Bat! (v1.36) S/N F29DEE5D / Educational Reply-To: Pakoulin Konstantin Organization: dgap X-Priority: 3 (Normal) Message-ID: <16603.000126@mail.ru> To: cygwin AT sourceware DOT cygnus DOT com Subject: problem with shared memory under Win9x Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I use shared memory for IPC in my programm, but it doesnt work under Win9x. I writed test programm that works well under WinNT but doesnt work under Win9x: #include #include #include #include #include #define FILENAME "test.bin" #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) int main() { if ( fork()!=0 ) { // Parent - server int fd; int* mem; int z = 0; fd = open( FILENAME , O_RDWR | O_CREAT , FILE_MODE ); write( fd, &z, sizeof(int) ); mem = mmap( NULL, sizeof(int) , PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); close(fd); printf("par: Waiting!!\n"); while(!(*mem)) ; // 'mem' equal 0 constantly under Win9x printf("par: !!!Works Well!!! - %d \n", *mem); exit(0); } else { // Child - client int fd; int* mem; sleep(3); fd = open( FILENAME , O_RDWR | O_CREAT , FILE_MODE ); mem = mmap( NULL, sizeof(int) , PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); close(fd); printf("ch: MEM = 3 !!\n"); *mem = 3; exit(0); }; } Do you have any idea ? -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com