Subject: Re: funlink() for fun!
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 07/14/2003 20:42:47
> [Greg Woods going on about funlink()]
If I've understood you right, it would be just as satisfactory to have
a call unlink_if_pathname_matches_fd(const char *path, int fd), which
would work like unlink() applied to its first argument, but only if
that pathname resolves to the same object the fd is attached to.
(Modulo name issues, of course; I'm not thrilled with that name. :-)
For some uses, it might be even better to have an O_UNLINK flag, which
would be abstractly equivalent to opening the file with O_CREAT|O_EXCL,
but then unlink()ing the path, the critical part being that this
sequence is atomic with respect to all other filesystem operations.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B