linux_sysctl.c (108541) | linux_sysctl.c (109623) |
---|---|
1/*- 2 * Copyright (c) 2001 Marcel Moolenaar 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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2001 Marcel Moolenaar 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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/compat/linux/linux_sysctl.c 108541 2003-01-02 02:19:10Z alfred $ | 28 * $FreeBSD: head/sys/compat/linux/linux_sysctl.c 109623 2003-01-21 08:56:16Z alfred $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/lock.h> 33#include <sys/malloc.h> 34#include <sys/mutex.h> 35#include <sys/proc.h> 36#include <sys/sysctl.h> --- 50 unchanged lines hidden (view full) --- 87 88 error = copyin((caddr_t)args->args, &la, sizeof(la)); 89 if (error) 90 return (error); 91 92 if (la.nlen <= 0 || la.nlen > LINUX_CTL_MAXNAME) 93 return (ENOTDIR); 94 | 29 */ 30 31#include <sys/param.h> 32#include <sys/lock.h> 33#include <sys/malloc.h> 34#include <sys/mutex.h> 35#include <sys/proc.h> 36#include <sys/sysctl.h> --- 50 unchanged lines hidden (view full) --- 87 88 error = copyin((caddr_t)args->args, &la, sizeof(la)); 89 if (error) 90 return (error); 91 92 if (la.nlen <= 0 || la.nlen > LINUX_CTL_MAXNAME) 93 return (ENOTDIR); 94 |
95 mib = malloc(la.nlen * sizeof(l_int), M_TEMP, M_WAITOK); | 95 mib = malloc(la.nlen * sizeof(l_int), M_TEMP, 0); |
96 error = copyin(la.name, mib, la.nlen * sizeof(l_int)); 97 if (error) { 98 free(mib, M_TEMP); 99 return (error); 100 } 101 102 switch (mib[0]) { 103 case LINUX_CTL_KERN: --- 32 unchanged lines hidden --- | 96 error = copyin(la.name, mib, la.nlen * sizeof(l_int)); 97 if (error) { 98 free(mib, M_TEMP); 99 return (error); 100 } 101 102 switch (mib[0]) { 103 case LINUX_CTL_KERN: --- 32 unchanged lines hidden --- |