Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/android-openjdk-build-multiarch
Path: blob/buildjre8/ios-missing-include/sys/kern_control.h
861 views
1
/*
2
* Copyright (c) 2000-2004, 2012-2016 Apple Inc. All rights reserved.
3
*
4
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
*
6
* This file contains Original Code and/or Modifications of Original Code
7
* as defined in and that are subject to the Apple Public Source License
8
* Version 2.0 (the 'License'). You may not use this file except in
9
* compliance with the License. The rights granted to you under the License
10
* may not be used to create, or enable the creation or redistribution of,
11
* unlawful or unlicensed copies of an Apple operating system, or to
12
* circumvent, violate, or enable the circumvention or violation of, any
13
* terms of an Apple operating system software license agreement.
14
*
15
* Please obtain a copy of the License at
16
* http://www.opensource.apple.com/apsl/ and read it before using this file.
17
*
18
* The Original Code and all software distributed under the License are
19
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
* Please see the License for the specific language governing rights and
24
* limitations under the License.
25
*
26
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
*/
28
/*!
29
* @header kern_control.h
30
* This header defines an API to communicate between a kernel
31
* extension and a process outside of the kernel.
32
*/
33
34
#ifndef KPI_KERN_CONTROL_H
35
#define KPI_KERN_CONTROL_H
36
37
38
#include <sys/appleapiopts.h>
39
#include <sys/_types/_u_char.h>
40
#include <sys/_types/_u_int16_t.h>
41
#include <sys/_types/_u_int32_t.h>
42
43
/*
44
* Define Controller event subclass, and associated events.
45
* Subclass of KEV_SYSTEM_CLASS
46
*/
47
48
/*!
49
* @defined KEV_CTL_SUBCLASS
50
* @discussion The kernel event subclass for kernel control events.
51
*/
52
#define KEV_CTL_SUBCLASS 2
53
54
/*!
55
* @defined KEV_CTL_REGISTERED
56
* @discussion The event code indicating a new controller was
57
* registered. The data portion will contain a ctl_event_data.
58
*/
59
#define KEV_CTL_REGISTERED 1 /* a new controller appears */
60
61
/*!
62
* @defined KEV_CTL_DEREGISTERED
63
* @discussion The event code indicating a controller was unregistered.
64
* The data portion will contain a ctl_event_data.
65
*/
66
#define KEV_CTL_DEREGISTERED 2 /* a controller disappears */
67
68
/*!
69
* @struct ctl_event_data
70
* @discussion This structure is used for KEV_CTL_SUBCLASS kernel
71
* events.
72
* @field ctl_id The kernel control id.
73
* @field ctl_unit The kernel control unit.
74
*/
75
struct ctl_event_data {
76
u_int32_t ctl_id; /* Kernel Controller ID */
77
u_int32_t ctl_unit;
78
};
79
80
/*
81
* Controls destined to the Controller Manager.
82
*/
83
84
/*!
85
* @defined CTLIOCGCOUNT
86
* @discussion The CTLIOCGCOUNT ioctl can be used to determine the
87
* number of kernel controllers registered.
88
*/
89
#define CTLIOCGCOUNT _IOR('N', 2, int) /* get number of control structures registered */
90
91
/*!
92
* @defined CTLIOCGINFO
93
* @discussion The CTLIOCGINFO ioctl can be used to convert a kernel
94
* control name to a kernel control id.
95
*/
96
#define CTLIOCGINFO _IOWR('N', 3, struct ctl_info) /* get id from name */
97
98
99
/*!
100
* @defined MAX_KCTL_NAME
101
* @discussion Kernel control names must be no longer than
102
* MAX_KCTL_NAME.
103
*/
104
#define MAX_KCTL_NAME 96
105
106
/*
107
* Controls destined to the Controller Manager.
108
*/
109
110
/*!
111
* @struct ctl_info
112
* @discussion This structure is used with the CTLIOCGINFO ioctl to
113
* translate from a kernel control name to a control id.
114
* @field ctl_id The kernel control id, filled out upon return.
115
* @field ctl_name The kernel control name to find.
116
*/
117
struct ctl_info {
118
u_int32_t ctl_id; /* Kernel Controller ID */
119
char ctl_name[MAX_KCTL_NAME]; /* Kernel Controller Name (a C string) */
120
};
121
122
123
/*!
124
* @struct sockaddr_ctl
125
* @discussion The controller address structure is used to establish
126
* contact between a user client and a kernel controller. The
127
* sc_id/sc_unit uniquely identify each controller. sc_id is a
128
* unique identifier assigned to the controller. The identifier can
129
* be assigned by the system at registration time or be a 32-bit
130
* creator code obtained from Apple Computer. sc_unit is a unit
131
* number for this sc_id, and is privately used by the kernel
132
* controller to identify several instances of the controller.
133
* @field sc_len The length of the structure.
134
* @field sc_family AF_SYSTEM.
135
* @field ss_sysaddr AF_SYS_KERNCONTROL.
136
* @field sc_id Controller unique identifier.
137
* @field sc_unit Kernel controller private unit number.
138
* @field sc_reserved Reserved, must be set to zero.
139
*/
140
struct sockaddr_ctl {
141
u_char sc_len; /* depends on size of bundle ID string */
142
u_char sc_family; /* AF_SYSTEM */
143
u_int16_t ss_sysaddr; /* AF_SYS_KERNCONTROL */
144
u_int32_t sc_id; /* Controller unique identifier */
145
u_int32_t sc_unit; /* Developer private unit number */
146
u_int32_t sc_reserved[5];
147
};
148
149
150
151
#endif /* KPI_KERN_CONTROL_H */
152
153