*/
#include <sys/utsname.h>
+#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
return 0;
}
+static int
+ioctl_tiocsig_sigint(lua_State *L)
+{
+ /* master fd of the pseudo terminal */
+ int fd = luaL_checkinteger(L, 1);
+
+ if (ioctl(fd, TIOCSIG, SIGINT) < 0)
+ return luaL_error(L, "ioctl(TIOCSIG, SIGINT) failed: %s",
+ strerror(errno));
+ return 0;
+}
+
static int
do_forkpty(lua_State *L)
{
{ "forkpty", do_forkpty },
{ "getpid", do_getpid },
{ "hardlink", do_hardlink },
+ { "ioctl_tiocsig_sigint", ioctl_tiocsig_sigint },
{ "kill", do_kill },
{ "mkdir", do_mkdir },
{ "mkdtemp", do_mkdtemp },