/proc files missing statistics

Dave dave
Sun Jun 1 18:59:52 PDT 2003


Mark,

It didn't dawn on me what you were stating until I reread it. Indeed the
stats are present when a userland app reads it correctly...

When not using cat, tail, more, etc to read the statistic files I can see
all statistics.


Thanks much for your guidance!

-Dave

>
> To fix this, the function would have to properly support offsets.
> However, I'm not aware of an easy way to add this (which is why
> I didn't submit a patch for it a few months ago), since it would
> create the possibility of race conditions when the stats change
> from one read() block to the next.
>
> Since I'm not interested in allowing the possibility of race
> conditions, I work around this by using a bigger buffer in the
> userspace app which reads stats, with something similar to the
> following:
>
> file = fopen(filename, "r");
> if (file) {
> char *stdiobuf = malloc(1024);
> if (!stdiobuf)
> return fclose(file), count;
> setbuffer(file, stdiobuf, 1024);
> /* do your reads and parsing and such here */
> }
> fclose(file);
>







More information about the Hostap mailing list