delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/03/15:53:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 3 Jun 2004 21:53:09 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: BUG: More shmget() problems
Message-ID: <20040603195309.GL7002@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <380-2200464318591812 AT hedden DOT us>
Mime-Version: 1.0
In-Reply-To: <380-2200464318591812@hedden.us>
User-Agent: Mutt/1.4.2i

On Jun  3 14:59, Jerry D. Hedden wrote:
> The following test program:
> 
> #include <sys/shm.h>
> #include <errno.h>
> 
> int
> main(int argc, char **argv)
> {
>     int pid = fork();
>     int id;
> 
>     if (pid == 0) {
>         sleep(5);
>         id = shmget(1, 100, IPC_CREAT | 0666);
>         printf("child (%d): %d (%d)\n", getpid(), id, errno);
>     } else {
>         id = shmget(1, 100, IPC_CREAT | 0666);
>         printf("parent (%d): %d (%d)\n", getpid(), id, errno);
>         sleep(10);
>         shmctl(id, IPC_RMID, 0);
>     }
> 
>     return (0);
> }
> 
> Produces:
> 
> parent (6592): 720896 (0)
> child (28268): 1638401 (0)
> 
> Showing that the child process created its own segment instead of
> begin given the parent's segment.  This is a bug.

Definitely.  I applied a fix in CVS.

Thanks for the testcases!  They were most helpful.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019