From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32310 invoked by alias); 2 Jul 2012 08:03:45 -0000 Received: (qmail 32219 invoked by uid 22791); 2 Jul 2012 08:03:18 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Mon, 02 Jul 2012 08:03:05 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 4AD332C0074; Mon, 2 Jul 2012 10:03:03 +0200 (CEST) Date: Mon, 02 Jul 2012 08:03:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Persistence of file implemented objects Message-ID: <20120702080303.GA17618@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <4FEF7DB6.6040101@gmail.com> <20120701003530.GA5390@ednor.casa.cgf.cx> <4FF0942B.1030201@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FF0942B.1030201@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-07/txt/msg00007.txt.bz2 On Jul 1 19:17, Richard H Lee wrote: > >Fifos persist on reboot on Linux or Cygwin. They live on the > >filesystem. I don't see how POSIX IPC shared memory and semaphores > >could persist. > > Sorry, I meant unix/bsd sockets. AF_UNIX/AF_LOCAL sockets are implemented on filesystem level as well, not only on Cygwin. If they are not explicitely unlinked, they will be in the way when trying to create a new socket of the same name. > Regarding the POSIX IPC's, they are stored in /dev . In regular > *nix, /dev do not represent "physical" files on the filesystem, > hence they do not persist over boot. > > In cygwin, they actually do represent physical files. So if they are > not freed correctly by the program, the persist over to the next > boot. Right. The named POSIX IPC objects are created as normal files under /dev/shm and /dev/mqueue. These objects are supposed to follow POSIX file name naming rules, and they are supposed to be persistent until you call mq_unlink, sem_unlink, or shm_unlink respectively. They are also meant to persist if a process crashes(*). So in contrast to XSI IPC implemented by running cygserver they also persist when all Cygwin processes have stopped and even over reboot, because they don't live on a virtual filesystem like on Linux, but on the real filesystem. >From the POSIX point of view that's ok. If you have a problems with that, you might consider to create some autostart script which deletes all files below /dev/shm and /dev/mqueue. Corinna (*) See http://pubs.opengroup.org/onlinepubs/007908799/xsh/mq_open.html http://pubs.opengroup.org/onlinepubs/007908799/xsh/sem_open.html http://pubs.opengroup.org/onlinepubs/007908799/xsh/shm_open.html -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple