Wow, this is a sore subject. Check the archives of this list for a long version of this discussion.

David

Sent from my phone. Please excuse misspellings and terseness.


On Nov 30, 2016, at 5:04 AM, Giacomo Tesio <giacomo@tesio.it> wrote:

Hi guys, I know this is a noob question, but I'd really like to understand this aspect of the kernel design.

I'm planning to experiment on the topic, modifying chan.c so that the semantics of create(2) match those of create(5) about existing files. I guess that the number of callers to fix is manageable.

But since I can't see any good reason for the race being there in the first place (except maybe backward compatibility with unix, but that was not a problem for Plan 9 designers), I'm pretty sure I'm missing something obvious.


So, please, do you know why the create syscall does not simply return an error if the file already exists?
You might save me a few headache...


Thanks for your help!


Giacomo



2016-05-24 23:25 GMT+02:00 Giacomo Tesio <giacomo@tesio.it>:
I'm pretty curious about the create(2)/create(5) race described in a comment in namec (see https://github.com/brho/plan9/blob/master/sys/src/9/port/chan.c#L1564-L1603)

Does anyone know or remember the reasoning behind this design?

What was wrong about using the create(5) semantics for the create(2) syscall?


Giacomo