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 ( http://www.veritas.com )- 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/