Take the common case of gettimeofday(&tv, NULL) out from under Giant.

This commit is contained in:
Poul-Henning Kamp 2002-02-18 08:40:28 +00:00
parent 90737495aa
commit 21dcdb38e1

View File

@ -336,20 +336,16 @@ gettimeofday(td, uap)
struct timeval atv;
int error = 0;
mtx_lock(&Giant);
if (uap->tp) {
microtime(&atv);
if ((error = copyout((caddr_t)&atv, (caddr_t)uap->tp,
sizeof (atv)))) {
goto done2;
}
error = copyout((caddr_t)&atv, (caddr_t)uap->tp, sizeof (atv));
}
if (uap->tzp) {
if (error == 0 && uap->tzp != NULL) {
mtx_lock(&Giant);
error = copyout((caddr_t)&tz, (caddr_t)uap->tzp,
sizeof (tz));
mtx_unlock(&Giant);
}
done2:
mtx_unlock(&Giant);
return (error);
}