[ltp] fancontrol script: Interrupted system call

Richard Neill linux-thinkpad@linux-thinkpad.org
Thu, 11 Oct 2007 18:58:02 +0100


Henrique de Moraes Holschuh wrote:

>>
>> /usr/sbin/fancontrol: line 50: echo: write error: Interrupted system
>> call
>>
>> line 50 of the script:
>>
>> echo $speed > /sys/devices/platform/thinkpad_hwmon/pwm1
>>
>> Can someone help me?
> 
> When you get an EINTR (interrupted system call), retry the operation.  This
> is needed for *every* read/write operation.  I wonder why the !@#$ shell is
> not doing it by itself?
> 

I was lead to believe that the read() and write() system calls used to 
be interruptable (with EINTR), but as of some time ago, glibc was 
re-written such that the syscall itself would handle restarting 
interrupted calls, and the main program would never see EINTR.

That's in C, of course (and I may have misunderstood anyway).

Just to check - you are using a reasonably recent version of bash, and 
not something weird like busybox-sh?  Are you using the builtin echo, or 
/bin/echo ?

Richard