Re:Proposed futex2 allows Linux to mimic the NT kernel for b...
by AndriyKunitsyn on Wednesday April 28, 2021 @10:57AM
(#26970093)
Is this NT API actually possible to be called from userspace? Or even from drivers?
[ Parent
| on HN ]
Re:Proposed futex2 allows Linux to mimic the NT kernel for b...
by poizan42 on Wednesday April 28, 2021 @11:08AM
(#26970241)
Yes of course, they are all exported from ntdll.dll (in userspace) and ntoskrnl.exe (in kernelspace). You may need to link dynamically or make your own import libraries for many of them though.
Re:Proposed futex2 allows Linux to mimic the NT kernel for b...
by andrealmeid on Wednesday April 28, 2021 @11:08AM
(#26970253)
Sure, here's an userspace example: https://docs.microsoft.com/en-us/windows/win32/sync/waiting-...
Re:Proposed futex2 allows Linux to mimic the NT kernel for b...
by leeter on Wednesday April 28, 2021 @01:22PM
(#26971865)
Based on the docs kernel mode drivers would call KeWaitForMultipleObjects instead it appears. User space should just call WaitForMultipleObjects. While NtWaitForMultipleObjects and ZwWaitForMultipleObjects exist they seem to be undocumented which means they probably have funky behavior. Anything in KernelBase.dll is a pretty thin wrapper that I'd be hesitant to call Win32 so much as "really thin syscall wrapper"
Re:Proposed futex2 allows Linux to mimic the NT kernel for b...
by a-dub on Wednesday April 28, 2021 @11:50AM
(#26970758)
think of it as like select and pthread_cond_wait rolled into one generic api for waiting on one or more things from the kernel.
it's actually pretty nice how generic they made it.