[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Source code

On Tue, Jan 04, 2011 at 07:22:26PM +0100, Olaf van der Spek wrote:
> On Tue, Jan 4, 2011 at 7:20 PM, Ian Jackson
> <ijackson@chiark.greenend.org.uk> wrote:
> > Olaf van der Spek writes ("Re: Source code"):
> >> Renaming open files works, so that should no longer be a problem.
> >
> > They have to be able to be deleted.
> Why?

Because lots of programs expect something like

  fd = open("/tmp/foo", O_WRONLY|O_CREAT|O_EXCL);
  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.)

brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature

Reply to: