Re: proc_file_read() hack?

Thomas Hood (jdthood@mail.com)
25 Mar 2002 14:45:55 -0500


Unfortunately, your method #3 conflicts with methods #0 through #2,
which exhaust the range of possible values that may be returned
in *start. Any value greater than buffer is regarded as being
"within the buffer".

Introducing method #1 was a bad idea because this hack made it
impossible cleanly to implement what you suggest.

--
Thomas Hood

On Mon, 2002-03-25 at 13:18, Todd Inglett wrote: > How about applying my trivial patch and then adding this to your nice > comment? > > 3) Set *start = an address outside the buffer. > Put the data of the requested offset at *start. > Return the number of bytes of data placed there. > If this number is greater than zero and you > didn't signal eof and the reader is prepared to > take more data you will be called again with the > requested offset advanced by the number ob tyes > absorbed. > > The code should still work with the other cases now that the hack is > fixed. Of course, rather than add 3), it would be better to re-word 2) > (e.g. "Set *start = address of the buffer which may or may not be in the > given buffer.). > > There are cases where the data is available and need not be copied. My > code got simpler when I got rid of the need to copy my data around.

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