Skip to content
Snippets Groups Projects
Commit 979099a4 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard
Browse files

ntdll: Read the current processor with the __NR_getcpu syscall.

parent 0e235e5d
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,9 @@
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment