moonbridge
changeset 270:fab22173abc8
Added signal constants table moonbridge_io.signals
author | jbe |
---|---|
date | Sun Jun 04 19:53:34 2017 +0200 (2017-06-04) |
parents | 694446c1316b |
children | 30629973dcff |
files | moonbridge_io.c reference.txt |
line diff
1.1 --- a/moonbridge_io.c Sun Jun 04 19:23:31 2017 +0200 1.2 +++ b/moonbridge_io.c Sun Jun 04 19:53:34 2017 +0200 1.3 @@ -2079,6 +2079,22 @@ 1.4 lua_setfield(L, -2, "stdout"); 1.5 moonbr_io_pushhandle(L, 2); 1.6 lua_setfield(L, -2, "stderr"); 1.7 + 1.8 + lua_newtable(L); // signal numbers 1.9 + lua_pushinteger(L, SIGHUP); lua_setfield(L, -2, "HUP"); 1.10 + lua_pushinteger(L, SIGINT); lua_setfield(L, -2, "INT"); 1.11 + lua_pushinteger(L, SIGQUIT); lua_setfield(L, -2, "QUIT"); 1.12 + lua_pushinteger(L, SIGABRT); lua_setfield(L, -2, "ABRT"); 1.13 + lua_pushinteger(L, SIGPIPE); lua_setfield(L, -2, "PIPE"); 1.14 + lua_pushinteger(L, SIGALRM); lua_setfield(L, -2, "ALRM"); 1.15 + lua_pushinteger(L, SIGTERM); lua_setfield(L, -2, "TERM"); 1.16 + lua_pushinteger(L, SIGTSTP); lua_setfield(L, -2, "TSTP"); 1.17 + lua_pushinteger(L, SIGCONT); lua_setfield(L, -2, "CONT"); 1.18 + lua_pushinteger(L, SIGVTALRM); lua_setfield(L, -2, "VTALRM"); 1.19 + lua_pushinteger(L, SIGINFO); lua_setfield(L, -2, "INFO"); 1.20 + lua_pushinteger(L, SIGUSR1); lua_setfield(L, -2, "USR1"); 1.21 + lua_pushinteger(L, SIGUSR2); lua_setfield(L, -2, "USR2"); 1.22 + lua_setfield(L, -2, "signals"); 1.23 1.24 luaL_setfuncs(L, moonbr_io_module_funcs, 0); 1.25 return 1;
2.1 --- a/reference.txt Sun Jun 04 19:23:31 2017 +0200 2.2 +++ b/reference.txt Sun Jun 04 19:53:34 2017 +0200 2.3 @@ -390,6 +390,12 @@ 2.4 Returns false (plus a notice as second return value) in case of timeout. 2.5 2.6 2.7 +### moonbridge_io.signals 2.8 + 2.9 +A table mapping a string (e.g. "TERM" or "KILL") to the corresponding signal 2.10 +number (e.g. 9 or 15, respectively). 2.11 + 2.12 + 2.13 ### moonbridge_io.signalsocket(signal1, signal2, ...) 2.14 2.15 This function installs a signal handler for the signals with the numbers passed