Re: reading a raw device starting from end

From: Amit S. Kale (
Date: Mon Apr 24 2000 - 07:46:03 EST

I had initially suggested ENOSPC because linux scsi block driver returns ENOSPC.
For consistency, ENOSPC looks to be the right value.

I later suggested ENXIO because that's the value solaris raw devices return
when trying to write beyond end. Solaris raw devices as well as block devices
return ENXIO.

On Mon, 24 Apr 2000, Jamie Lokier wrote:
> So should it be ENXIO or ENOSPC?
> I'm working with someone who's implementing a char driver that handles
> write() to a card's memory, and we return ENOSPC when the write starts
> beyond the card's memory.
> This makes Linux cat & dd terminate -- otherwise they just keep calling
> write() which keeps returning zero.
> We chose ENOSPC because that's what Linux returns when writing beyond
> the end of an IDE disk partition. But we'd like to be consistent with
> other drivers. Is ENXIO or even EINVAL the preferred error code?
> thanks,
> -- Jamie

Amit Kale
Veritas Software ( )

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:07 EST