Bug 227185 - write(2) blocksize behaviour on raw devices should be added to manpage
Summary: write(2) blocksize behaviour on raw devices should be added to manpage
Status: New
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-01 17:40 UTC by Thomas Zander
Modified: 2018-06-01 13:55 UTC (History)
1 user (show)

See Also:


Attachments
Example code (412 bytes, text/plain)
2018-04-01 17:40 UTC, Thomas Zander
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Zander freebsd_committer 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 2018-06-01 13:55:07 UTC
Ping.