From 5866bc772103346fcf336b18547930592787b05c Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 26 Nov 2025 22:14:41 +0300 Subject: [PATCH] winws2: gettid support --- nfq2/lua.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nfq2/lua.c b/nfq2/lua.c index c5d788e..9db19a5 100644 --- a/nfq2/lua.c +++ b/nfq2/lua.c @@ -4,9 +4,10 @@ #include #ifdef __FreeBSD__ #include -#endif -#ifdef __linux__ +#elif defined(__linux__) #include +#elif defined(__CYGWIN__) +#include #endif #include "lua.h" @@ -565,7 +566,7 @@ static int luacall_gettid(lua_State *L) lua_check_argc(L,"gettid", 0); #ifdef __OpenBSD__ lua_pushinteger(L, getthrid()); -#elif defined( __FreeBSD__) +#elif defined(__FreeBSD__) long tid; if (thr_self(&tid)) lua_pushnil(L); @@ -573,6 +574,8 @@ static int luacall_gettid(lua_State *L) lua_pushinteger(L, tid); #elif defined(__linux__) lua_pushinteger(L, syscall(SYS_gettid)); +#elif defined(__CYGWIN__) + lua_pushinteger(L, GetCurrentThreadId()); #else // unsupported OS ? lua_pushnil(L);