util.pposix: Expose the uname GNU extension field 'domainname'
authorKim Alvefur <zash@zash.se>
Wed, 25 Nov 2015 19:43:29 +0000 (20:43 +0100)
committerKim Alvefur <zash@zash.se>
Wed, 25 Nov 2015 19:43:29 +0000 (20:43 +0100)
util-src/pposix.c

index 02ea00871a7e2e3fea1c3df83bc01b8bff973c86..1b69852d2a703cacf2619adeffe821ad5ddb3b94 100644 (file)
@@ -642,6 +642,10 @@ int lc_uname(lua_State* L) {
        lua_setfield(L, -2, "version");
        lua_pushstring(L, uname_info.machine);
        lua_setfield(L, -2, "machine");
+#ifdef _GNU_SOURCE
+       lua_pushstring(L, uname_info.domainname);
+       lua_setfield(L, -2, "domainname");
+#endif
        return 1;
 }