mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Balbir Singh <balbir_soni@yahoo.com>
To: Jim Hollenback <jholly@cup.hp.com>
Cc: linux-kernel@vger.kernel.org
Subject: readv() return and errno
Date: Fri, 15 Mar 2002 15:15:18 -0800 (PST)	[thread overview]
Message-ID: <20020315231518.91030.qmail@web13608.mail.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

You are right, the latest POSIX spec says

ERRORS
....
The readv() function may fail if:

[EINVAL]
The iovcnt argument was less than or equal to 0, or
greater than {IOV_MAX}

Apply this trivial patch, if you want the required
behaviour (see attached)

Balbir







List:     linux-kernel
Subject:  readv() return and errno
From:     "Jim Hollenback" <jholly@cup.hp.com>
Date:     2002-03-15 21:54:26
[Download message RAW]

In doing some testing on the project I'm working on I 
came across something that is causing a bit of 
confusion on my part.

According to readv(2) EINVAL is returned for an 
invalid  argument.  The examples given were count
might 
be greater than MAX_IOVEC or zero. The test case I am 
working with has count = 0 and I get return of 0 and 
errno 0 instead of the expected -1 and errno EINVAL.

Am I missing something?

Thanks!

Jim Hollenback

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

[-- Attachment #2: rw.patch.txt --]
[-- Type: text/plain, Size: 343 bytes --]

--- read_write.c.org	Fri Mar 15 16:10:05 2002
+++ read_write.c	Fri Mar 15 16:10:13 2002
@@ -241,10 +241,9 @@
 	 * First get the "struct iovec" from user memory and
 	 * verify all the pointers
 	 */
-	ret = 0;
+	ret = -EINVAL;
 	if (!count)
 		goto out_nofree;
-	ret = -EINVAL;
 	if (count > UIO_MAXIOV)
 		goto out_nofree;
 	if (!file->f_op)

             reply	other threads:[~2002-03-15 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15 23:15 Balbir Singh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-26 21:37 Andries.Brouwer
2002-03-26 23:38 ` Alan Cox
2002-03-26 21:15 Andries.Brouwer
2002-03-26 23:40 ` Alan Cox
2002-03-26 17:13 Jim Hollenback
2002-03-26 18:06 ` Alan Cox
2002-03-26 16:19 Andries.Brouwer
2002-03-26 17:01 ` Balbir Singh
2002-03-15 21:54 Jim Hollenback
2002-03-19 13:27 ` Alex Riesen

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=20020315231518.91030.qmail@web13608.mail.yahoo.com \
    --to=balbir_soni@yahoo.com \
    --cc=jholly@cup.hp.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®