LWN.net Logo

Five Pitfalls of Linux Sockets Programming (developerWorks)

Five Pitfalls of Linux Sockets Programming (developerWorks)

Posted Sep 21, 2005 15:29 UTC (Wed) by hppnq (guest, #14462)
In reply to: Five Pitfalls of Linux Sockets Programming (developerWorks) by RobSeace
Parent article: Five Pitfalls of Linux Sockets Programming (developerWorks)

EFAULT seems appropriate, yes; SIGSEGV would be disappointing.

Though, looking up a few send(2) manpages I cannot really conclude that NULL would be an invalid address (I consulted a Solaris manpage before my first comment * bangs head on table * and apparently Solaris doesn't care about EFAULT at all ;-).

But it's trivial to find out of course what Linux does in this case, I'll let you know unless you beat me to it. ;-)


(Log in to post comments)

Five Pitfalls of Linux Sockets Programming (developerWorks)

Posted Sep 21, 2005 16:24 UTC (Wed) by RobSeace (subscriber, #4435) [Link]

It does indeed fail with EFAULT on both Linux (2.4.x, at least) and QNX4.2x
(the only other system I have access to, at the moment)... On any system
where it didn't fail so, I'd expect the seg-fault... It's the only other
rational choice...

Five Pitfalls of Linux Sockets Programming (developerWorks)

Posted Sep 21, 2005 17:12 UTC (Wed) by hppnq (guest, #14462) [Link]

Alright, common sense rules. ;-) Cheers Rob!

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds