summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luxio.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/luxio.c b/luxio.c
index 102b772..b801cc0 100644
--- a/luxio.c
+++ b/luxio.c
@@ -731,7 +731,18 @@ luxio_getlogin(lua_State *L) /* 4.2.4 */
@section procgroup
*/
-/* TODO: getpgrp() 4.3.1 */
+static int
+luxio_getpgrp(lua_State *L)
+{
+ pid_t pgid;
+
+ pgid = getpgrp();
+
+ lua_pushinteger(L, pgid);
+
+ return 1;
+}
+
/* TODO: setsid() 4.3.2 */
/* TODO: setpgid() 4.3.3 */
@@ -4454,6 +4465,8 @@ luxio_functions[] = {
{ "getpid", luxio_getpid },
{ "getppid", luxio_getppid },
+ { "getpgrp", luxio_getpgrp },
+
{ "getuid", luxio_getuid },
{ "geteuid", luxio_geteuid },
{ "getgid", luxio_getgid },