🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3264

Re: select failed: Interrupted system call

#3264
From: Guenther Kramer
Date: Thu, 24 Mar 1994 22:43
35 lines
2715 bytes
In article <2msp8u$lct@bmerha64.bnr.ca>,
Hamish Macdonald <Hamish.Macdonald@bnr.ca> wrote:
>>>>>> On 24 Mar 1994 12:01:56 EST,
>>>>>> In message <1994Mar24.170156.15928@bcarh54a.bnr.ca>,
>>>>>> kramer@bnr.ca (Guenther Kramer) wrote:
>
>Guenther> All of this stuff would be so much simpler if HP-UX
>Guenther> supported the SA_RESTART flag to sigaction().  Oh well.
>
>Check out sigvector(2).

I have.  'sigaction()' provides all the functionallity of 'sigvector()'
with the added bonus of being POSIX compliant.  The main difference that I
can see is that 'sigaction()' behaves as though 'SV_BSDSIG' is always set 
and has a flag 'SA_NOCLDSTOP' to disable it.  (POSIX made it portable by
removing the "BSD" sub-string from the name. :-)

The problem is that under HP-UX, there is no way to tell the signal system 
to AUTOMATICALLY re-start all system calls for a given signal.  The SA_RESTART 
flag to sigaction() can be used on some systems to define this behaviour.
(Most notably SYSV4 and BSD4.3)  This is a bit supprising to me since HP 
decided to support 3 or 4 different signal interfaces but did not support
this very common flag.

I could use sigaction() and install handlers for the signals I cared
about and mess around with restarting the system calls by checking the
'sc_syscall' and 'sc_syscall_action' fields, but this is a mess and not
very portable.  On top of that, the sigvector() man page warns that 
re-starting 'select()' could be un-reliable.  Since the original poster was
concerned about select(), I felt the EINTR approach would be the best.

--
Guenther Kramer, 4C31             IDE core development
Internet: kramer@bnr.ca           Bell-Northern Research, Ottawa, Canada.
#include <std.disclaimer.h>
Technical Details
Message-ID: <1994Mar24.224322.4302@bcarh54a.bnr.ca>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!pipex!bnr.co.uk!bnrgate!bmers95!bmerha64.bnr.ca!CompStar!bcars267!bcarh54a!kramer
References: <1994Mar24.142710.11199@bcarh54a.bnr.ca> <1994Mar24.170156.15928@bcarh54a.bnr.ca> <2msp8u$lct@bmerha64.bnr.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc89c,6ef1c459f8d64db7
X-Google-Attributes: gidfc89c,public
X-Google-Thread: fcda7,6ef1c459f8d64db7
X-Google-Attributes: gidfcda7,public
X-Google-Thread: 14b500,6ef1c459f8d64db7
X-Google-Attributes: gid14b500,public
X-Google-ArrivalTime: 1994-03-24 14:43:22 PST
Newsgroups: comp.unix.programmer,comp.sys.hp.hpux,bnr.unix
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!pipex!bnr.co.uk!bnrgate!bmers95!bmerha64.bnr.ca!CompStar!bcars267!bcarh54a!kramer
From: kramer@bnr.ca (Guenther Kramer)
Subject: Re: select failed: Interrupted system call
Sender: news@bcarh54a.bnr.ca (ZOONEWS News)
Message-ID: <1994Mar24.224322.4302@bcarh54a.bnr.ca>
Date: Thu, 24 Mar 1994 22:43:22 GMT
References: <1994Mar24.142710.11199@bcarh54a.bnr.ca> <1994Mar24.170156.15928@bcarh54a.bnr.ca> <2msp8u$lct@bmerha64.bnr.ca>
Nntp-Posting-Host: bcarh70d
Organization: Bell-Northern Research Ltd.
Lines: 35