[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGPOLL on Darwin
From: |
Reuben Thomas |
Subject: |
Re: SIGPOLL on Darwin |
Date: |
Tue, 31 Jan 2012 23:31:46 +0000 |
On 31 January 2012 21:18, Bruno Haible <address@hidden> 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