From owner-freebsd-audit Wed Jun 5 1:24:52 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by hub.freebsd.org (Postfix) with ESMTP id 9308837B400; Wed, 5 Jun 2002 01:24:48 -0700 (PDT) Received: from fwd08.sul.t-online.de by mailout11.sul.t-online.com with smtp id 17FW61-0002Zb-07; Wed, 05 Jun 2002 10:24:45 +0200 Received: from Magelan.Leidinger.net (520065502893-0001@[80.131.127.20]) by fmrl08.sul.t-online.com with esmtp id 17FW5s-0xww52C; Wed, 5 Jun 2002 10:24:36 +0200 Received: from Leidinger.net (netchild@localhost [127.0.0.1]) by Magelan.Leidinger.net (8.12.3/8.12.3) with ESMTP id g558Q1PP000831; Wed, 5 Jun 2002 10:26:05 +0200 (CEST) (envelope-from netchild@Leidinger.net) Message-Id: <200206050826.g558Q1PP000831@Magelan.Leidinger.net> Date: Wed, 5 Jun 2002 10:26:01 +0200 (CEST) From: Alexander Leidinger Subject: Re: [PATCH] making dump EINTR resistant To: Todd.Miller@courtesan.com Cc: drosih@rpi.edu, bde@zeta.org.au, netchild@FreeBSD.ORG, audit@FreeBSD.ORG In-Reply-To: <200206050110.g551Alpu020379@xerxes.courtesan.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Sender: 520065502893-0001@t-dialin.net Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 4 Jun, Todd C. Miller wrote: >> Would it be acceptable to add EINTR-type checks to freebsd-ish >> code? There are some sections of lpr/lpd which do not work >> right when compiled on other platforms, unless I add EINTR >> checks at the right places. > > It would probably be better to just make the code in question to > just use sigaction() if you are concerned about portability. That > way you get consistent handling of syscall restarts. Acording to the APUE book signal(3) is supposed to restart interrupted system calls on 4.3(*)BSD but not on V7, SVR2, SVR3 and SVR4. sigaction with SA_RESTART is supposed to DTRT on 4.3+BSD and SVR4. Stevens lists ioctl, read, readv, write, writev, wait and waitpid as system calls which get automatically restarted. Our man pages also have EINTR for open (+ fopen) and close (+fclose). I've seen an EINTR related error once on a 4.x system, I think it was an EINTR from an open(2) call. Bye, Alexander. -- Failure is not an option. It comes bundled with your Microsoft product. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message