From owner-freebsd-hackers Sun Oct 10 16:24:42 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from altair.mayn.de (altair.mayn.de [194.145.150.157]) by hub.freebsd.org (Postfix) with ESMTP id EF9EA15670 for ; Sun, 10 Oct 1999 16:23:36 -0700 (PDT) (envelope-from mkb@altair.mayn.de) Received: (from mkb@localhost) by altair.mayn.de (8.9.3/8.9.3) id BAA01011; Mon, 11 Oct 1999 01:17:51 +0200 (CEST) (envelope-from mkb) Date: Mon, 11 Oct 1999 01:17:50 +0200 From: Matthias Buelow To: Zhihui Zhang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to prevent a system call from restart? Message-ID: <19991011011750.A967@altair.mayn.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Zhihui Zhang wrote: >I modify the day time client program from the Stevens' book and run it on >both a Sun workstation and a FreeBSD machine. In the program, I use >signal() and alarm() to set a 5 seconds timeout. The program works as >expected on Sun (after I comment out the daytime line in the file >/etc/inetd.conf) but not on the FreeBSD machine. Steven's book (I assume ``Advanced Programming in the Unix Environment'') also tells you about the sigaction() system call. If you use sigaction without SA_RESTART, the signal will not restart slow system calls, causing them to flag EINTR. mkb To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message