From: bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [Bug 86061] New: Condition for read(2) to return EINVAL is inaccurate
Date: Sat, 11 Oct 2014 19:58:04 +0000 [thread overview]
Message-ID: <bug-86061-11311@https.bugzilla.kernel.org/> (raw)
https://bugzilla.kernel.org/show_bug.cgi?id=86061
Bug ID: 86061
Summary: Condition for read(2) to return EINVAL is inaccurate
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
Assignee: documentation_man-pages-ztI5WcYan/vQLgFONoPN62D2FQJk+8+b@public.gmane.org
Reporter: nodakai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Regression: No
The man page reads
> If count is greater than SSIZE_MAX, the result is unspecified.
However when we look at the implementation, rw_verify_area() which is common to
vfs_read(), vfs_write() and so on actually tests if count fits ssize_t or not
and returns EINVAL otherwise.
http://lxr.free-electrons.com/source/fs/read_write.c#L348
So the man page should state so.
This is also important in terms of conformance/getting closer to POSIX.
Quotes from POSIX.1-2008:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html
> If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
where "implementation-defined" is defined as:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap01.html#tag_01_05_02
> Describes a value or behavior that is not defined by POSIX.1-2008 but is selected by an implementor. (...snip...)
>
> The implementor shall document such a value or behavior so that it can be used correctly by an application.
So it cannot be just "unspecified".
Moreover, write(2) doesn't say anything about the SSIZE_MAX limit.
--
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2014-10-11 19:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-86061-11311@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon-590eeb7gvniway/ihj7yzeb+6bgklq7r@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.