From owner-freebsd-arch Mon Feb 5 15:49: 0 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 07F8537B6A2 for ; Mon, 5 Feb 2001 15:48:44 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f15NmhR16126; Mon, 5 Feb 2001 15:48:43 -0800 (PST) Date: Mon, 5 Feb 2001 15:48:43 -0800 From: Alfred Perlstein To: Jonathan Graehl Cc: freebsd-arch@FreeBSD.ORG Subject: Re: nonblocking sockets and EINTR Message-ID: <20010205154842.J26076@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 jonathan@graehl.org on Mon, Feb 05, 2001 at 03:46:20PM -0800 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Jonathan Graehl [010205 15:46] wrote: > If a TCP or UDP socket is set nonblocking, do I ever have to worry about getting > my system calls for those sockets interrupted? It is my understanding that you > should only have to check for EINTR for "slow" system calls (that can take an > indefinite amount of time), which should mean I'm home free, since the operation > either completes immediately, or I get EWOULDBLOCK. > > For now, since I am not sure I can count on this behavior, I block all nonfatal > signals. I would like to be able to use signals to communicate to my daemon > (with the caveat that I may get an EINTR for my kevent call, but not for any of > my socket operations). > > Is there any standard behavior I can count on for nonblocking sockets w.r.t. > EINTR? You can specify that syscalls will or won't be automatically restarted via the sigaction() API. -- -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-arch" in the body of the message