News for hackers. Stuff that matters.
Re:Proposed futex2 allows Linux to mimic the NT kernel for b... by poizan42 on Wednesday April 28, 2021 @10:52AM (#26970043)
I don't know why you are being downvoted, you are completely right. The NT api function is NtWaitForMultipleObjects. The Win32 apis WaitForMultipleObjects and WaitForMultipleObjectsEx are thin wrappers over this.
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?
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)
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.