[Bug 227185] write(2) blocksize behaviour on raw devices should be added to manpage

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Apr 1 17:40:28 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227185

            Bug ID: 227185
           Summary: write(2) blocksize behaviour on raw devices should be
                    added to manpage
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Documentation
          Assignee: freebsd-doc at FreeBSD.org
          Reporter: riggs at FreeBSD.org
 Attachment #192068 text/plain
         mime type:

Created attachment 192068
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=192068&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-doc mailing list