Subject: Re: read() EINVAL
To: Patrick Welche <prlw1@newn.cam.ac.uk>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-help
Date: 05/19/2003 22:06:32
On Sun, May 18, 2003 at 11:11:18PM +0100, Patrick Welche wrote:
> Any idea how I can get EINVAL from a read() call? The man page suggests
> 
>      [EINVAL]      The pointer associated with d was negative.
> 
>      [EINVAL]      The total length of the I/O is more than can be expressed
>                    by the ssize_t return value.
> 
> but this is coming from a read of a dvd, with fd=3, requesting 9*2048 bytes.
> Or maybe I don't understand "pointer associated with". d=3, so >0. What is
> the pointer associated with fd=3?

In this case I guess you get the EINVAL from the underlying driver.
Maybe the sector size isn't 2048 ?
an EINVAL can also be returned in case a command is terminated with
INVALID REQUEST. Does the kernel print some error message ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--