This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: REPOST: unlink semantics




> -----Original Message-----
> From: Chris January [mailto:chris@atomice.net] 
> Sent: Wednesday, April 10, 2002 9:57 PM
> To: cygwin@cygwin.com
> Subject: REPOST: unlink semantics
> 
> 
> With respect to the 'Infinte Loop in "rm -fr"' thread, I 
> believe the current semantics of unlink on Cygwin to be 
> inconsistent with SuSv2.
> 
> SuSv2 specifies the following:

SuS assumes files can be removed/deleted while in use. 

> Cygwin's current implementation of unlink is not consistent 
> with the following part: "If one or more processes have the 
> file open when the last link is removed, the link will be 
> removed before unlink() returns, but the removal of the file 
> contents will be postponed until all references to the file 
> are closed." At present Cygwin delays not only the removal of 
> the file contents, but also the removal of the link (i.e. the 
> directory entry).

Patches to correct this gratefully accepted. Don't forget to test on
win9x and NT4. Also be sure to test what happens when you delete a .dll
out from under a program on win9x.

> As a suggested fix, path_conv::check could 
> returns ENOENT for a file if it appears in the delqueue. 

This introduces it's own problems: what happens when the application
then tries to create a new file with that file name? Do we give it a
random temporary name? What happens when the app then calls a non-cygwin
program with the file name.... oops!

Anyway, food for thought.

Rob

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]