freebsd32_misc.c (136152) | freebsd32_misc.c (136404) |
---|---|
1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 136152 2004-10-05 18:51:11Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 136404 2004-10-11 22:04:16Z peter $"); |
29 30#include "opt_compat.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35#include <sys/exec.h> 36#include <sys/fcntl.h> --- 1161 unchanged lines hidden (view full) --- 1198int 1199freebsd32_sysctl(struct thread *td, struct freebsd32_sysctl_args *uap) 1200{ 1201 int error, name[CTL_MAXNAME]; 1202 size_t j, oldlen; 1203 1204 if (uap->namelen > CTL_MAXNAME || uap->namelen < 2) 1205 return (EINVAL); | 29 30#include "opt_compat.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35#include <sys/exec.h> 36#include <sys/fcntl.h> --- 1161 unchanged lines hidden (view full) --- 1198int 1199freebsd32_sysctl(struct thread *td, struct freebsd32_sysctl_args *uap) 1200{ 1201 int error, name[CTL_MAXNAME]; 1202 size_t j, oldlen; 1203 1204 if (uap->namelen > CTL_MAXNAME || uap->namelen < 2) 1205 return (EINVAL); |
1206 1207 error = copyin(uap->name, &name, uap->namelen * sizeof(int)); | 1206 error = copyin(uap->name, name, uap->namelen * sizeof(int)); |
1208 if (error) 1209 return (error); | 1207 if (error) 1208 return (error); |
1210 | |
1211 mtx_lock(&Giant); | 1209 mtx_lock(&Giant); |
1212 | |
1213 if (uap->oldlenp) 1214 oldlen = fuword32(uap->oldlenp); 1215 else 1216 oldlen = 0; 1217 error = userland_sysctl(td, name, uap->namelen, 1218 uap->old, &oldlen, 1, | 1210 if (uap->oldlenp) 1211 oldlen = fuword32(uap->oldlenp); 1212 else 1213 oldlen = 0; 1214 error = userland_sysctl(td, name, uap->namelen, 1215 uap->old, &oldlen, 1, |
1219 uap->new, uap->newlen, &j); | 1216 uap->new, uap->newlen, &j, SCTL_MASK32); |
1220 if (error && error != ENOMEM) 1221 goto done2; | 1217 if (error && error != ENOMEM) 1218 goto done2; |
1222 if (uap->oldlenp) { | 1219 if (uap->oldlenp) |
1223 suword32(uap->oldlenp, j); | 1220 suword32(uap->oldlenp, j); |
1224 } | |
1225done2: 1226 mtx_unlock(&Giant); 1227 return (error); 1228} 1229 1230struct sigaction32 { 1231 u_int32_t sa_u; 1232 int sa_flags; --- 99 unchanged lines hidden --- | 1221done2: 1222 mtx_unlock(&Giant); 1223 return (error); 1224} 1225 1226struct sigaction32 { 1227 u_int32_t sa_u; 1228 int sa_flags; --- 99 unchanged lines hidden --- |