lkml.org 
[lkml]   [2006]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: procfs uglyness caused by "cat"
Date
> > static int uptime_read_proc(char *page, char **start, off_t off,
> > int count, int *eof, void *data)
> > {
> > struct timespec uptime;
> > struct timespec idle;
> > int len;
> > cputime_t idletime;
> >
> > + if (off)
> > + return 0;
>
> Except that this is wrong - if you try to advance the offset a bit from
> the start of the file and read something, you'll get nothing. This is
> inconsistent with normal file behavior.

so what - "uptime_read_proc" ignores the offset parameter anyway.
you get wrong results right now, too, even without the two lines
I've added.

if you write "Except that this is wrong" you should have in mind that
"this is wrong" currently, too.

just "try to advance the offset a bit from the start of the file and
read something", like "dd if=/proc/uptime bs=1 count=1 seek=1".
do you expect to get right results?

regards,
h.rosmanith


-
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: 2006-03-15 09:12    [W:0.064 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site