From owner-freebsd-hackers Tue Dec 19 9:45: 9 2000 From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 19 09:45:08 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id D347D37B402 for ; Tue, 19 Dec 2000 09:45:07 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eBJHj5b15225; Tue, 19 Dec 2000 09:45:05 -0800 (PST) Date: Tue, 19 Dec 2000 09:45:05 -0800 From: Alfred Perlstein To: Dmitry Dicky Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: recvfrom() and signals Message-ID: <20001219094505.P19572@fw.wintelcom.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from diwil@dataart.com on Tue, Dec 19, 2000 at 08:01:10PM +0300 Sender: bright@fw.wintelcom.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Dmitry Dicky [001219 09:01] wrote: > > I use non blocking socket and it receives data with no problems. > When alarm occures, the signal delivered to the process and alarm handler > prints a signal number. As I understand after this recvfrom should > return -1 and errno should be set to EINTR. > > BUt, upon signal delivery (actually any signal, CHLD for example) > recvfrom() still hangs the program execution and awaits data. > > However, man pages say that recvfrom() will return -1 if the call has been > interrupted. > > Is this a system bug or just my misunderstanding? See the sigaction manpage and how one enable/disables system call restarts. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message