Re: [PATCH 5/5] tracing: add binary buffer files for use with splice

From: H. Peter Anvin
Date: Tue Mar 03 2009 - 23:44:23 EST


Steven Rostedt wrote:
Conventionally a read() system call will return the number of bytes
copied, and will only return -EFOO if the number of bytes copied was
zero.

Lots of parts of the kernel break this, but it's usually device drivers
and scruffy pseudo files, in which case a partial file read doesn't
make much sense. This doesn't make the broken behaviour right, but at
least we have a bit of a weaselly excuse in that case.

I just went by the read man page:

EFAULT buf is outside your accessible address space.

Yes, and that is the correct value if no bytes were copied.

-hpa

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