sysctl.h (132784) | sysctl.h (136404) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Mike Karels at Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Mike Karels at Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 |
33 * $FreeBSD: head/sys/sys/sysctl.h 132784 2004-07-28 07:08:39Z kan $ | 33 * $FreeBSD: head/sys/sys/sysctl.h 136404 2004-10-11 22:04:16Z peter $ |
34 */ 35 36#ifndef _SYS_SYSCTL_H_ 37#define _SYS_SYSCTL_H_ 38 39#include <sys/queue.h> 40 41struct thread; --- 73 unchanged lines hidden (view full) --- 115#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \ 116 struct sysctl_req *req 117 118/* definitions for sysctl_req 'lock' member */ 119#define REQ_UNLOCKED 0 /* not locked and not wired */ 120#define REQ_LOCKED 1 /* locked and not wired */ 121#define REQ_WIRED 2 /* locked and wired */ 122 | 34 */ 35 36#ifndef _SYS_SYSCTL_H_ 37#define _SYS_SYSCTL_H_ 38 39#include <sys/queue.h> 40 41struct thread; --- 73 unchanged lines hidden (view full) --- 115#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \ 116 struct sysctl_req *req 117 118/* definitions for sysctl_req 'lock' member */ 119#define REQ_UNLOCKED 0 /* not locked and not wired */ 120#define REQ_LOCKED 1 /* locked and not wired */ 121#define REQ_WIRED 2 /* locked and wired */ 122 |
123/* definitions for sysctl_req 'flags' member */ 124#if defined(__amd64__) || defined(__ia64__) 125#define SCTL_MASK32 1 /* 32 bit emulation */ 126#endif 127 |
|
123/* 124 * This describes the access space for a sysctl request. This is needed 125 * so that we can use the interface from the kernel or from user-space. 126 */ 127struct sysctl_req { 128 struct thread *td; /* used for access checking */ 129 int lock; /* locking/wiring state */ 130 void *oldptr; 131 size_t oldlen; 132 size_t oldidx; 133 int (*oldfunc)(struct sysctl_req *, const void *, size_t); 134 void *newptr; 135 size_t newlen; 136 size_t newidx; 137 int (*newfunc)(struct sysctl_req *, void *, size_t); 138 size_t validlen; | 128/* 129 * This describes the access space for a sysctl request. This is needed 130 * so that we can use the interface from the kernel or from user-space. 131 */ 132struct sysctl_req { 133 struct thread *td; /* used for access checking */ 134 int lock; /* locking/wiring state */ 135 void *oldptr; 136 size_t oldlen; 137 size_t oldidx; 138 int (*oldfunc)(struct sysctl_req *, const void *, size_t); 139 void *newptr; 140 size_t newlen; 141 size_t newidx; 142 int (*newfunc)(struct sysctl_req *, void *, size_t); 143 size_t validlen; |
144 int flags; |
|
139}; 140 141SLIST_HEAD(sysctl_oid_list, sysctl_oid); 142 143/* 144 * This describes one "oid" in the MIB tree. Potentially more nodes can 145 * be hidden behind it, expanded by the handler. 146 */ --- 465 unchanged lines hidden (view full) --- 612 struct sysctl_oid *oidp); 613struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist, 614 struct sysctl_oid *oidp); 615int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist, 616 struct sysctl_oid *oidp); 617 618int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old, 619 size_t *oldlenp, void *new, size_t newlen, | 145}; 146 147SLIST_HEAD(sysctl_oid_list, sysctl_oid); 148 149/* 150 * This describes one "oid" in the MIB tree. Potentially more nodes can 151 * be hidden behind it, expanded by the handler. 152 */ --- 465 unchanged lines hidden (view full) --- 618 struct sysctl_oid *oidp); 619struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist, 620 struct sysctl_oid *oidp); 621int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist, 622 struct sysctl_oid *oidp); 623 624int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old, 625 size_t *oldlenp, void *new, size_t newlen, |
620 size_t *retval); | 626 size_t *retval, int flags); |
621int kernel_sysctlbyname(struct thread *td, char *name, 622 void *old, size_t *oldlenp, void *new, size_t newlen, | 627int kernel_sysctlbyname(struct thread *td, char *name, 628 void *old, size_t *oldlenp, void *new, size_t newlen, |
623 size_t *retval); | 629 size_t *retval, int flags); |
624int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, 625 size_t *oldlenp, int inkernel, void *new, size_t newlen, | 630int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, 631 size_t *oldlenp, int inkernel, void *new, size_t newlen, |
626 size_t *retval); | 632 size_t *retval, int flags); |
627int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, 628 int *nindx, struct sysctl_req *req); 629int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); 630 631#else /* !_KERNEL */ 632#include <sys/cdefs.h> 633 634__BEGIN_DECLS 635int sysctl(int *, u_int, void *, size_t *, void *, size_t); 636int sysctlbyname(const char *, void *, size_t *, void *, size_t); 637int sysctlnametomib(const char *, int *, size_t *); 638__END_DECLS 639#endif /* _KERNEL */ 640 641#endif /* !_SYS_SYSCTL_H_ */ | 633int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, 634 int *nindx, struct sysctl_req *req); 635int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); 636 637#else /* !_KERNEL */ 638#include <sys/cdefs.h> 639 640__BEGIN_DECLS 641int sysctl(int *, u_int, void *, size_t *, void *, size_t); 642int sysctlbyname(const char *, void *, size_t *, void *, size_t); 643int sysctlnametomib(const char *, int *, size_t *); 644__END_DECLS 645#endif /* _KERNEL */ 646 647#endif /* !_SYS_SYSCTL_H_ */ |