Re: reading a raw device starting from end

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Mon Apr 24 2000 - 07:27:24 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



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