Page MenuHomeFreeBSD

send.2: document ENOTCONN for sendto w/SOCK_STREAM
ClosedPublic

Authored by knan-rfo_modirum.com on Apr 22 2020, 9:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 15, 12:02 PM
Unknown Object (File)
Tue, May 7, 1:49 PM
Unknown Object (File)
Thu, May 2, 9:36 AM
Unknown Object (File)
Tue, Apr 30, 4:44 PM
Unknown Object (File)
Sun, Apr 28, 9:38 PM
Unknown Object (File)
Mar 29 2024, 12:48 PM
Unknown Object (File)
Mar 11 2024, 7:21 PM
Unknown Object (File)
Mar 11 2024, 7:21 PM

Details

Summary

sendto on an unconnected sock_stream unix socket can return ENOTCONN, which is not documented in the man page until now. Change that.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
lib/libc/sys/send.2
79 ↗(On Diff #70872)

Sentences should start with a capital letter.

80 ↗(On Diff #70872)

Should be .Er ENOTCONN

82 ↗(On Diff #70872)

This sentence contradicts the previous one, which says that these functions can be used at any time.

208 ↗(On Diff #70872)

Usually we'd use the text from POSIX, in this case "The socket is connection-mode but is not connected."

The text about implied open should be moved up to the paragraph that you're modifying above.

knan-rfo_modirum.com marked 4 inline comments as done.

Updated according to review comments. ENOTCONN description aligned with POSIX. Self-contradiction rewritten.

lib/libc/sys/send.2
73 ↗(On Diff #71037)

Extra blank line.

86 ↗(On Diff #71037)

We should further qualify that if the socket is connected, the destination address passed by sendto() and sendmsg() is ignored.

Let's just add .Xr connect 2 to the "SEE ALSO" section below, trying to avoid parentheticals.

knan-rfo_modirum.com marked 2 inline comments as done.

Clarified that destination address is ignored if socket is already connected, and clarified where the destination address is sent in the sendmsg call. Formatting.

Thanks, this looks ok to me.

This revision is now accepted and ready to land.Apr 27 2020, 2:34 PM