Software /
code /
prosody
Comparison
util-src/signal.c @ 3274:366ac5e47096
util.signal: Make kill() available on OpenBSD, NetBSD (thanks Florob, filip).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 15 Jun 2010 16:57:15 +0500 |
parent | 2459:66f60e69567b |
child | 3282:8ef3beed0779 |
comparison
equal
deleted
inserted
replaced
3273:e9f5489ed2fe | 3274:366ac5e47096 |
---|---|
26 * OTHER DEALINGS IN THE SOFTWARE. | 26 * OTHER DEALINGS IN THE SOFTWARE. |
27 */ | 27 */ |
28 | 28 |
29 #include <signal.h> | 29 #include <signal.h> |
30 #include <stdlib.h> | 30 #include <stdlib.h> |
31 | |
32 #ifdef __unix__ | |
33 #include <sys/param.h> | |
34 #endif | |
31 | 35 |
32 #include "lua.h" | 36 #include "lua.h" |
33 #include "lauxlib.h" | 37 #include "lauxlib.h" |
34 | 38 |
35 #ifndef lsig | 39 #ifndef lsig |
324 luaL_checknumber(L, 1); /* will always error, with good error msg */ | 328 luaL_checknumber(L, 1); /* will always error, with good error msg */ |
325 | 329 |
326 return 1; | 330 return 1; |
327 } | 331 } |
328 | 332 |
329 #if defined _POSIX_SOURCE || (defined(sun) || defined(__sun)) | 333 #ifdef __unix__ |
330 | 334 |
331 /* define some posix only functions */ | 335 /* define some posix only functions */ |
332 | 336 |
333 /* | 337 /* |
334 * l_kill == kill(pid, signal) | 338 * l_kill == kill(pid, signal) |
371 #endif | 375 #endif |
372 | 376 |
373 static const struct luaL_Reg lsignal_lib[] = { | 377 static const struct luaL_Reg lsignal_lib[] = { |
374 {"signal", l_signal}, | 378 {"signal", l_signal}, |
375 {"raise", l_raise}, | 379 {"raise", l_raise}, |
376 #if defined _POSIX_SOURCE || (defined(sun) || defined(__sun)) | 380 #ifdef __unix__ |
377 {"kill", l_kill}, | 381 {"kill", l_kill}, |
378 #endif | 382 #endif |
379 {NULL, NULL} | 383 {NULL, NULL} |
380 }; | 384 }; |
381 | 385 |