diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index b34e2795d64..881d9613d2c 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -30,6 +30,9 @@ #ifdef HAVE_SYS_TIMES_H #include #endif +#ifdef HAVE_SYS_SYSCALL_H +#include +#endif #define NONAMELESSUNION #include "ntstatus.h" @@ -1184,6 +1187,11 @@ ULONG WINAPI NtGetCurrentProcessorNumber(void) { ULONG processor; +#if defined(__linux__) && defined(__NR_getcpu) + int res = syscall(__NR_getcpu, &processor); + if (res != -1) return processor; +#endif + if (NtCurrentTeb()->Peb->NumberOfProcessors > 1) { ULONG_PTR thread_mask, processor_mask;