1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. 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 --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/kern_xxx.c 184789 2008-11-09 10:45:13Z ed $"); |
34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/sysproto.h> 40#include <sys/kernel.h> 41#include <sys/priv.h> --- 101 unchanged lines hidden (view full) --- 143 struct thread *td; 144 struct oquota_args *uap; 145{ 146 147 return (ENOSYS); 148} 149#endif /* COMPAT_43 */ 150 |
151#ifdef COMPAT_FREEBSD4 |
152/* |
153 * This is the FreeBSD-1.1 compatible uname(2) interface. These days it is |
154 * done in libc as a wrapper around a bunch of sysctl's. This must maintain 155 * the old 1.1 binary ABI. 156 */ 157#if SYS_NMLN != 32 158#error "FreeBSD-1.1 uname syscall has been broken" 159#endif 160#ifndef _SYS_SYSPROTO_H_ 161struct uname_args { 162 struct utsname *name; 163}; 164#endif 165/* ARGSUSED */ 166int |
167freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) |
168{ 169 int name[2], error; 170 size_t len; 171 char *s, *us; 172 173 name[0] = CTL_KERN; 174 name[1] = KERN_OSTYPE; 175 len = sizeof (uap->name->sysname); --- 60 unchanged lines hidden (view full) --- 236#ifndef _SYS_SYSPROTO_H_ 237struct getdomainname_args { 238 char *domainname; 239 int len; 240}; 241#endif 242/* ARGSUSED */ 243int |
244freebsd4_getdomainname(struct thread *td, 245 struct freebsd4_getdomainname_args *uap) |
246{ |
247 int name[2]; 248 int error; 249 size_t len = uap->len; |
250 |
251 name[0] = CTL_KERN; 252 name[1] = KERN_NISDOMAINNAME; 253 mtx_lock(&Giant); 254 error = userland_sysctl(td, name, 2, uap->domainname, &len, 255 1, 0, 0, 0, 0); 256 mtx_unlock(&Giant); 257 return(error); |
258} 259 260#ifndef _SYS_SYSPROTO_H_ 261struct setdomainname_args { 262 char *domainname; 263 int len; 264}; 265#endif 266/* ARGSUSED */ 267int |
268freebsd4_setdomainname(struct thread *td, 269 struct freebsd4_setdomainname_args *uap) |
270{ |
271 int name[2]; 272 int error; |
273 |
274 name[0] = CTL_KERN; 275 name[1] = KERN_NISDOMAINNAME; 276 mtx_lock(&Giant); 277 error = userland_sysctl(td, name, 2, 0, 0, 0, uap->domainname, 278 uap->len, 0, 0); 279 mtx_unlock(&Giant); |
280 return (error); 281} |
282#endif /* COMPAT_FREEBSD4 */ |