Automatically restarting system calls?

Dan Stromberg dstromberglists at gmail.com
Fri Jun 13 18:41:46 CEST 2008


I wrote a script(1) replacement in python (http://stromberg.dnsalias.org/
~dstromberg/pypty/), but I'm encountering a problem in it.

I think I know the solution to the problem, but I'd've thought python was 
high level enough that this solution isn't required, so I wanted to 
inquire about it here.

Specifically, the program has a signal handler for window size changes.  
And if the window is resized during an os.write() (for example), I get a 
python exception about needing to restart the system call.

In C, I know you're supposed to wrap your system calls with while loops 
until you don't get an ERESTART, but does one really need to wrap all of 
one's os.write()'s (for example) with such while loops in python?

Thanks!




More information about the Python-list mailing list