lkml.org 
[lkml]   [2002]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: proc_file_read bug?
From
Date
On Fri, 2002-01-25 at 09:29, Andreas Schwab wrote:
> |> /* This is a hack to allow mangling of file pos independent
> |> * of actual bytes read. Simply place the data at page,
> |> * return the bytes, and set `start' to the desired offset
> |> * as an unsigned int. - Paul.Russell@rustcorp.com.au
> |> */

> It is documented, RTFC.

Comment or Code? The comment is somewhat ambiguous and incorrect.

Reading the code, I take it that "start" is either a pointer into
the buffer where the string of n data bytes starts, or else
(when it is assigned a value less than the beginning of the buffer)
it is a special value by which the file offset is to be adjusted,
instead of n. Thus the comment might be clarified:
/*
* This is a hack to allow adjusting the file offset
* by a number different from the number of bytes read.
* Simply place the data at page, return the number of
* bytes read, and set "start" to the (signed long) amount
* by which the file offset is to be increased or
* decreased
*/

My question then is: why would one want to adjust the file
offset other than by +n?

--
Thomas

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:15    [W:0.038 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site