summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2018-06-22 21:36:18 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2018-06-26 16:55:46 +0100
commit8ce58c3259361e904033f88d83e958765181d8a3 (patch)
treed1cc3fc1c9c87d9b72b01eb53fe11c40e92b09d6
parent69987d9d4b1035f17de806aa848ef1af3c6c1a75 (diff)
downloadluxio-8ce58c3259361e904033f88d83e958765181d8a3.tar.bz2
Bind getpgrp(2)
-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 },