tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sleeping instead of ENOBUFS on write to socket?



> I'm not sure what happens for blocking datagram sockets.

The historical practice is that they're "best effort": writing never
blocks.  Some conditions responsible for packet drop are reflected in
the write()/send()/etc return value; others aren't - though I think for
AF_LOCAL they're all the former.  Blocking on SOCK_DGRAM matters only
when trying to read when there's nothing there.

Is that how it _should_ be?  That's debatable.  But if you make
SOCK_DGRAM writes block without some kind of explicit request (like a
setsockopt), you will break a fair bit of code.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index