From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 9 16:34:28 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7543916A4CE for ; Mon, 9 Feb 2004 16:34:28 -0800 (PST) Received: from starbug.ugh.net.au (starbug.ugh.net.au [203.31.238.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D03E43D1D for ; Mon, 9 Feb 2004 16:34:28 -0800 (PST) (envelope-from andrew@ugh.net.au) Received: from localhost (localhost [127.0.0.1]) by starbug.ugh.net.au (Postfix) with ESMTP id 51D18A809 for ; Tue, 10 Feb 2004 11:34:26 +1100 (EST) Date: Tue, 10 Feb 2004 11:34:26 +1100 (EST) From: Andrew To: freebsd-hackers@freebsd.org In-Reply-To: <20040210100257.G56192-100000@starbug.ugh.net.au> Message-ID: <20040210111013.G56192-100000@starbug.ugh.net.au> X-WonK: *wibble* MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailman-Approved-At: Tue, 10 Feb 2004 05:30:04 -0800 Subject: Re: select, sendto and ENOBUFS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 00:34:28 -0000 On Tue, 10 Feb 2004, Andrew wrote: > I have a problem with sendto returning an error and setting errno to > ENOBUFS however I am calling select first to make sure the fd is > writeable (see below for code). s is a raw socket and the data I'm I see something similar has actually been discussed before and I just missed it. http://docs.freebsd.org/cgi/mid.cgi?E1Aice9-0002by-00 The conclusion being that send, sendto and select will never block on a UDP socket and the man page just doesn't make it too clear. I'm assuming it is the same for raw sockets. UNPv1 section 6.3 seems to say that select should work for UDP...Part 2 under "Under What Conditions Is a Descriptor Ready" certainly indicates that select should work. Anyway a bug or not, is there a better work around than sleeping? I'm guessing not... Thanks, Andrew