rename(2) using NTFS transactions on Vista/2008

Eric Blake
Mon May 19 18:53:00 GMT 2008

According to Corinna Vinschen on 5/15/2008 12:03 PM:
> Hi,
> I just applied a patch (rather, three patches) which uses the new
> transactional NTFS (TxF) feature introduced with Vista/2008 to add
> atomicity in a few border cases of the rename(2) function.  POSIX
> requires that rename(2) works atomically, but without the new
> transactions, not all cases can be implemented atomically under Windows.

cygwin-1.7.0-9 had problems with rename("file","link") returning a 
spurious ENOENT.  But I haven't been able to test 1.7.0-10 yet, to see if 
it has been fixed.

Meanwhile, while looking at the code, is it really a good idea to have 3 
stack-allocated path_conv variables, each 32k in size?  That sounds like a 
recipe for disaster if the user's app is nearly at the end of the stack, 
and the 32k path_conv straddles the guard page, such that the stack growth 
faults outside of the guard page.

Don't work too hard, make some time for fun as well!

Eric Blake   

More information about the Cygwin-developers mailing list