[PATCH] Cygwin: Implement 'reserved' marker in fdtable entries

Jon Turney jon.turney@dronecode.org.uk
Sat May 30 11:33:26 GMT 2026


On 22/05/2026 15:21, Christian Franke wrote:
> Jon Turney wrote:
>> On 22/05/2026 08:28, Mark Geisert wrote:
>>> ...
>>>
>>> The notion is that an fdtable entry provided by cygheap_fdnew is marked
>>> so that another thread can't obtain it.  Care is taken to reset the
>>> marker when the entry is no longer needed.  Actually, in the usual case
>>> the marker is overwritten with a pointer to an fhandler_base structure,
>>> by the reserving thread, as the syscall completes.
>>>
>>> Reported-by: Christian Franke <Christian.Franke@t-online.de>
>>> Addresses: https://cygwin.com/pipermail/cygwin/2026-May/259664.html
>>> Signed-off-by: Mark Geisert <mark@maxrnd.com>
>>> Fixes: e859706578ba (* autoload.cc (NtCreateFile): Add.)
>>
>> Thanks!
>>
>> This all seems fine and reasonable, but I have a couple of small 
>> comments.
> 
> A test with an enhanced version of the STC was successful.
> I could push this version (attached) to cygwin-apps/stc if desired.

Yes, that would be great. Please do so.

(I guess ideally after the fix is committed so it stays green, but it's 
red at the moment and I severely lack the time to investigate why...)



More information about the Cygwin-patches mailing list