Software /
code /
prosody
Comparison
util-src/signal.c @ 3282:8ef3beed0779
util.signal: Make kill() available on OS X (thanks darkrain).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 20 Jun 2010 03:36:46 +0500 |
parent | 3274:366ac5e47096 |
child | 3283:4a1a87254852 |
comparison
equal
deleted
inserted
replaced
3281:fd6ab269ecc2 | 3282:8ef3beed0779 |
---|---|
27 */ | 27 */ |
28 | 28 |
29 #include <signal.h> | 29 #include <signal.h> |
30 #include <stdlib.h> | 30 #include <stdlib.h> |
31 | 31 |
32 #ifdef __unix__ | 32 #if defined(__unix__) || defined(__APPLE__) |
33 #include <sys/param.h> | 33 #include <sys/param.h> |
34 #endif | 34 #endif |
35 | 35 |
36 #include "lua.h" | 36 #include "lua.h" |
37 #include "lauxlib.h" | 37 #include "lauxlib.h" |
328 luaL_checknumber(L, 1); /* will always error, with good error msg */ | 328 luaL_checknumber(L, 1); /* will always error, with good error msg */ |
329 | 329 |
330 return 1; | 330 return 1; |
331 } | 331 } |
332 | 332 |
333 #ifdef __unix__ | 333 #if defined(__unix__) || defined(__APPLE__) |
334 | 334 |
335 /* define some posix only functions */ | 335 /* define some posix only functions */ |
336 | 336 |
337 /* | 337 /* |
338 * l_kill == kill(pid, signal) | 338 * l_kill == kill(pid, signal) |
375 #endif | 375 #endif |
376 | 376 |
377 static const struct luaL_Reg lsignal_lib[] = { | 377 static const struct luaL_Reg lsignal_lib[] = { |
378 {"signal", l_signal}, | 378 {"signal", l_signal}, |
379 {"raise", l_raise}, | 379 {"raise", l_raise}, |
380 #ifdef __unix__ | 380 #if defined(__unix__) || defined(__APPLE__) |
381 {"kill", l_kill}, | 381 {"kill", l_kill}, |
382 #endif | 382 #endif |
383 {NULL, NULL} | 383 {NULL, NULL} |
384 }; | 384 }; |
385 | 385 |