Please document the sendto syscall can return an EPROTOTYPE

Originator:erick.tryzelaar
Number:rdar://19012087 Date Originated:2014-11-17
Status:Open Resolved:
Product:Documentation Product Version:10.10
Classification: Reproducible:N/A
 
Erick Tryzelaar17-Nov-2014 10:21 PM


Summary:
Looking at the latest Yosemite XNU kernel, it references in a couple places that the syscall `sendto` can return an EPROTOTYPE:

https://github.com/opensource-apple/xnu/blob/bb7368935f659ada117c0889612e379c97eb83b3/bsd/kern/uipc_usrreq.c#L408

https://github.com/opensource-apple/xnu/blob/bb7368935f659ada117c0889612e379c97eb83b3/bsd/netinet/tcp_usrreq.c#L914-L948

It would be greatly appreciated if the documentation and man pages for `write`, `sendto`, and etc were updated to explain the reasons why this error may be returned.

Steps to Reproduce:
1. Install XCode with the command line tools
2. run ./driver.sh

Expected Results:
It should run without error, never reporting "error send: Protocol wrong type for socket".

Actual Results:
After a non-deterministic amount of runs, it will error out with the EPROTOTYPE "error send: Protocol wrong type for socket".

Version:
OS X Man Page: write
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/write.2.html

OS X Man Page: sendto
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/sendto.2.html

Notes:


Configuration:
OS X Yosemite on a Macbook Pro.

Attachments:
'test-eprototype.c' and 'driver.sh' were successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!