On Fri, Sep 27, 2013 at 06:56:04PM +0200, Alexander Bluhm wrote: > On Fri, Sep 27, 2013 at 12:00:40PM -0400, Kenneth R Westerback wrote: > > I'm not sure what the 'rule' is regarding ENOMEM and ENOBUFS, but > > ENOMEN seems more appropriate to me. > > man 2 errno > > 12 ENOMEM Cannot allocate memory. The new process image required more > memory than was allowed by the hardware or by system-imposed > memory management constraints. A lack of swap space is normally > temporary; however, a lack of core is not. Soft limits may be > increased to their corresponding hard limits. > > 55 ENOBUFS No buffer space available. An operation on a socket or pipe > was not performed because the system lacked sufficient buffer > space or because a queue was full. > > According to this, ENOMEM looks very much like memory allocation > failure for the user space. In my case we ran out of network device > memory, so I think ENOBUFS is more appropriate. > > The kernel code is not very consistent there. Developers are tempted > to use ENOMEM when malloc(9) fails, but the man page says something > different. > > bluhm
<bikeshed> But how does the failure to allocate a softc relate to a socket or pipe because the system lacked sufficient buffer space? I read 'buffer space' as related to mbufs. Of which I don't think softc's are composed. </bikeshed> .... Ken