On Tue, Jan 4, 2011 at 8:45 PM, brian m. carlson <sand...@crustytoothpaste.net> wrote: > Because lots of programs expect something like > > fd = open("/tmp/foo", O_WRONLY|O_CREAT|O_EXCL); > unlink("/tmp/foo"); > write(fd, "data", 4); > > to succeed. This is how Unix filesystem semantics work and pretty much > always have. POSIX allows unlink(2) to return EBUSY, but that's not at > all Unixy. The only case I can see for EBUSY is what NetBSD and OpenBSD > do: restrict unlinking a mount point. (This is also the only case for > EBUSY on Solaris, Ultrix, and HP-UX.)
unlink will probably return an error, but since that's not checked, that snippet will succeed. WRONLY seems weird, what's the purpose of a snippet like this? Olaf -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/aanlktiknvk8a=uukoo2ceogclrcybyuejom+lkp9s...@mail.gmail.com