From b11c8f53dcbd5263a17f546ae4eb47c0ea5d5987 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 25 Apr 2003 19:51:41 +0000 Subject: [PATCH] Lock Giant around userland_sysctl() to get the hostname in osf1_sysinfo() so that the function is MP safe. The rest of the function doesn't need Giant. --- sys/alpha/osf1/osf1_misc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/alpha/osf1/osf1_misc.c b/sys/alpha/osf1/osf1_misc.c index 8b49723c745..9232c9c5fb7 100644 --- a/sys/alpha/osf1/osf1_misc.c +++ b/sys/alpha/osf1/osf1_misc.c @@ -1781,6 +1781,9 @@ osf1_table(td, uap) } +/* + * MPSAFE + */ int osf1_sysinfo(td, uap) struct thread *td; @@ -1804,8 +1807,10 @@ osf1_sysinfo(td, uap) len = uap->count; name[0] = CTL_KERN; name[1] = KERN_HOSTNAME; + mtx_lock(&Giant); retval = userland_sysctl(td, name, 2, uap->buf, &len, 1, 0, 0, &bytes); + mtx_unlock(&Giant); td->td_retval[0] = bytes; return(retval); break;