Bug 227185

Summary: write(2) blocksize behaviour on raw devices should be added to manpage
Product: Documentation Reporter: Thomas Zander <riggs>
Component: Manual PagesAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: doc
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Example code none

Description Thomas Zander freebsd_committer freebsd_triage 2018-04-01 17:40:27 UTC
Created attachment 192068 [details]
Example code

The topic has been brought to my attention by a colleague at work.
When coming from Linux (and today, most folks do), people are surprised by the fact that write(2) to a device must be aligned to block size. (see attached example code)

I think it would be beneficial to mention this in the manpage, since at the moment it claims that a write() will only fail with EINVAL for an invalid file descriptor and if nbytes is greater than SSIZE_MAX.
Writing a non-aligned block onto a raw device is a case where EINVAL is also returned but the manpage does not mention this.
Comment 1 Thomas Zander freebsd_committer freebsd_triage 2018-06-01 13:55:07 UTC
Ping.