summaryrefslogtreecommitdiffstats
path: root/sys/alpha/osf1
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-25 19:51:41 +0000
committerjhb <jhb@FreeBSD.org>2003-04-25 19:51:41 +0000
commit61d12d651940a5b8227a7eb7c8cb8dc39a98ebb8 (patch)
tree7e02aa076c883becc84a65077d8fe081a2107eae /sys/alpha/osf1
parent10710f6bc90e194670a95f2657cecc7208bc5152 (diff)
downloadFreeBSD-src-61d12d651940a5b8227a7eb7c8cb8dc39a98ebb8.zip
FreeBSD-src-61d12d651940a5b8227a7eb7c8cb8dc39a98ebb8.tar.gz
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.
Diffstat (limited to 'sys/alpha/osf1')
-rw-r--r--sys/alpha/osf1/osf1_misc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/alpha/osf1/osf1_misc.c b/sys/alpha/osf1/osf1_misc.c
index 8b49723..9232c9c 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;
OpenPOWER on IntegriCloud