Re: get info in a loop from a sysfs entry

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dave Hylands
Date: Tuesday, January 4, 2011 - 8:52 am

Hi Wouter,

On Tue, Jan 4, 2011 at 2:48 AM, Wouter Simons <lkml@woutersimons.org> wrote:

I would change this to use unbuffered I/O routines (i.e.
open/read/lseek/close) and use sscanf rather than fscanf.
fopen/fread/fseek/fclose use buffering by default.

That would eliminate any buffering that the user side runtime library
is doing. I suspect that because the data is buffered by the FILE *
routines, even doing the seek is just re-returning the data that was
read the first time around.

Dave Hylands

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
get info in a loop from a sysfs entry, Wouter Simons, (Tue Jan 4, 3:48 am)
Re: get info in a loop from a sysfs entry, Wouter Simons, (Tue Jan 4, 5:46 am)
Re: get info in a loop from a sysfs entry, Greg KH, (Tue Jan 4, 6:56 am)
Re: get info in a loop from a sysfs entry, Wouter Simons, (Tue Jan 4, 7:35 am)
Re: get info in a loop from a sysfs entry, Dave Hylands, (Tue Jan 4, 8:52 am)