ibcs2_sysi86.c (147822) | ibcs2_sysi86.c (164033) |
---|---|
1/*- 2 * Copyright (c) 1994 S�ren Schmidt 3 * Copyright (c) 1995 Steven Wallace 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994 S�ren Schmidt 3 * Copyright (c) 1995 Steven Wallace 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/i386/ibcs2/ibcs2_sysi86.c 147822 2005-07-07 19:30:30Z jhb $"); | 31__FBSDID("$FreeBSD: head/sys/i386/ibcs2/ibcs2_sysi86.c 164033 2006-11-06 13:42:10Z rwatson $"); |
32 33#include <sys/param.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/systm.h> 37#include <sys/sysctl.h> 38 39#include <i386/ibcs2/ibcs2_types.h> --- 31 unchanged lines hidden (view full) --- 71 case STIME: /* set the system time given pointer to long */ 72 /* gettimeofday; time.tv_sec = *args->arg; settimeofday */ 73 return EINVAL; 74 75 case SETNAME: { /* set hostname given string w/ len <= 7 chars */ 76 int name[2]; 77 int error; 78 | 32 33#include <sys/param.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/systm.h> 37#include <sys/sysctl.h> 38 39#include <i386/ibcs2/ibcs2_types.h> --- 31 unchanged lines hidden (view full) --- 71 case STIME: /* set the system time given pointer to long */ 72 /* gettimeofday; time.tv_sec = *args->arg; settimeofday */ 73 return EINVAL; 74 75 case SETNAME: { /* set hostname given string w/ len <= 7 chars */ 76 int name[2]; 77 int error; 78 |
79 if ((error = suser(td))) 80 return (error); | |
81 name[0] = CTL_KERN; 82 name[1] = KERN_HOSTNAME; 83 mtx_lock(&Giant); 84 error = userland_sysctl(td, name, 2, 0, 0, 0, 85 args->arg, 7, 0, 0); 86 mtx_unlock(&Giant); 87 return (error); 88 } --- 13 unchanged lines hidden --- | 79 name[0] = CTL_KERN; 80 name[1] = KERN_HOSTNAME; 81 mtx_lock(&Giant); 82 error = userland_sysctl(td, name, 2, 0, 0, 0, 83 args->arg, 7, 0, 0); 84 mtx_unlock(&Giant); 85 return (error); 86 } --- 13 unchanged lines hidden --- |