Comparison

util-src/pposix.c @ 6942:f12deb882148

util.pposix: Expose the uname GNU extension field 'domainname'
author Kim Alvefur <zash@zash.se>
date Wed, 25 Nov 2015 20:43:29 +0100
parent 6789:6b180e77c97a
child 7440:5424e24cdcb1
comparison
equal deleted inserted replaced
6941:33fbc835697d 6942:f12deb882148
640 lua_setfield(L, -2, "release"); 640 lua_setfield(L, -2, "release");
641 lua_pushstring(L, uname_info.version); 641 lua_pushstring(L, uname_info.version);
642 lua_setfield(L, -2, "version"); 642 lua_setfield(L, -2, "version");
643 lua_pushstring(L, uname_info.machine); 643 lua_pushstring(L, uname_info.machine);
644 lua_setfield(L, -2, "machine"); 644 lua_setfield(L, -2, "machine");
645 #ifdef _GNU_SOURCE
646 lua_pushstring(L, uname_info.domainname);
647 lua_setfield(L, -2, "domainname");
648 #endif
645 return 1; 649 return 1;
646 } 650 }
647 651
648 int lc_setenv(lua_State* L) { 652 int lc_setenv(lua_State* L) {
649 const char* var = luaL_checkstring(L, 1); 653 const char* var = luaL_checkstring(L, 1);