return le2lib.getpid()
end
+--- Set process group ID.
+-- @pid process id
+-- @pgid process group id
+-- @raise error on failure.
+function e2lib.setpgid(pid, pgid)
+ return le2lib.setpgid(pid, pgid)
+end
+
--- Send signal to process.
-- @param pid Process ID to signal (number).
-- @param sig Signal number.
return 1;
}
+static int
+do_setpgid(lua_State *L)
+{
+ int rc, pid, pgid;
+
+ pid = luaL_checkint(L, 1);
+ pgid = luaL_checkint(L, 2);
+ if (setpgid(pid, pgid) != 0)
+ return luaL_error(L, "setpgid: %s", strerror(errno));
+
+ return 0;
+}
+
static int
do_unlink(lua_State *lua)
{
{ "poll", poll_fd },
{ "rmdir", do_rmdir },
{ "setenv", do_setenv },
+ { "setpgid", do_setpgid },
{ "signal_reset", signal_reset },
{ "stat", get_file_statistics },
{ "symlink", create_symlink },