# HG changeset patch # User jbe # Date 1496598814 -7200 # Node ID fab22173abc8d725cf574d982dac7176600147a9 # Parent 694446c1316b4de5c15a6a90ffb5e18b1f24cd3c Added signal constants table moonbridge_io.signals diff -r 694446c1316b -r fab22173abc8 moonbridge_io.c --- a/moonbridge_io.c Sun Jun 04 19:23:31 2017 +0200 +++ b/moonbridge_io.c Sun Jun 04 19:53:34 2017 +0200 @@ -2079,6 +2079,22 @@ lua_setfield(L, -2, "stdout"); moonbr_io_pushhandle(L, 2); lua_setfield(L, -2, "stderr"); + + lua_newtable(L); // signal numbers + lua_pushinteger(L, SIGHUP); lua_setfield(L, -2, "HUP"); + lua_pushinteger(L, SIGINT); lua_setfield(L, -2, "INT"); + lua_pushinteger(L, SIGQUIT); lua_setfield(L, -2, "QUIT"); + lua_pushinteger(L, SIGABRT); lua_setfield(L, -2, "ABRT"); + lua_pushinteger(L, SIGPIPE); lua_setfield(L, -2, "PIPE"); + lua_pushinteger(L, SIGALRM); lua_setfield(L, -2, "ALRM"); + lua_pushinteger(L, SIGTERM); lua_setfield(L, -2, "TERM"); + lua_pushinteger(L, SIGTSTP); lua_setfield(L, -2, "TSTP"); + lua_pushinteger(L, SIGCONT); lua_setfield(L, -2, "CONT"); + lua_pushinteger(L, SIGVTALRM); lua_setfield(L, -2, "VTALRM"); + lua_pushinteger(L, SIGINFO); lua_setfield(L, -2, "INFO"); + lua_pushinteger(L, SIGUSR1); lua_setfield(L, -2, "USR1"); + lua_pushinteger(L, SIGUSR2); lua_setfield(L, -2, "USR2"); + lua_setfield(L, -2, "signals"); luaL_setfuncs(L, moonbr_io_module_funcs, 0); return 1; diff -r 694446c1316b -r fab22173abc8 reference.txt --- a/reference.txt Sun Jun 04 19:23:31 2017 +0200 +++ b/reference.txt Sun Jun 04 19:53:34 2017 +0200 @@ -390,6 +390,12 @@ Returns false (plus a notice as second return value) in case of timeout. +### moonbridge_io.signals + +A table mapping a string (e.g. "TERM" or "KILL") to the corresponding signal +number (e.g. 9 or 15, respectively). + + ### moonbridge_io.signalsocket(signal1, signal2, ...) This function installs a signal handler for the signals with the numbers passed