Date: 31 Jul 1999 08:24:50 -0000 From: Ville-Pertti Keinonen <will@iki.fi> To: dillon@apollo.backplane.com Cc: wes@softweyr.com, hackers@FreeBSD.ORG Subject: Re: Documenting writev(2) ENOBUFS error Message-ID: <19990731082450.7417.qmail@ns.oeno.com> In-Reply-To: <199907301634.JAA91238@apollo.backplane.com> (message from Matthew Dillon on Fri, 30 Jul 1999 09:34:46 -0700 (PDT))
next in thread | previous in thread | raw e-mail | index | archive | help
> :wes@softweyr.com (Wes Peters) writes: > : > :> [ENOBUFS] Insufficient system buffer space exists to complete the op- > :> eration. > : > :Do you know what kind of circumstances that error *really* occurs > :under? > : > :If it happened with files, that would be a bug and should be fixed. > :The call is supposed to block to wait for writes to be possible. This > > I am almost certain that this error can only occur when writing to > sockets, and only then of the network mbuf pool is completely exhausted. > UDP is probably the most vulernable. It looks to me like it can't happen to stream sockets using write/writev. As far as I can tell, the ENOBUFS error can occur internally for sends if: - There is a shortage of mbufs at a low level (at higher levels, code either blocks or panics) - A network interface has a lot of packets queued (this is done at an IP level) - The socket buffer of a local datagram socket is full (the receiving socket, not the one the send occurred on) The TCP layer doesn't let ENOBUFS from low-level calls get through, but returns success. A TCP socket is prepared to resend the data at a higher level, anyhow, so the data is not lost and an error doesn't need to be returned. OOB data or implicit connections can return ENOBUFS for TCP sends, but they are activated by parameters only available through the send/sendto API. So you can get ENOBUFS not related to mbufs for UDP/local datagram sockets, but you should never get ENOBUFS from write for TCP sockets or local stream sockets. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990731082450.7417.qmail>