]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX.
authorElizabeth Figura <zfigura@codeweavers.com>
Fri, 13 Dec 2024 19:34:46 +0000 (13:34 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2025 12:18:10 +0000 (13:18 +0100)
commit5bc2479a3585be35ea32e431bc82282bbf5a5d5b
tree3cfc9b87c98e0384e442dc4059734798bef33e14
parentcdbb997822806cc1071619b67aef485bb2b921b1
ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX.

This corresponds to the NT syscall NtCreateMutant().

An NT mutex is recursive, with a 32-bit recursion counter. When acquired via
NtWaitForMultipleObjects(), the recursion counter is incremented by one. The OS
records the thread which acquired it.

The OS records the thread which acquired it. However, in order to keep this
driver self-contained, the owning thread ID is managed by user-space, and passed
as a parameter to all relevant ioctls.

The initial owner and recursion count, if any, are specified when the mutex is
created.

Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
Link: https://lore.kernel.org/r/20241213193511.457338-6-zfigura@codeweavers.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ntsync.c
include/uapi/linux/ntsync.h