UbixOS V2 2.0

kern_sysctl.h
Go to the documentation of this file.
1 /*-
2 * Copyright (c) 2002-2018 The UbixOS Project.
3 * All rights reserved.
4 *
5 * This was developed by Christopher W. Olsen for the UbixOS Project.
6 *
7 * Redistribution and use in source and binary forms, with or without modification, are permitted
8 * provided that the following conditions are met:
9 *
10 * 1) Redistributions of source code must retain the above copyright notice, this list of
11 * conditions, the following disclaimer and the list of authors.
12 * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13 * conditions, the following disclaimer and the list of authors in the documentation and/or
14 * other materials provided with the distribution.
15 * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16 * endorse or promote products derived from this software without specific prior written
17 * permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef _SYS_KERN_SYSCTL_H
30 #define _SYS_KERN_SYSCTL_H
31
32 #include <sys/sysproto_posix.h>
33 #include <sys/thread.h>
34
35 #define CTL_MAXNAME 24 /* largest number of components supported */
36
37 /*
38 * Top-level identifiers
39 */
40 #define CTL_UNSPEC 0 /* unused */
41 #define CTL_KERN 1 /* "high kernel": proc, limits */
42 #define CTL_VM 2 /* virtual memory */
43 #define CTL_VFS 3 /* filesystem, mount type is next */
44 #define CTL_NET 4 /* network, see socket.h */
45 #define CTL_DEBUG 5 /* debugging parameters */
46 #define CTL_HW 6 /* generic cpu/io */
47 #define CTL_MACHDEP 7 /* machine dependent */
48 #define CTL_USER 8 /* user-level */
49 #define CTL_P1003_1B 9 /* POSIX 1003.1B */
50 #define CTL_UBIX 10 /* ubixos */
51
52 #define CTL_KERN_OPENFILES 1 /* kernel openfiles */
53
54 #define EINVAL -1 /* */
55
56 struct sysctl_entry {
57 struct sysctl_entry *prev;
58 struct sysctl_entry *next;
59 struct sysctl_entry *children;
60 char name[32];
61 int id;
62 void *value;
63 int val_len;
64 int full_name[CTL_MAXNAME];
65 int namelen;
66 };
67
68 int kern_sysctl(int *name,u_int namelen,void *old,size_t *oldlenp,void *new,size_t newlen,size_t *retval,int flags);
69 int sysctl_add(int *,int,char *,void *,int);
70 int sysctl_init();
71
72 extern bool sysctl_enabled;
73 #endif /* END _SYS_KERN_SYSCTL_H */
sysctl_entry::value
void * value
Definition: kern_sysctl.h:62
sysctl_entry::children
struct sysctl_entry * children
Definition: kern_sysctl.h:59
sysproto_posix.h
sysctl_add
int sysctl_add(int *, int, char *, void *, int)
Definition: kern_sysctl.c:418
sysctl_entry::full_name
int full_name[24]
Definition: kern_sysctl.h:64
sysctl_entry
Definition: kern_sysctl.h:56
sysctl_enabled
bool sysctl_enabled
CTL_MAXNAME
#define CTL_MAXNAME
Definition: kern_sysctl.h:35
sysctl_entry::next
struct sysctl_entry * next
Definition: kern_sysctl.h:58
sysctl_entry::prev
struct sysctl_entry * prev
Definition: kern_sysctl.h:57
sysctl_entry::name
char name[32]
Definition: kern_sysctl.h:60
name
const char * name
Definition: pci.c:37
sysctl_entry::namelen
int namelen
Definition: kern_sysctl.h:65
sysctl_init
int sysctl_init()
Definition: kern_sysctl.c:147
kern_sysctl
int kern_sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval, int flags)
sysctl_entry::val_len
int val_len
Definition: kern_sysctl.h:63
sysctl_entry::id
int id
Definition: kern_sysctl.h:61
u_int
unsigned int u_int
Definition: types.h:72
thread.h