On 19-Feb-02 Terry Lambert wrote:
> Julian Elischer wrote:
>> The fully safe version of this code is:
>> td->td_retval[0] = td->td_ucred->cr_ruid;
>> td->td_retval[1] = td->td_ucred->cr_uid;
>> return (0);
>> because td->td_ucred is read-only for it's whole existance.
> ???
> Are you sure that td->td_ucred can't change in the middle,
> to point to a different ucred, as a result of kernel
> preemption?

Yes.  A thread's ucred pointer is constant teh entire time that it is in the
kernel.  If we get preempted who cares.  We will still be teh same thread when
we continue executing. :)


John Baldwin <[EMAIL PROTECTED]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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

Reply via email to