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)
Fri, Nov 1, 1:49 PM
Unknown Object (File)
Oct 1 2024, 9:42 AM
Unknown Object (File)
Oct 1 2024, 9:32 AM
Unknown Object (File)
Oct 1 2024, 9:30 AM
Unknown Object (File)
Sep 24 2024, 4:08 AM
Unknown Object (File)
Sep 18 2024, 4:49 PM
Unknown Object (File)
Sep 2 2024, 3:19 PM
Unknown Object (File)
Aug 31 2024, 6:00 AM

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