From nobody@FreeBSD.org  Thu Jun  7 16:24:06 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 28BF8106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Jun 2012 16:24:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 149298FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Jun 2012 16:24:06 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q57GO5iq006809
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 7 Jun 2012 16:24:05 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q57GO5sG006808;
	Thu, 7 Jun 2012 16:24:05 GMT
	(envelope-from nobody)
Message-Id: <201206071624.q57GO5sG006808@red.freebsd.org>
Date: Thu, 7 Jun 2012 16:24:05 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] remove `d` negative pointer EINVAL requirement from read(2)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         168814
>Category:       docs
>Synopsis:       [patch] remove `d` negative pointer EINVAL requirement from read(2)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 07 16:30:16 UTC 2012
>Closed-Date:    Thu Mar 27 05:56:51 CDT 2014
>Last-Modified:  Thu Mar 27 05:56:51 CDT 2014
>Originator:     Garrett Cooper
>Release:        9-STABLE
>Organization:
n/a
>Environment:
FreeBSD bayonetta.local 9.0-STABLE FreeBSD 9.0-STABLE #9 r236135M: Sat May 26 18:56:40 PDT 2012     gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
>Description:
The read(2) requirement that states that...

"     [EINVAL]           The pointer associated with d was negative.
"

.. is bogus based on my code inspection of sys_generic.c and kern_descrip.c (and the comment is misleading -- d isn't a pointer, but maybe the comment was referring to a kernel implementation item with file descriptor objects *shrugs*).
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: lib/libc/sys/read.2
===================================================================
--- lib/libc/sys/read.2	(revision 236718)
+++ lib/libc/sys/read.2	(working copy)
@@ -171,10 +171,6 @@
 (i.e.\& one that might block for an arbitrary amount of time)
 was interrupted by the delivery of a signal
 before any data arrived.
-.It Bq Er EINVAL
-The pointer associated with
-.Fa d
-was negative.
 .It Bq Er EAGAIN
 The file was marked for non-blocking I/O,
 and no data were ready to be read.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Jul 1 15:50:10 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168814 
Responsible-Changed-From-To: eadler->freebsd-doc 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Sep 2 16:52:45 UTC 2012 
Responsible-Changed-Why:  
I won't be looking at this PR for a while and I need to clear some out 
of my queue 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168814 
State-Changed-From-To: open->closed 
State-Changed-By: bdrewery 
State-Changed-When: Thu Mar 27 05:56:50 CDT 2014 
State-Changed-Why:  
It looks like uiomove() will return EINVAL on negative offset, and I did 
find tmpfs_read returning EINVAL on negative offset as well. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168814 
>Unformatted:
