Rob Browning <[EMAIL PROTECTED]> writes:

> Given:
>
>   $ ls -l /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
>   -r--r--r-- 1 root root 4096 Nov 24 10:07
>     /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
>
>   $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
>   1862000
>
> This hangs:
>
>   $ guile -c '(call-with-input-file 
> "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" read)'
>
> Strace shows that the process is hanging in a select.  The same thing
> works fine for /proc/loadavg.
>
> I haven't investigated further yet.

It looks like this is a characteristic of the sysfs filesystem.  See
from line 355 onwards here:
http://www.gelato.unsw.edu.au/lxr/source/fs/sysfs/file.c.

Perhaps we could optimize Guile to skip the select when we know we're
reading from a file (or more generally, from any fd for which data is
either already there or will never be there)?

Regards,
     Neil



_______________________________________________
Guile-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to