From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: From: Giacomo Tesio Date: Wed, 30 Nov 2016 12:04:49 +0100 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a114a9a30774710054282aca5 Subject: Re: [9fans] create/create race Topicbox-Message-UUID: af6eeae2-ead9-11e9-9d60-3106f5b1d025 --001a114a9a30774710054282aca5 Content-Type: text/plain; charset=UTF-8 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 : > 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 > --001a114a9a30774710054282aca5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi guys, I know this is a noob qu= estion, but I'd really like to understand this aspect of the kernel des= ign.

I'm planning to experiment on the topic, modifying ch= an.c so that the semantics of create(2) match those of create(5) about exis= ting 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 i= n 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 missin= g something obvious.


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


Thanks for y= our help!


Giacomo



2016-05-24 23:25 GMT+02:00 Giacomo Tesio <giacomo@tesio.it>:
I= 9;m pretty curious about the create(2)/create(5) race described in a commen= t in namec (see https://github.com/brho/plan= 9/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) sysc= all?


Giacomo

--001a114a9a30774710054282aca5--