delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/01/06:48: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
X-T2-Posting-ID: dCnToGxhL58ot4EWY8b+QGwMembwLoz1X2yB7MdtIiA=
Date: Tue, 1 Nov 2005 12:48:03 +0100
From: Samuel Thibault <samuel DOT thibault AT ens-lyon DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: signals and read blocking - EINTR
Message-ID: <20051101114803.GA9525@bouh.residence.ens-lyon.fr>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <S576857AbVKAJkB/20051101094004Z+331 AT sunkay DOT cs DOT ualberta DOT ca>
Mime-Version: 1.0
In-Reply-To: <S576857AbVKAJkB/20051101094004Z+331@sunkay.cs.ualberta.ca>
User-Agent: Mutt/1.5.9i-nntp
X-IsSubscribed: yes

Hi,

Jim Easton, le Tue 01 Nov 2005 02:40:00 -0700, a écrit :
> Hi,
> 
> Christopher Faylor wrote:
> > On Mon, Oct 31, 2005 at 08:49:30PM -0700, Jim Easton wrote:
> > >I'm wondering what am I missing?  Is there a flag in sigaction
> > >or something else that I could be setting?
> > 
> > Yes.  SA_RESTART is the flag.
> 
> and then Samuel Thibault wrote:
> > No: he wants to be _interrupted_. SA_RESTART is used for _not_ being
> > interrupted, i.e. the system restarts the system call itself.
> 
> Thank you both for your help.  It's quite true that I do want to be
> interrupted and SA_RESTART is to prevent it.
> 
> However it never occurred to me on linux and cygwin the flag would
> be defaulted set.  Things started to work much better when I
> deliberately unset the flag.

Mmm, I had a look at posix, at it says "The state of these flags is
not specified for signal()." So that you indeed need to explicitely
unset the flag, else the behavior is implementation-dependant (BSD sets
SA_RESTART and clears SA_RESETHAND for instance).

Alternatively, siginterrupt() might be useful, but sigaction is
preferred.

Regards,
Samuel

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