delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/10/24/06:21:55

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 24 Oct 2011 12:21:03 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.9: spawn brakes reopening of serial port
Message-ID: <20111024102103.GB14623@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <0C11C5BF0B29FD43A8D0250F711D497F89DEDBFEE2 AT ex01-ubitronix DOT ubitronix DOT local> <20111021105003 DOT GB2979 AT calimero DOT vinschen DOT de> <0C11C5BF0B29FD43A8D0250F711D497F89DEDBFF17 AT ex01-ubitronix DOT ubitronix DOT local>
MIME-Version: 1.0
In-Reply-To: <0C11C5BF0B29FD43A8D0250F711D497F89DEDBFF17@ex01-ubitronix.ubitronix.local>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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


Please, don't http://cygwin.com/acronyms/#TOFU


On Oct 24 12:02, Manuel Wienand wrote:
> Hallo Corinna,
> 
> thanks for the response. Yes, you are right, I missed the fact that
> the child process inherits the file descriptors.
> 
> I took a look at the documentation of exec and just to be clear on the
> descriptor/handler issue:
> - file descriptor are passed down (basically always when calling the
> 'open' function)
> - socket descriptors are *not* passed down (not sure, wasn't in the
> documentation)

All descriptors are passed down, unless the close-on-exec flag has been
set explicitely.

> - handles of semaphores, mutexes, memory maps, message queues are
> *not* passed down.

Uh, "handles" sounds so much like a Windows concept...
As for POSIX IPC objects, they are not inherited by exec'ed processes
and have to be reopened.

> - signal mask, scheduling policies (at leat when using SCHED_FIFO,
> SCHED_RR or SCHED_SPORADIC) and directory streams are passed down
> Is that correct?

Not quite.  For a good overview of what happens in execve, see
http://www.kernel.org/doc/man-pages/online/pages/man2/execve.2.html


Corinna

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

- Raw text -


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