-int
-set_bsduthreadargs(thread_t th, void * pcb, __unused void *ignored_arg)
-{
- struct uthread * ut;
- struct proc *p = current_proc();
-
- ut = get_bsdthread_info(th);
- ut->uu_ar0 = (int *)pcb;
-
- /*
- * Delayed binding of thread credential to process credential.
- *
- * XXX This doesn't really belong here, but the i386 code has a
- * XXX number of seemingly gratuitous structural differences that
- * XXX make this the most appropriate place to do the work.
- */
- if (ut->uu_ucred != p->p_ucred &&
- (ut->uu_flag & UT_SETUID) == 0) {
- kauth_cred_t old = ut->uu_ucred;
- proc_lock(p);
- ut->uu_ucred = p->p_ucred;
- kauth_cred_ref(ut->uu_ucred);
- proc_unlock(p);
- if (old != NOCRED)
- kauth_cred_rele(old);
- }
-
- return(1);
-}
-