Am 21.10.2013 03:25 schröbte p...@pjb.com.au:
>
> That fixes what I had thought was a bug in readkey.  Another version
> of readkey could also happen sometime: my debian wheezy interrupts
> posix.read() even for a SIGWINCH, and returns nil.  I fear manually
> restarting interrupted system calls might be non-portable,

Why is that?

     int ret;
     do {
       errno = 0;
       ret = systemcall( arg1, arg2 );
     } while( ret < 0 && errno == EINTR );

... is the usual approach of dealing with interrupted system calls in C, 
AFAIK.

> and mutiple-handling of SIGWINCH might create race conditions.
> And yet I thought that with sigaction (luaposix uses sigaction),
> posix.read() would restart automatically if interrupted by a signal?

Only if you specify the `SA_RESTART` flag, which luaposix does not.

> Never had to wrestle with this stuff before...  Apologies for OT :-)
>
> Regards,  Peter Billam

Philipp




------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to