Add support for two Darwin sysctl
This commit is contained in:
parent
f882e535ec
commit
1ee1245718
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: darwin_syscall.h,v 1.7 2002/11/17 02:48:11 manu Exp $ */
|
||||
/* $NetBSD: darwin_syscall.h,v 1.8 2002/11/23 02:18:53 manu Exp $ */
|
||||
|
||||
/*
|
||||
* System call numbers.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: darwin_syscallargs.h,v 1.7 2002/11/17 02:48:12 manu Exp $ */
|
||||
/* $NetBSD: darwin_syscallargs.h,v 1.8 2002/11/23 02:18:53 manu Exp $ */
|
||||
|
||||
/*
|
||||
* System call argument lists.
|
||||
|
@ -27,6 +27,15 @@
|
|||
} be; \
|
||||
}
|
||||
|
||||
struct darwin_sys___sysctl_args {
|
||||
syscallarg(int *) name;
|
||||
syscallarg(u_int) namelen;
|
||||
syscallarg(void *) oldp;
|
||||
syscallarg(size_t *) oldlenp;
|
||||
syscallarg(void *) newp;
|
||||
syscallarg(size_t) newlen;
|
||||
};
|
||||
|
||||
struct darwin_sys_load_shared_file_args {
|
||||
syscallarg(char *) filename;
|
||||
syscallarg(caddr_t) addr;
|
||||
|
@ -219,7 +228,7 @@ int sys_mmap(struct proc *, void *, register_t *);
|
|||
int compat_43_sys_lseek(struct proc *, void *, register_t *);
|
||||
int freebsd_sys_truncate(struct proc *, void *, register_t *);
|
||||
int sys_ftruncate(struct proc *, void *, register_t *);
|
||||
int sys___sysctl(struct proc *, void *, register_t *);
|
||||
int darwin_sys___sysctl(struct proc *, void *, register_t *);
|
||||
int sys_mlock(struct proc *, void *, register_t *);
|
||||
int sys_munlock(struct proc *, void *, register_t *);
|
||||
int sys_undelete(struct proc *, void *, register_t *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: darwin_syscalls.c,v 1.7 2002/11/17 02:48:12 manu Exp $ */
|
||||
/* $NetBSD: darwin_syscalls.c,v 1.8 2002/11/23 02:18:53 manu Exp $ */
|
||||
|
||||
/*
|
||||
* System call names.
|
||||
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.7 2002/11/17 02:48:12 manu Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.8 2002/11/23 02:18:53 manu Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_ktrace.h"
|
||||
|
|
|
@ -0,0 +1,338 @@
|
|||
/* $NetBSD: darwin_sysctl.c,v 1.1 2002/11/23 02:18:54 manu Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Emmanuel Dreyfus
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: darwin_sysctl.c,v 1.1 2002/11/23 02:18:54 manu Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <sys/syscallargs.h>
|
||||
|
||||
#include <compat/mach/mach_types.h>
|
||||
#include <compat/mach/mach_vm.h>
|
||||
|
||||
#include <compat/freebsd/freebsd_syscallargs.h>
|
||||
|
||||
#include <compat/darwin/darwin_sysctl.h>
|
||||
#include <compat/darwin/darwin_syscallargs.h>
|
||||
|
||||
int darwin_kern_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_vm_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_vfs_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_net_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_debug_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_hw_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_machdep_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
int darwin_user_sysctl
|
||||
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
|
||||
|
||||
int
|
||||
darwin_sys___sysctl(struct proc *p, void *v, register_t *retval)
|
||||
{
|
||||
struct darwin_sys___sysctl_args /* {
|
||||
syscallarg(int *) name;
|
||||
syscallarg(u_int) namelen;
|
||||
syscallarg(void *) oldp;
|
||||
syscallarg(size_t *) oldlenp;
|
||||
syscallarg(void *) newp;
|
||||
syscallarg(size_t) newlen;
|
||||
} */ *uap = v;
|
||||
int error;
|
||||
sysctlfn *fn;
|
||||
int name[CTL_MAXNAME];
|
||||
size_t oldlen;
|
||||
size_t savelen;
|
||||
int *namep = SCARG(uap, name);
|
||||
int namelen = SCARG(uap, namelen);
|
||||
void *oldp = SCARG(uap, oldp);
|
||||
size_t *oldlenp = SCARG(uap, oldlenp);
|
||||
void *newp = SCARG(uap, newp);
|
||||
size_t newlen = SCARG(uap, newlen);
|
||||
|
||||
/*
|
||||
* all top-level sysctl names are non-terminal
|
||||
*/
|
||||
if (namelen > CTL_MAXNAME || namelen < 2)
|
||||
return EINVAL;
|
||||
if ((error = copyin(namep, &name, namelen * sizeof(int))) != 0)
|
||||
return error;
|
||||
|
||||
#ifdef DEBUG_DARWIN
|
||||
{
|
||||
int i;
|
||||
|
||||
DPRINTF(("darwin_sys___sysctl: name = [ "));
|
||||
for (i = 0; i < namelen; i++)
|
||||
DPRINTF(("%d, ", name[i]));
|
||||
DPRINTF(("]\n"));
|
||||
}
|
||||
#endif /* DEBUG_DARWIN */
|
||||
/*
|
||||
* Need to be root to change a value
|
||||
*/
|
||||
if ((newp != NULL) && (error = suser(p->p_ucred, &p->p_acflag)))
|
||||
return error;
|
||||
|
||||
switch (name[0]) {
|
||||
case DARWIN_CTL_KERN:
|
||||
fn = darwin_kern_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_VM:
|
||||
fn = darwin_vm_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_VFS:
|
||||
fn = darwin_vfs_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_NET:
|
||||
fn = darwin_net_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_DEBUG:
|
||||
fn = darwin_debug_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_HW:
|
||||
fn = darwin_hw_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_MACHDEP:
|
||||
fn = darwin_machdep_sysctl;
|
||||
break;
|
||||
case DARWIN_CTL_USER:
|
||||
fn = darwin_user_sysctl;
|
||||
break;
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if (oldlenp) {
|
||||
if ((error = copyin(oldlenp, &oldlen, sizeof(oldlen))) != 0)
|
||||
return error;
|
||||
oldlenp = &oldlen;
|
||||
}
|
||||
|
||||
if (oldp) {
|
||||
error = uvm_vslock(p, oldp, oldlen,
|
||||
VM_PROT_READ|VM_PROT_WRITE);
|
||||
savelen = oldlen;
|
||||
}
|
||||
|
||||
error = (*fn)(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, p);
|
||||
|
||||
if (oldp)
|
||||
uvm_vsunlock(p, oldp, savelen);
|
||||
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (oldlenp)
|
||||
error = copyout(&oldlen, SCARG(uap, oldlenp), sizeof(oldlen));
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
darwin_kern_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_vm_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_vfs_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_net_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_debug_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_hw_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
case DARWIN_HW_NCPU:
|
||||
name[0] = HW_NCPU;
|
||||
return hw_sysctl(name, 1, oldp, oldlenp, newp, newlen, p);
|
||||
break;
|
||||
case DARWIN_HW_VECTORUNIT:
|
||||
return sysctl_rdint(oldp, oldlenp, newp, 0);
|
||||
break;
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_machdep_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
darwin_user_sysctl(name, nlen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int nlen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
switch (name[0]) {
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
/* $NetBSD: darwin_sysctl.h,v 1.1 2002/11/23 02:18:55 manu Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Emmanuel Dreyfus
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _DARWIN_SYSCTL_H_
|
||||
#define _DARWIN_SYSCTL_H_
|
||||
|
||||
#define DARWIN_CTL_UNSPEC 0
|
||||
#define DARWIN_CTL_KERN 1
|
||||
#define DARWIN_CTL_VM 2
|
||||
#define DARWIN_CTL_VFS 3
|
||||
#define DARWIN_CTL_NET 4
|
||||
#define DARWIN_CTL_DEBUG 5
|
||||
#define DARWIN_CTL_HW 6
|
||||
#define DARWIN_CTL_MACHDEP 7
|
||||
#define DARWIN_CTL_USER 8
|
||||
#define DARWIN_CTL_MAXID 9
|
||||
|
||||
#define DARWIN_KERN_OSTYPE 1
|
||||
#define DARWIN_KERN_OSRELEASE 2
|
||||
#define DARWIN_KERN_OSREV 3
|
||||
#define DARWIN_KERN_VERSION 4
|
||||
#define DARWIN_KERN_MAXVNODES 5
|
||||
#define DARWIN_KERN_MAXPROC 6
|
||||
#define DARWIN_KERN_MAXFILES 7
|
||||
#define DARWIN_KERN_ARGMAX 8
|
||||
#define DARWIN_KERN_SECURELVL 9
|
||||
#define DARWIN_KERN_HOSTNAME 10
|
||||
#define DARWIN_KERN_HOSTID 11
|
||||
#define DARWIN_KERN_CLOCKRATE 12
|
||||
#define DARWIN_KERN_VNODE 13
|
||||
#define DARWIN_KERN_PROC 14
|
||||
#define DARWIN_KERN_FILE 15
|
||||
#define DARWIN_KERN_PROF 16
|
||||
#define DARWIN_KERN_POSIX1 17
|
||||
#define DARWIN_KERN_NGROUPS 18
|
||||
#define DARWIN_KERN_JOB_CONTROL 19
|
||||
#define DARWIN_KERN_SAVED_IDS 20
|
||||
#define DARWIN_KERN_BOOTTIME 21
|
||||
#define DARWIN_KERN_NISDOMAINNAME 22
|
||||
#define DARWIN_KERN_MAXPARTITIONS 23
|
||||
#define DARWIN_KERN_KDEBUG 24
|
||||
#define DARWIN_KERN_UPDATEINTERVAL 25
|
||||
#define DARWIN_KERN_OSRELDATE 26
|
||||
#define DARWIN_KERN_NTP_PLL 27
|
||||
#define DARWIN_KERN_BOOTFILE 28
|
||||
#define DARWIN_KERN_MAXFILESPERPROC 29
|
||||
#define DARWIN_KERN_MAXPROCPERUID 30
|
||||
#define DARWIN_KERN_DUMPDEV 31
|
||||
#define DARWIN_KERN_IPC 32
|
||||
#define DARWIN_KERN_DUMMY 33
|
||||
#define DARWIN_KERN_PS_STRINGS 34
|
||||
#define DARWIN_KERN_USRSTACK 35
|
||||
#define DARWIN_KERN_LOGSIGEXIT 36
|
||||
#define DARWIN_KERN_SYMFILE 37
|
||||
#define DARWIN_KERN_PROCARGS 38
|
||||
#define DARWIN_KERN_PCSAMPLES 39
|
||||
#define DARWIN_KERN_NETBOOT 40
|
||||
#define DARWIN_KERN_PANICINFO 41
|
||||
#define DARWIN_KERN_SYSV 42
|
||||
#define DARWIN_KERN_MAXID 43
|
||||
|
||||
#define DARWIN_KERN_KDEFLAGS 1
|
||||
#define DARWIN_KERN_KDDFLAGS 2
|
||||
#define DARWIN_KERN_KDENABLE 3
|
||||
#define DARWIN_KERN_KDSETBUF 4
|
||||
#define DARWIN_KERN_KDGETBUF 5
|
||||
#define DARWIN_KERN_KDSETUP 6
|
||||
#define DARWIN_KERN_KDREMOVE 7
|
||||
#define DARWIN_KERN_KDSETREG 8
|
||||
#define DARWIN_KERN_KDGETREG 9
|
||||
#define DARWIN_KERN_KDREADTR 10
|
||||
#define DARWIN_KERN_KDPIDTR 11
|
||||
#define DARWIN_KERN_KDTHRMAP 12
|
||||
#define DARWIN_KERN_KDPIDEX 14
|
||||
#define DARWIN_KERN_KDSETRTCDEC 15
|
||||
#define DARWIN_KERN_KDGETENTROPY 16
|
||||
|
||||
#define DARWIN_KERN_PCDISABLE 1
|
||||
#define DARWIN_KERN_PCSETBUF 2
|
||||
#define DARWIN_KERN_PCGETBUF 3
|
||||
#define DARWIN_KERN_PCSETUP 4
|
||||
#define DARWIN_KERN_PCREMOVE 5
|
||||
#define DARWIN_KERN_PCREADBUF 6
|
||||
#define DARWIN_KERN_PCSETREG 7
|
||||
#define DARWIN_KERN_PCCOMM 8
|
||||
|
||||
#define DARWIN_KERN_PANICINFO_MAXSIZE 1
|
||||
#define DARWIN_KERN_PANICINFO_IMAGE16 2
|
||||
#define DARWIN_KERN_PANICINFO_IMAGE32 3
|
||||
|
||||
#define DARWIN_KSYSV_SHMMAX 1
|
||||
#define DARWIN_KSYSV_SHMMIN 2
|
||||
#define DARWIN_KSYSV_SHMMNI 3
|
||||
#define DARWIN_KSYSV_SHMSEG 4
|
||||
#define DARWIN_KSYSV_SHMALL 5
|
||||
|
||||
#define DARWIN_KERN_PROC_ALL 0
|
||||
#define DARWIN_KERN_PROC_PID 1
|
||||
#define DARWIN_KERN_PROC_PGRP 2
|
||||
#define DARWIN_KERN_PROC_SESSION 3
|
||||
#define DARWIN_KERN_PROC_TTY 4
|
||||
#define DARWIN_KERN_PROC_UID 5
|
||||
#define DARWIN_KERN_PROC_RUID 6
|
||||
|
||||
#define DARWIN_KIPC_MAXSOCKBUF 1
|
||||
#define DARWIN_KIPC_SOCKBUF_WASTE 2
|
||||
#define DARWIN_KIPC_SOMAXCONN 3
|
||||
#define DARWIN_KIPC_MAX_LINKHDR 4
|
||||
#define DARWIN_KIPC_MAX_PROTOHDR 5
|
||||
#define DARWIN_KIPC_MAX_HDR 6
|
||||
#define DARWIN_KIPC_MAX_DATALEN 7
|
||||
#define DARWIN_KIPC_MBSTAT 8
|
||||
#define DARWIN_KIPC_NMBCLUSTERS 9
|
||||
|
||||
#define DARWIN_VM_METER 1
|
||||
#define DARWIN_VM_LOADAVG 2
|
||||
#define DARWIN_VM_MAXID 3
|
||||
#define DARWIN_VM_MACHFACTOR 4
|
||||
|
||||
#define DARWIN_HW_MACHINE 1
|
||||
#define DARWIN_HW_MODEL 2
|
||||
#define DARWIN_HW_NCPU 3
|
||||
#define DARWIN_HW_BYTEORDER 4
|
||||
#define DARWIN_HW_PHYSMEM 5
|
||||
#define DARWIN_HW_USERMEM 6
|
||||
#define DARWIN_HW_PAGESIZE 7
|
||||
#define DARWIN_HW_DISKNAMES 8
|
||||
#define DARWIN_HW_DISKSTATS 9
|
||||
#define DARWIN_HW_EPOCH 10
|
||||
#define DARWIN_HW_FLOATINGPT 11
|
||||
#define DARWIN_HW_MACHINE_ARCH 12
|
||||
#define DARWIN_HW_VECTORUNIT 13
|
||||
#define DARWIN_HW_BUS_FREQ 14
|
||||
#define DARWIN_HW_CPU_FREQ 15
|
||||
#define DARWIN_HW_CACHELINE 16
|
||||
#define DARWIN_HW_L1ICACHESIZE 17
|
||||
#define DARWIN_HW_L1DCACHESIZE 18
|
||||
#define DARWIN_HW_L2SETTINGS 19
|
||||
#define DARWIN_HW_L2CACHESIZE 20
|
||||
#define DARWIN_HW_L3SETTINGS 21
|
||||
#define DARWIN_HW_L3CACHESIZE 22
|
||||
#define DARWIN_HW_MAXID 23
|
||||
|
||||
#define DARWIN_USER_CS_PATH 1
|
||||
#define DARWIN_USER_BC_BASE_MAX 2
|
||||
#define DARWIN_USER_BC_DIM_MAX 3
|
||||
#define DARWIN_USER_BC_SCALE_MAX 4
|
||||
#define DARWIN_USER_BC_STRING_MAX 5
|
||||
#define DARWIN_USER_COLL_WEIGHTS_MAX 6
|
||||
#define DARWIN_USER_EXPR_NEST_MAX 7
|
||||
#define DARWIN_USER_LINE_MAX 8
|
||||
#define DARWIN_USER_RE_DUP_MAX 9
|
||||
#define DARWIN_USER_POSIX2_VERSION 10
|
||||
#define DARWIN_USER_POSIX2_C_BIND 11
|
||||
#define DARWIN_USER_POSIX2_C_DEV 12
|
||||
#define DARWIN_USER_POSIX2_CHAR_TERM 13
|
||||
#define DARWIN_USER_POSIX2_FORT_DEV 14
|
||||
#define DARWIN_USER_POSIX2_FORT_RUN 15
|
||||
#define DARWIN_USER_POSIX2_LOCALEDEF 16
|
||||
#define DARWIN_USER_POSIX2_SW_DEV 17
|
||||
#define DARWIN_USER_POSIX2_UPE 18
|
||||
#define DARWIN_USER_STREAM_MAX 19
|
||||
#define DARWIN_USER_TZNAME_MAX 20
|
||||
#define DARWIN_USER_MAXID 21
|
||||
|
||||
#define DARWIN_CTL_DEBUG_NAME 0
|
||||
#define DARWIN_CTL_DEBUG_VALUE 1
|
||||
#define DARWIN_CTL_DEBUG_MAXID 20
|
||||
|
||||
#endif /* _DARWIN_SYSCTL_H_ */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: darwin_sysent.c,v 1.7 2002/11/17 02:48:12 manu Exp $ */
|
||||
/* $NetBSD: darwin_sysent.c,v 1.8 2002/11/23 02:18:55 manu Exp $ */
|
||||
|
||||
/*
|
||||
* System call switch table.
|
||||
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.7 2002/11/17 02:48:12 manu Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.8 2002/11/23 02:18:55 manu Exp $");
|
||||
|
||||
#include "opt_ktrace.h"
|
||||
#include "opt_nfsserver.h"
|
||||
|
@ -465,8 +465,8 @@ struct sysent darwin_sysent[] = {
|
|||
freebsd_sys_truncate }, /* 200 = truncate */
|
||||
{ 3, s(struct sys_ftruncate_args), 0,
|
||||
sys_ftruncate }, /* 201 = ftruncate */
|
||||
{ 6, s(struct sys___sysctl_args), 0,
|
||||
sys___sysctl }, /* 202 = __sysctl */
|
||||
{ 6, s(struct darwin_sys___sysctl_args), 0,
|
||||
darwin_sys___sysctl }, /* 202 = __sysctl */
|
||||
{ 2, s(struct sys_mlock_args), 0,
|
||||
sys_mlock }, /* 203 = mlock */
|
||||
{ 2, s(struct sys_munlock_args), 0,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.darwin,v 1.4 2002/11/17 02:46:26 manu Exp $
|
||||
# $NetBSD: files.darwin,v 1.5 2002/11/23 02:18:56 manu Exp $
|
||||
#
|
||||
# Config file description for machine-independent Darwin compat code.
|
||||
# Included by ports that need it.
|
||||
|
@ -9,4 +9,5 @@
|
|||
file compat/darwin/darwin_exec.c compat_darwin
|
||||
file compat/darwin/darwin_mman.c compat_darwin
|
||||
file compat/darwin/darwin_sysent.c compat_darwin
|
||||
file compat/darwin/darwin_sysctl.c compat_darwin
|
||||
#file compat/freebsd/freebsd_file.c (in compat/freebsd/files.freebsd)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.4 2002/11/17 02:46:26 manu Exp $
|
||||
$NetBSD: syscalls.master,v 1.5 2002/11/23 02:18:56 manu Exp $
|
||||
|
||||
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
|
||||
|
||||
|
@ -384,8 +384,8 @@
|
|||
200 NOARGS { int freebsd_sys_truncate(const char *path, \
|
||||
int pad, off_t length); }
|
||||
201 NOARGS { int sys_ftruncate(int fd, int pad, off_t length); }
|
||||
202 NOARGS { int sys___sysctl(int *name, u_int namelen, \
|
||||
void *old, size_t *oldlenp, void *new, \
|
||||
202 STD { int darwin_sys___sysctl(int *name, u_int namelen, \
|
||||
void *oldp, size_t *oldlenp, void *newp, \
|
||||
size_t newlen); }
|
||||
203 NOARGS { int sys_mlock(const void *addr, size_t len); }
|
||||
204 NOARGS { int sys_munlock(const void *addr, size_t len); }
|
||||
|
|
Loading…
Reference in New Issue