On 31 January 2012 21:18, Bruno Haible <br...@clisp.org> wrote: > Reuben Thomas wrote: >> (SIGPOLL is mandated by POSIX). > > This is not true. Look at > <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html> > In the table, SIGPOLL is marked with OB and XSR. > - [OB] means obsolescent. > - [XSR] means XSI STREAMS.
Great, I can use _XOPEN_STREAMS to detect this. Thanks! I wasn't aware before quite how complicated POSIX is. >> I'm writing Lua bindings for POSIX APIs > > What can signals like SIGPOLL bring you in this use-case? Given that > you can't evaluate Lua code from within a signal handler (a consequence > of Lua's interpreter using malloc()/realloc(), and malloc()/realloc() not > being safe to be called from a signal handler), what can the user do with > a C binding that offers signals? The Lua bindings install a single signal handler that triggers a callback at Lua's equivalent of a breakpoint. Obviously this is not useful for everything, but it suffices, for example, to write handlers for SIGTSTP and SIGWINCH (as Zile uses). -- http://rrt.sc3d.org