#ifdef __linux__
+#include <sys/time.h>
#include <signal.h>
#include <setjmp.h>
#include <unistd.h>
const char *family = luaL_optstring(L, 2, NULL);
#ifdef __linux__
+ const struct itimerval t = { {timeout * 1000 * 1000, 0} , {0, 0} };
struct sigaction sa_new, sa_old;
int timeout = luaL_optnumber(L, 3, 0);
if (timeout > 0 && timeout < 1000)
return 3;
}
- ualarm(timeout * 1000, 0);
+ setitimer(ITIMER_REAL, &t, NULL);
}
#endif
#ifdef __linux__
if (timeout > 0 && timeout < 1000)
{
- ualarm(0, 0);
+ alarm(0);
sigaction(SIGALRM, &sa_old, NULL);
}
#endif