Five Pitfalls of Linux Sockets Programming (developerWorks)
Posted Sep 21, 2005 15:09 UTC (Wed) by
RobSeace (subscriber, #4435)
In reply to:
Five Pitfalls of Linux Sockets Programming (developerWorks) by hppnq
Parent article:
Five Pitfalls of Linux Sockets Programming (developerWorks)
That example I would expect to return -1 with an errno of EFAULT, since
the NULL pointer is invalid... Alternatively, it might simply crash the
app with SIGSEGV... But, I certainly would never expect it to return 0...
Really, there is no other notion of "actual length of the data" than the
length you pass in to send()/write()... It has no other way of knowing
any other length than what you tell it... (Short of running off the end of
your valid address space, causing either EFAULT or SIGSEGV...)
(
Log in to post comments)