Skip to content

Commit 032e5d6

Browse files
committed
spawn/posix.c: Add support for POSIX_SPAWN_SETSID
Closes #6
1 parent 4cffc0c commit 032e5d6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spawn/posix.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ static int l_posix_spawnattr_getflags(lua_State *L) {
190190
lua_setfield(L, -2, "setsigdef");
191191
lua_pushboolean(L, flags & POSIX_SPAWN_SETSIGMASK);
192192
lua_setfield(L, -2, "setsigmask");
193+
#ifdef POSIX_SPAWN_SETSID
194+
lua_pushboolean(L, flags & POSIX_SPAWN_SETSID);
195+
lua_setfield(L, -2, "setsid");
196+
#endif
193197
#ifdef _POSIX_PRIORITY_SCHEDULING
194198
lua_pushboolean(L, flags & POSIX_SPAWN_SETSCHEDULER);
195199
lua_setfield(L, -2, "setscheduler");
@@ -217,6 +221,11 @@ static int l_posix_spawnattr_setflags(lua_State *L) {
217221
lua_getfield(L, 2, "setsigmask");
218222
if (lua_toboolean(L, -1)) flags |= POSIX_SPAWN_SETSIGMASK;
219223
lua_pop(L, 4);
224+
#ifdef POSIX_SPAWN_SETSID
225+
lua_getfield(L, 2, "setsid");
226+
if (lua_toboolean(L, -1)) flags |= POSIX_SPAWN_SETSID;
227+
lua_pop(L, 1);
228+
#endif
220229
#ifdef _POSIX_PRIORITY_SCHEDULING
221230
lua_getfield(L, 2, "setscheduler");
222231
if (lua_toboolean(L, -1)) flags |= POSIX_SPAWN_SETSCHEDULER;

0 commit comments

Comments
 (0)