In message: <[EMAIL PROTECTED]>
            Richard Sharpe <[EMAIL PROTECTED]> writes:
: Hi,
: 
: In looking at vn_open, I see that it calls namei and then a little while 
: later calls VOP_CREATE.
: 
: If the user did open(..., ... O_CREAT | O_EXCL, ...), what prevents a race 
: where one process discovers that the name doesn't already exist but 
: another gets in and creates the name?

The kernel locks out such possibilities.  The 'create on open' stuff
is an atomic operation.  The O_EXCL precludes others from opening the
file as well as forcing an error to be returned if someone else had
just created the file an instance before the open happened.

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to