authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 20:26:33-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 20:26:33-08:00
logcd221b9df9391758925200514c7648812ca4334a
tree334781f015b01f360e9c2970c4e86367fcb4aa60
parent16b7be34a1cc78ea3c2b6c89236eae3a7529c8a7

macOS libc headers: add sys/sysctl.h

libcxx depends on it

7 files changed, 2053 insertions(+), 0 deletions(-)

lib/libc/include/x86_64-macos-gnu/bsm/audit.h created+378
......@@ -0,0 +1,378 @@
1/*-
2 * Copyright (c) 2005-2009 Apple Inc.
3 * 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 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of Apple Inc. ("Apple") nor the names of
15 * its contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 $
30 */
31
32#ifndef _BSM_AUDIT_H
33#define _BSM_AUDIT_H
34
35#include <sys/param.h>
36#include <sys/types.h>
37
38#define AUDIT_RECORD_MAGIC 0x828a0f1b
39#define MAX_AUDIT_RECORDS 20
40#define MAXAUDITDATA (0x8000 - 1)
41#define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA
42#define MIN_AUDIT_FILE_SIZE (512 * 1024)
43
44/*
45 * Minimum noumber of free blocks on the filesystem containing the audit
46 * log necessary to avoid a hard log rotation. DO NOT SET THIS VALUE TO 0
47 * as the kernel does an unsigned compare, plus we want to leave a few blocks
48 * free so userspace can terminate the log, etc.
49 */
50#define AUDIT_HARD_LIMIT_FREE_BLOCKS 4
51
52/*
53 * Triggers for the audit daemon.
54 */
55#define AUDIT_TRIGGER_MIN 1
56#define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */
57#define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */
58#define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */
59#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */
60#define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */
61#define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests rotate. */
62#define AUDIT_TRIGGER_INITIALIZE 7 /* User initialize of auditd. */
63#define AUDIT_TRIGGER_EXPIRE_TRAILS 8 /* User expiration of trails. */
64#define AUDIT_TRIGGER_MAX 8
65
66/*
67 * The special device filename (FreeBSD).
68 */
69#define AUDITDEV_FILENAME "audit"
70#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME)
71
72/*
73 * Pre-defined audit IDs
74 */
75#define AU_DEFAUDITID (uid_t)(-1)
76#define AU_DEFAUDITSID 0
77#define AU_ASSIGN_ASID -1
78
79/*
80 * IPC types.
81 */
82#define AT_IPC_MSG ((unsigned char)1) /* Message IPC id. */
83#define AT_IPC_SEM ((unsigned char)2) /* Semaphore IPC id. */
84#define AT_IPC_SHM ((unsigned char)3) /* Shared mem IPC id. */
85
86/*
87 * Audit conditions.
88 */
89#define AUC_UNSET 0
90#define AUC_AUDITING 1
91#define AUC_NOAUDIT 2
92#define AUC_DISABLED -1
93
94/*
95 * auditon(2) commands.
96 */
97#define A_OLDGETPOLICY 2
98#define A_OLDSETPOLICY 3
99#define A_GETKMASK 4
100#define A_SETKMASK 5
101#define A_OLDGETQCTRL 6
102#define A_OLDSETQCTRL 7
103#define A_GETCWD 8
104#define A_GETCAR 9
105#define A_GETSTAT 12
106#define A_SETSTAT 13
107#define A_SETUMASK 14
108#define A_SETSMASK 15
109#define A_OLDGETCOND 20
110#define A_OLDSETCOND 21
111#define A_GETCLASS 22
112#define A_SETCLASS 23
113#define A_GETPINFO 24
114#define A_SETPMASK 25
115#define A_SETFSIZE 26
116#define A_GETFSIZE 27
117#define A_GETPINFO_ADDR 28
118#define A_GETKAUDIT 29
119#define A_SETKAUDIT 30
120#define A_SENDTRIGGER 31
121#define A_GETSINFO_ADDR 32
122#define A_GETPOLICY 33
123#define A_SETPOLICY 34
124#define A_GETQCTRL 35
125#define A_SETQCTRL 36
126#define A_GETCOND 37
127#define A_SETCOND 38
128#define A_GETSFLAGS 39
129#define A_SETSFLAGS 40
130#define A_GETCTLMODE 41
131#define A_SETCTLMODE 42
132#define A_GETEXPAFTER 43
133#define A_SETEXPAFTER 44
134
135/*
136 * Audit policy controls.
137 */
138#define AUDIT_CNT 0x0001
139#define AUDIT_AHLT 0x0002
140#define AUDIT_ARGV 0x0004
141#define AUDIT_ARGE 0x0008
142#define AUDIT_SEQ 0x0010
143#define AUDIT_WINDATA 0x0020
144#define AUDIT_USER 0x0040
145#define AUDIT_GROUP 0x0080
146#define AUDIT_TRAIL 0x0100
147#define AUDIT_PATH 0x0200
148#define AUDIT_SCNT 0x0400
149#define AUDIT_PUBLIC 0x0800
150#define AUDIT_ZONENAME 0x1000
151#define AUDIT_PERZONE 0x2000
152
153/*
154 * Default audit queue control parameters.
155 */
156#define AQ_HIWATER 100
157#define AQ_MAXHIGH 10000
158#define AQ_LOWATER 10
159#define AQ_BUFSZ MAXAUDITDATA
160#define AQ_MAXBUFSZ 1048576
161
162/*
163 * Default minimum percentage free space on file system.
164 */
165#define AU_FS_MINFREE 20
166
167/*
168 * Type definitions used indicating the length of variable length addresses
169 * in tokens containing addresses, such as header fields.
170 */
171#define AU_IPv4 4
172#define AU_IPv6 16
173
174/*
175 * Reserved audit class mask indicating which classes are unable to have
176 * events added or removed by unentitled processes.
177 */
178#define AU_CLASS_MASK_RESERVED 0x10000000
179
180/*
181 * Audit control modes
182 */
183#define AUDIT_CTLMODE_NORMAL ((unsigned char)1)
184#define AUDIT_CTLMODE_EXTERNAL ((unsigned char)2)
185
186/*
187 * Audit file expire_after op modes
188 */
189#define AUDIT_EXPIRE_OP_AND ((unsigned char)0)
190#define AUDIT_EXPIRE_OP_OR ((unsigned char)1)
191
192__BEGIN_DECLS
193
194typedef uid_t au_id_t;
195typedef pid_t au_asid_t;
196typedef u_int16_t au_event_t;
197typedef u_int16_t au_emod_t;
198typedef u_int32_t au_class_t;
199typedef u_int64_t au_asflgs_t __attribute__ ((aligned(8)));
200typedef unsigned char au_ctlmode_t;
201
202struct au_tid {
203 dev_t port;
204 u_int32_t machine;
205};
206typedef struct au_tid au_tid_t;
207
208struct au_tid_addr {
209 dev_t at_port;
210 u_int32_t at_type;
211 u_int32_t at_addr[4];
212};
213typedef struct au_tid_addr au_tid_addr_t;
214
215struct au_mask {
216 unsigned int am_success; /* Success bits. */
217 unsigned int am_failure; /* Failure bits. */
218};
219typedef struct au_mask au_mask_t;
220
221struct auditinfo {
222 au_id_t ai_auid; /* Audit user ID. */
223 au_mask_t ai_mask; /* Audit masks. */
224 au_tid_t ai_termid; /* Terminal ID. */
225 au_asid_t ai_asid; /* Audit session ID. */
226};
227typedef struct auditinfo auditinfo_t;
228
229struct auditinfo_addr {
230 au_id_t ai_auid; /* Audit user ID. */
231 au_mask_t ai_mask; /* Audit masks. */
232 au_tid_addr_t ai_termid; /* Terminal ID. */
233 au_asid_t ai_asid; /* Audit session ID. */
234 au_asflgs_t ai_flags; /* Audit session flags. */
235};
236typedef struct auditinfo_addr auditinfo_addr_t;
237
238struct auditpinfo {
239 pid_t ap_pid; /* ID of target process. */
240 au_id_t ap_auid; /* Audit user ID. */
241 au_mask_t ap_mask; /* Audit masks. */
242 au_tid_t ap_termid; /* Terminal ID. */
243 au_asid_t ap_asid; /* Audit session ID. */
244};
245typedef struct auditpinfo auditpinfo_t;
246
247struct auditpinfo_addr {
248 pid_t ap_pid; /* ID of target process. */
249 au_id_t ap_auid; /* Audit user ID. */
250 au_mask_t ap_mask; /* Audit masks. */
251 au_tid_addr_t ap_termid; /* Terminal ID. */
252 au_asid_t ap_asid; /* Audit session ID. */
253 au_asflgs_t ap_flags; /* Audit session flags. */
254};
255typedef struct auditpinfo_addr auditpinfo_addr_t;
256
257struct au_session {
258 auditinfo_addr_t *as_aia_p; /* Ptr to full audit info. */
259 au_mask_t as_mask; /* Process Audit Masks. */
260};
261typedef struct au_session au_session_t;
262
263struct au_expire_after {
264 time_t age; /* Age after which trail files should be expired */
265 size_t size; /* Aggregate trail size when files should be expired */
266 unsigned char op_type; /* Operator used with the above values to determine when files should be expired */
267};
268typedef struct au_expire_after au_expire_after_t;
269
270/*
271 * Contents of token_t are opaque outside of libbsm.
272 */
273typedef struct au_token token_t;
274
275/*
276 * Kernel audit queue control parameters:
277 * Default: Maximum:
278 * aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000)
279 * aq_lowater: AQ_LOWATER (10) <aq_hiwater
280 * aq_bufsz: AQ_BUFSZ (32767) AQ_MAXBUFSZ (1048576)
281 * aq_delay: 20 20000 (not used)
282 */
283struct au_qctrl {
284 int aq_hiwater; /* Max # of audit recs in queue when */
285 /* threads with new ARs get blocked. */
286
287 int aq_lowater; /* # of audit recs in queue when */
288 /* blocked threads get unblocked. */
289
290 int aq_bufsz; /* Max size of audit record for audit(2). */
291 int aq_delay; /* Queue delay (not used). */
292 int aq_minfree; /* Minimum filesystem percent free space. */
293};
294typedef struct au_qctrl au_qctrl_t;
295
296/*
297 * Structure for the audit statistics.
298 */
299struct audit_stat {
300 unsigned int as_version;
301 unsigned int as_numevent;
302 int as_generated;
303 int as_nonattrib;
304 int as_kernel;
305 int as_audit;
306 int as_auditctl;
307 int as_enqueue;
308 int as_written;
309 int as_wblocked;
310 int as_rblocked;
311 int as_dropped;
312 int as_totalsize;
313 unsigned int as_memused;
314};
315typedef struct audit_stat au_stat_t;
316
317/*
318 * Structure for the audit file statistics.
319 */
320struct audit_fstat {
321 u_int64_t af_filesz;
322 u_int64_t af_currsz;
323};
324typedef struct audit_fstat au_fstat_t;
325
326/*
327 * Audit to event class mapping.
328 */
329struct au_evclass_map {
330 au_event_t ec_number;
331 au_class_t ec_class;
332};
333typedef struct au_evclass_map au_evclass_map_t;
334
335/*
336 * Audit system calls.
337 */
338#if !defined(_KERNEL) && !defined(KERNEL)
339int audit(const void *, int);
340int auditon(int, void *, int);
341int auditctl(const char *);
342int getauid(au_id_t *);
343int setauid(const au_id_t *);
344int getaudit_addr(struct auditinfo_addr *, int);
345int setaudit_addr(const struct auditinfo_addr *, int);
346
347#if defined(__APPLE__)
348#include <Availability.h>
349
350/*
351 * getaudit()/setaudit() are deprecated and have been replaced with
352 * wrappers to the getaudit_addr()/setaudit_addr() syscalls above.
353 */
354
355int getaudit(struct auditinfo *)
356__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
357 __IPHONE_2_0, __IPHONE_6_0);
358int setaudit(const struct auditinfo *)
359__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
360 __IPHONE_2_0, __IPHONE_6_0);
361#else
362
363int getaudit(struct auditinfo *);
364int setaudit(const struct auditinfo *);
365#endif /* !__APPLE__ */
366
367#ifdef __APPLE_API_PRIVATE
368#include <mach/port.h>
369mach_port_name_t audit_session_self(void);
370au_asid_t audit_session_join(mach_port_name_t port);
371int audit_session_port(au_asid_t asid, mach_port_name_t *portname);
372#endif /* __APPLE_API_PRIVATE */
373
374#endif /* defined(_KERNEL) || defined(KERNEL) */
375
376__END_DECLS
377
378#endif /* !_BSM_AUDIT_H */
lib/libc/include/x86_64-macos-gnu/sys/event.h created+396
......@@ -0,0 +1,396 @@
1/*
2 * Copyright (c) 2003-2019 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 * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
30 * All rights reserved.
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
34 * are met:
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 *
41 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * $FreeBSD: src/sys/sys/event.h,v 1.5.2.5 2001/12/14 19:21:22 jlemon Exp $
54 */
55
56#ifndef _SYS_EVENT_H_
57#define _SYS_EVENT_H_
58
59#include <machine/types.h>
60#include <sys/cdefs.h>
61#include <stdint.h>
62
63/*
64 * Filter types
65 */
66#define EVFILT_READ (-1)
67#define EVFILT_WRITE (-2)
68#define EVFILT_AIO (-3) /* attached to aio requests */
69#define EVFILT_VNODE (-4) /* attached to vnodes */
70#define EVFILT_PROC (-5) /* attached to struct proc */
71#define EVFILT_SIGNAL (-6) /* attached to struct proc */
72#define EVFILT_TIMER (-7) /* timers */
73#define EVFILT_MACHPORT (-8) /* Mach portsets */
74#define EVFILT_FS (-9) /* Filesystem events */
75#define EVFILT_USER (-10) /* User events */
76#define EVFILT_VM (-12) /* Virtual memory events */
77#define EVFILT_EXCEPT (-15) /* Exception events */
78
79#define EVFILT_SYSCOUNT 17
80#define EVFILT_THREADMARKER EVFILT_SYSCOUNT /* Internal use only */
81
82#pragma pack(4)
83
84struct kevent {
85 uintptr_t ident; /* identifier for this event */
86 int16_t filter; /* filter for event */
87 uint16_t flags; /* general flags */
88 uint32_t fflags; /* filter-specific flags */
89 intptr_t data; /* filter-specific data */
90 void *udata; /* opaque user data identifier */
91};
92
93
94#pragma pack()
95
96struct kevent64_s {
97 uint64_t ident; /* identifier for this event */
98 int16_t filter; /* filter for event */
99 uint16_t flags; /* general flags */
100 uint32_t fflags; /* filter-specific flags */
101 int64_t data; /* filter-specific data */
102 uint64_t udata; /* opaque user data identifier */
103 uint64_t ext[2]; /* filter-specific extensions */
104};
105
106
107#define EV_SET(kevp, a, b, c, d, e, f) do { \
108 struct kevent *__kevp__ = (kevp); \
109 __kevp__->ident = (a); \
110 __kevp__->filter = (b); \
111 __kevp__->flags = (c); \
112 __kevp__->fflags = (d); \
113 __kevp__->data = (e); \
114 __kevp__->udata = (f); \
115} while(0)
116
117#define EV_SET64(kevp, a, b, c, d, e, f, g, h) do { \
118 struct kevent64_s *__kevp__ = (kevp); \
119 __kevp__->ident = (a); \
120 __kevp__->filter = (b); \
121 __kevp__->flags = (c); \
122 __kevp__->fflags = (d); \
123 __kevp__->data = (e); \
124 __kevp__->udata = (f); \
125 __kevp__->ext[0] = (g); \
126 __kevp__->ext[1] = (h); \
127} while(0)
128
129
130/* kevent system call flags */
131#define KEVENT_FLAG_NONE 0x000000 /* no flag value */
132#define KEVENT_FLAG_IMMEDIATE 0x000001 /* immediate timeout */
133#define KEVENT_FLAG_ERROR_EVENTS 0x000002 /* output events only include change errors */
134
135
136/* actions */
137#define EV_ADD 0x0001 /* add event to kq (implies enable) */
138#define EV_DELETE 0x0002 /* delete event from kq */
139#define EV_ENABLE 0x0004 /* enable event */
140#define EV_DISABLE 0x0008 /* disable event (not reported) */
141
142/* flags */
143#define EV_ONESHOT 0x0010 /* only report one occurrence */
144#define EV_CLEAR 0x0020 /* clear event state after reporting */
145#define EV_RECEIPT 0x0040 /* force immediate event output */
146 /* ... with or without EV_ERROR */
147 /* ... use KEVENT_FLAG_ERROR_EVENTS */
148 /* on syscalls supporting flags */
149
150#define EV_DISPATCH 0x0080 /* disable event after reporting */
151#define EV_UDATA_SPECIFIC 0x0100 /* unique kevent per udata value */
152
153#define EV_DISPATCH2 (EV_DISPATCH | EV_UDATA_SPECIFIC)
154/* ... in combination with EV_DELETE */
155/* will defer delete until udata-specific */
156/* event enabled. EINPROGRESS will be */
157/* returned to indicate the deferral */
158
159#define EV_VANISHED 0x0200 /* report that source has vanished */
160 /* ... only valid with EV_DISPATCH2 */
161
162#define EV_SYSFLAGS 0xF000 /* reserved by system */
163#define EV_FLAG0 0x1000 /* filter-specific flag */
164#define EV_FLAG1 0x2000 /* filter-specific flag */
165
166/* returned values */
167#define EV_EOF 0x8000 /* EOF detected */
168#define EV_ERROR 0x4000 /* error, data contains errno */
169
170/*
171 * Filter specific flags for EVFILT_READ
172 *
173 * The default behavior for EVFILT_READ is to make the "read" determination
174 * relative to the current file descriptor read pointer.
175 *
176 * The EV_POLL flag indicates the determination should be made via poll(2)
177 * semantics. These semantics dictate always returning true for regular files,
178 * regardless of the amount of unread data in the file.
179 *
180 * On input, EV_OOBAND specifies that filter should actively return in the
181 * presence of OOB on the descriptor. It implies that filter will return
182 * if there is OOB data available to read OR when any other condition
183 * for the read are met (for example number of bytes regular data becomes >=
184 * low-watermark).
185 * If EV_OOBAND is not set on input, it implies that the filter should not actively
186 * return for out of band data on the descriptor. The filter will then only return
187 * when some other condition for read is met (ex: when number of regular data bytes
188 * >=low-watermark OR when socket can't receive more data (SS_CANTRCVMORE)).
189 *
190 * On output, EV_OOBAND indicates the presence of OOB data on the descriptor.
191 * If it was not specified as an input parameter, then the data count is the
192 * number of bytes before the current OOB marker, else data count is the number
193 * of bytes beyond OOB marker.
194 */
195#define EV_POLL EV_FLAG0
196#define EV_OOBAND EV_FLAG1
197
198/*
199 * data/hint fflags for EVFILT_USER, shared with userspace
200 */
201
202/*
203 * On input, NOTE_TRIGGER causes the event to be triggered for output.
204 */
205#define NOTE_TRIGGER 0x01000000
206
207/*
208 * On input, the top two bits of fflags specifies how the lower twenty four
209 * bits should be applied to the stored value of fflags.
210 *
211 * On output, the top two bits will always be set to NOTE_FFNOP and the
212 * remaining twenty four bits will contain the stored fflags value.
213 */
214#define NOTE_FFNOP 0x00000000 /* ignore input fflags */
215#define NOTE_FFAND 0x40000000 /* and fflags */
216#define NOTE_FFOR 0x80000000 /* or fflags */
217#define NOTE_FFCOPY 0xc0000000 /* copy fflags */
218#define NOTE_FFCTRLMASK 0xc0000000 /* mask for operations */
219#define NOTE_FFLAGSMASK 0x00ffffff
220
221
222/*
223 * data/hint fflags for EVFILT_{READ|WRITE}, shared with userspace
224 *
225 * The default behavior for EVFILT_READ is to make the determination
226 * realtive to the current file descriptor read pointer.
227 */
228#define NOTE_LOWAT 0x00000001 /* low water mark */
229
230/* data/hint flags for EVFILT_EXCEPT, shared with userspace */
231#define NOTE_OOB 0x00000002 /* OOB data */
232
233/*
234 * data/hint fflags for EVFILT_VNODE, shared with userspace
235 */
236#define NOTE_DELETE 0x00000001 /* vnode was removed */
237#define NOTE_WRITE 0x00000002 /* data contents changed */
238#define NOTE_EXTEND 0x00000004 /* size increased */
239#define NOTE_ATTRIB 0x00000008 /* attributes changed */
240#define NOTE_LINK 0x00000010 /* link count changed */
241#define NOTE_RENAME 0x00000020 /* vnode was renamed */
242#define NOTE_REVOKE 0x00000040 /* vnode access was revoked */
243#define NOTE_NONE 0x00000080 /* No specific vnode event: to test for EVFILT_READ activation*/
244#define NOTE_FUNLOCK 0x00000100 /* vnode was unlocked by flock(2) */
245
246/*
247 * data/hint fflags for EVFILT_PROC, shared with userspace
248 *
249 * Please note that EVFILT_PROC and EVFILT_SIGNAL share the same knote list
250 * that hangs off the proc structure. They also both play games with the hint
251 * passed to KNOTE(). If NOTE_SIGNAL is passed as a hint, then the lower bits
252 * of the hint contain the signal. IF NOTE_FORK is passed, then the lower bits
253 * contain the PID of the child (but the pid does not get passed through in
254 * the actual kevent).
255 */
256enum {
257 eNoteReapDeprecated __deprecated_enum_msg("This kqueue(2) EVFILT_PROC flag is deprecated") = 0x10000000
258};
259
260#define NOTE_EXIT 0x80000000 /* process exited */
261#define NOTE_FORK 0x40000000 /* process forked */
262#define NOTE_EXEC 0x20000000 /* process exec'd */
263#define NOTE_REAP ((unsigned int)eNoteReapDeprecated /* 0x10000000 */ ) /* process reaped */
264#define NOTE_SIGNAL 0x08000000 /* shared with EVFILT_SIGNAL */
265#define NOTE_EXITSTATUS 0x04000000 /* exit status to be returned, valid for child process only */
266#define NOTE_EXIT_DETAIL 0x02000000 /* provide details on reasons for exit */
267
268#define NOTE_PDATAMASK 0x000fffff /* mask for signal & exit status */
269#define NOTE_PCTRLMASK (~NOTE_PDATAMASK)
270
271/*
272 * If NOTE_EXITSTATUS is present, provide additional info about exiting process.
273 */
274enum {
275 eNoteExitReparentedDeprecated __deprecated_enum_msg("This kqueue(2) EVFILT_PROC flag is no longer sent") = 0x00080000
276};
277#define NOTE_EXIT_REPARENTED ((unsigned int)eNoteExitReparentedDeprecated) /* exited while reparented */
278
279/*
280 * If NOTE_EXIT_DETAIL is present, these bits indicate specific reasons for exiting.
281 */
282#define NOTE_EXIT_DETAIL_MASK 0x00070000
283#define NOTE_EXIT_DECRYPTFAIL 0x00010000
284#define NOTE_EXIT_MEMORY 0x00020000
285#define NOTE_EXIT_CSERROR 0x00040000
286
287
288/*
289 * data/hint fflags for EVFILT_VM, shared with userspace.
290 */
291#define NOTE_VM_PRESSURE 0x80000000 /* will react on memory pressure */
292#define NOTE_VM_PRESSURE_TERMINATE 0x40000000 /* will quit on memory pressure, possibly after cleaning up dirty state */
293#define NOTE_VM_PRESSURE_SUDDEN_TERMINATE 0x20000000 /* will quit immediately on memory pressure */
294#define NOTE_VM_ERROR 0x10000000 /* there was an error */
295
296
297/*
298 * data/hint fflags for EVFILT_TIMER, shared with userspace.
299 * The default is a (repeating) interval timer with the data
300 * specifying the timeout interval in milliseconds.
301 *
302 * All timeouts are implicitly EV_CLEAR events.
303 */
304#define NOTE_SECONDS 0x00000001 /* data is seconds */
305#define NOTE_USECONDS 0x00000002 /* data is microseconds */
306#define NOTE_NSECONDS 0x00000004 /* data is nanoseconds */
307#define NOTE_ABSOLUTE 0x00000008 /* absolute timeout */
308/* ... implicit EV_ONESHOT, timeout uses the gettimeofday epoch */
309#define NOTE_LEEWAY 0x00000010 /* ext[1] holds leeway for power aware timers */
310#define NOTE_CRITICAL 0x00000020 /* system does minimal timer coalescing */
311#define NOTE_BACKGROUND 0x00000040 /* system does maximum timer coalescing */
312#define NOTE_MACH_CONTINUOUS_TIME 0x00000080
313/*
314 * NOTE_MACH_CONTINUOUS_TIME:
315 * with NOTE_ABSOLUTE: causes the timer to continue to tick across sleep,
316 * still uses gettimeofday epoch
317 * with NOTE_MACHTIME and NOTE_ABSOLUTE: uses mach continuous time epoch
318 * without NOTE_ABSOLUTE (interval timer mode): continues to tick across sleep
319 */
320#define NOTE_MACHTIME 0x00000100 /* data is mach absolute time units */
321/* timeout uses the mach absolute time epoch */
322
323
324/*
325 * data/hint fflags for EVFILT_MACHPORT, shared with userspace.
326 *
327 * Only portsets are supported at this time.
328 *
329 * The fflags field can optionally contain the MACH_RCV_MSG, MACH_RCV_LARGE,
330 * and related trailer receive options as defined in <mach/message.h>.
331 * The presence of these flags directs the kevent64() call to attempt to receive
332 * the message during kevent delivery, rather than just indicate that a message exists.
333 * On setup, The ext[0] field contains the receive buffer pointer and ext[1] contains
334 * the receive buffer length. Upon event delivery, the actual received message size
335 * is returned in ext[1]. As with mach_msg(), the buffer must be large enough to
336 * receive the message and the requested (or default) message trailers. In addition,
337 * the fflags field contains the return code normally returned by mach_msg().
338 *
339 * If MACH_RCV_MSG is specified, and the ext[1] field specifies a zero length, the
340 * system call argument specifying an ouput area (kevent_qos) will be consulted. If
341 * the system call specified an output data area, the user-space address
342 * of the received message is carved from that provided output data area (if enough
343 * space remains there). The address and length of each received message is
344 * returned in the ext[0] and ext[1] fields (respectively) of the corresponding kevent.
345 *
346 * IF_MACH_RCV_VOUCHER_CONTENT is specified, the contents of the message voucher is
347 * extracted (as specified in the xflags field) and stored in ext[2] up to ext[3]
348 * length. If the input length is zero, and the system call provided a data area,
349 * the space for the voucher content is carved from the provided space and its
350 * address and length is returned in ext[2] and ext[3] respectively.
351 *
352 * If no message receipt options were provided in the fflags field on setup, no
353 * message is received by this call. Instead, on output, the data field simply
354 * contains the name of the actual port detected with a message waiting.
355 */
356
357/*
358 * DEPRECATED!!!!!!!!!
359 * NOTE_TRACK, NOTE_TRACKERR, and NOTE_CHILD are no longer supported as of 10.5
360 */
361/* additional flags for EVFILT_PROC */
362#define NOTE_TRACK 0x00000001 /* follow across forks */
363#define NOTE_TRACKERR 0x00000002 /* could not track child */
364#define NOTE_CHILD 0x00000004 /* am a child process */
365
366
367
368/* Temporay solution for BootX to use inode.h till kqueue moves to vfs layer */
369#include <sys/queue.h>
370struct knote;
371SLIST_HEAD(klist, knote);
372
373
374#include <sys/types.h>
375
376struct timespec;
377
378__BEGIN_DECLS
379int kqueue(void);
380int kevent(int kq,
381 const struct kevent *changelist, int nchanges,
382 struct kevent *eventlist, int nevents,
383 const struct timespec *timeout);
384int kevent64(int kq,
385 const struct kevent64_s *changelist, int nchanges,
386 struct kevent64_s *eventlist, int nevents,
387 unsigned int flags,
388 const struct timespec *timeout);
389
390
391__END_DECLS
392
393
394
395
396#endif /* !_SYS_EVENT_H_ */
lib/libc/include/x86_64-macos-gnu/sys/lock.h created+76
......@@ -0,0 +1,76 @@
1/*
2 * Copyright (c) 2000-2006 Apple Computer, 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/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */
29/*
30 * Copyright (c) 1995
31 * The Regents of the University of California. All rights reserved.
32 *
33 * This code contains ideas from software contributed to Berkeley by
34 * Avadis Tevanian, Jr., Michael Wayne Young, and the Mach Operating
35 * System project at Carnegie-Mellon University.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by the University of
48 * California, Berkeley and its contributors.
49 * 4. Neither the name of the University nor the names of its contributors
50 * may be used to endorse or promote products derived from this software
51 * without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE.
64 *
65 * @(#)lock.h 8.12 (Berkeley) 5/19/95
66 */
67
68#ifndef _SYS_LOCK_H_
69#define _SYS_LOCK_H_
70
71#include <sys/appleapiopts.h>
72#include <sys/types.h>
73#include <sys/cdefs.h>
74
75
76#endif /* _SYS_LOCK_H_ */
lib/libc/include/x86_64-macos-gnu/sys/proc.h created+223
......@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) 2000-2018 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/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */
29/*-
30 * Copyright (c) 1986, 1989, 1991, 1993
31 * The Regents of the University of California. All rights reserved.
32 * (c) UNIX System Laboratories, Inc.
33 * All or some portions of this file are derived from material licensed
34 * to the University of California by American Telephone and Telegraph
35 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
36 * the permission of UNIX System Laboratories, Inc.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. All advertising materials mentioning features or use of this software
47 * must display the following acknowledgement:
48 * This product includes software developed by the University of
49 * California, Berkeley and its contributors.
50 * 4. Neither the name of the University nor the names of its contributors
51 * may be used to endorse or promote products derived from this software
52 * without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 *
66 * @(#)proc.h 8.15 (Berkeley) 5/19/95
67 */
68
69#ifndef _SYS_PROC_H_
70#define _SYS_PROC_H_
71
72#include <sys/appleapiopts.h>
73#include <sys/cdefs.h>
74#include <sys/select.h> /* For struct selinfo. */
75#include <sys/queue.h>
76#include <sys/lock.h>
77#include <sys/param.h>
78#include <sys/event.h>
79#include <sys/time.h>
80#include <mach/boolean.h>
81
82
83
84struct session;
85struct pgrp;
86struct proc;
87
88/* Exported fields for kern sysctls */
89struct extern_proc {
90 union {
91 struct {
92 struct proc *__p_forw; /* Doubly-linked run/sleep queue. */
93 struct proc *__p_back;
94 } p_st1;
95 struct timeval __p_starttime; /* process start time */
96 } p_un;
97#define p_forw p_un.p_st1.__p_forw
98#define p_back p_un.p_st1.__p_back
99#define p_starttime p_un.__p_starttime
100 struct vmspace *p_vmspace; /* Address space. */
101 struct sigacts *p_sigacts; /* Signal actions, state (PROC ONLY). */
102 int p_flag; /* P_* flags. */
103 char p_stat; /* S* process status. */
104 pid_t p_pid; /* Process identifier. */
105 pid_t p_oppid; /* Save parent pid during ptrace. XXX */
106 int p_dupfd; /* Sideways return value from fdopen. XXX */
107 /* Mach related */
108 caddr_t user_stack; /* where user stack was allocated */
109 void *exit_thread; /* XXX Which thread is exiting? */
110 int p_debugger; /* allow to debug */
111 boolean_t sigwait; /* indication to suspend */
112 /* scheduling */
113 u_int p_estcpu; /* Time averaged value of p_cpticks. */
114 int p_cpticks; /* Ticks of cpu time. */
115 fixpt_t p_pctcpu; /* %cpu for this process during p_swtime */
116 void *p_wchan; /* Sleep address. */
117 char *p_wmesg; /* Reason for sleep. */
118 u_int p_swtime; /* Time swapped in or out. */
119 u_int p_slptime; /* Time since last blocked. */
120 struct itimerval p_realtimer; /* Alarm timer. */
121 struct timeval p_rtime; /* Real time. */
122 u_quad_t p_uticks; /* Statclock hits in user mode. */
123 u_quad_t p_sticks; /* Statclock hits in system mode. */
124 u_quad_t p_iticks; /* Statclock hits processing intr. */
125 int p_traceflag; /* Kernel trace points. */
126 struct vnode *p_tracep; /* Trace to vnode. */
127 int p_siglist; /* DEPRECATED. */
128 struct vnode *p_textvp; /* Vnode of executable. */
129 int p_holdcnt; /* If non-zero, don't swap. */
130 sigset_t p_sigmask; /* DEPRECATED. */
131 sigset_t p_sigignore; /* Signals being ignored. */
132 sigset_t p_sigcatch; /* Signals being caught by user. */
133 u_char p_priority; /* Process priority. */
134 u_char p_usrpri; /* User-priority based on p_cpu and p_nice. */
135 char p_nice; /* Process "nice" value. */
136 char p_comm[MAXCOMLEN + 1];
137 struct pgrp *p_pgrp; /* Pointer to process group. */
138 struct user *p_addr; /* Kernel virtual addr of u-area (PROC ONLY). */
139 u_short p_xstat; /* Exit status for wait; also stop signal. */
140 u_short p_acflag; /* Accounting flags. */
141 struct rusage *p_ru; /* Exit information. XXX */
142};
143
144
145/* Status values. */
146#define SIDL 1 /* Process being created by fork. */
147#define SRUN 2 /* Currently runnable. */
148#define SSLEEP 3 /* Sleeping on an address. */
149#define SSTOP 4 /* Process debugging or suspension. */
150#define SZOMB 5 /* Awaiting collection by parent. */
151
152/* These flags are kept in extern_proc.p_flag. */
153#define P_ADVLOCK 0x00000001 /* Process may hold POSIX adv. lock */
154#define P_CONTROLT 0x00000002 /* Has a controlling terminal */
155#define P_LP64 0x00000004 /* Process is LP64 */
156#define P_NOCLDSTOP 0x00000008 /* No SIGCHLD when children stop */
157
158#define P_PPWAIT 0x00000010 /* Parent waiting for chld exec/exit */
159#define P_PROFIL 0x00000020 /* Has started profiling */
160#define P_SELECT 0x00000040 /* Selecting; wakeup/waiting danger */
161#define P_CONTINUED 0x00000080 /* Process was stopped and continued */
162
163#define P_SUGID 0x00000100 /* Has set privileges since last exec */
164#define P_SYSTEM 0x00000200 /* Sys proc: no sigs, stats or swap */
165#define P_TIMEOUT 0x00000400 /* Timing out during sleep */
166#define P_TRACED 0x00000800 /* Debugged process being traced */
167
168#define P_DISABLE_ASLR 0x00001000 /* Disable address space layout randomization */
169#define P_WEXIT 0x00002000 /* Working on exiting */
170#define P_EXEC 0x00004000 /* Process called exec. */
171
172/* Should be moved to machine-dependent areas. */
173#define P_OWEUPC 0x00008000 /* Owe process an addupc() call at next ast. */
174
175#define P_AFFINITY 0x00010000 /* xxx */
176#define P_TRANSLATED 0x00020000 /* xxx */
177#define P_CLASSIC P_TRANSLATED /* xxx */
178
179#define P_DELAYIDLESLEEP 0x00040000 /* Process is marked to delay idle sleep on disk IO */
180#define P_CHECKOPENEVT 0x00080000 /* check if a vnode has the OPENEVT flag set on open */
181
182#define P_DEPENDENCY_CAPABLE 0x00100000 /* process is ok to call vfs_markdependency() */
183#define P_REBOOT 0x00200000 /* Process called reboot() */
184#define P_RESV6 0x00400000 /* used to be P_TBE */
185#define P_RESV7 0x00800000 /* (P_SIGEXC)signal exceptions */
186
187#define P_THCWD 0x01000000 /* process has thread cwd */
188#define P_RESV9 0x02000000 /* (P_VFORK)process has vfork children */
189#define P_ADOPTPERSONA 0x04000000 /* process adopted a persona (used to be P_NOATTACH) */
190#define P_RESV11 0x08000000 /* (P_INVFORK) proc in vfork */
191
192#define P_NOSHLIB 0x10000000 /* no shared libs are in use for proc */
193 /* flag set on exec */
194#define P_FORCEQUOTA 0x20000000 /* Force quota for root */
195#define P_NOCLDWAIT 0x40000000 /* No zombies when chil procs exit */
196#define P_NOREMOTEHANG 0x80000000 /* Don't hang on remote FS ops */
197
198#define P_INMEM 0 /* Obsolete: retained for compilation */
199#define P_NOSWAP 0 /* Obsolete: retained for compilation */
200#define P_PHYSIO 0 /* Obsolete: retained for compilation */
201#define P_FSTRACE 0 /* Obsolete: retained for compilation */
202#define P_SSTEP 0 /* Obsolete: retained for compilation */
203
204#define P_DIRTY_TRACK 0x00000001 /* track dirty state */
205#define P_DIRTY_ALLOW_IDLE_EXIT 0x00000002 /* process can be idle-exited when clean */
206#define P_DIRTY_DEFER 0x00000004 /* defer initial opt-in to idle-exit */
207#define P_DIRTY 0x00000008 /* process is dirty */
208#define P_DIRTY_SHUTDOWN 0x00000010 /* process is dirty during shutdown */
209#define P_DIRTY_TERMINATED 0x00000020 /* process has been marked for termination */
210#define P_DIRTY_BUSY 0x00000040 /* serialization flag */
211#define P_DIRTY_MARKED 0x00000080 /* marked dirty previously */
212#define P_DIRTY_AGING_IN_PROGRESS 0x00000100 /* aging in one of the 'aging bands' */
213#define P_DIRTY_LAUNCH_IN_PROGRESS 0x00000200 /* launch is in progress */
214#define P_DIRTY_DEFER_ALWAYS 0x00000400 /* defer going to idle-exit after every dirty->clean transition.
215 * For legacy jetsam policy only. This is the default with the other policies.*/
216
217#define P_DIRTY_IS_DIRTY (P_DIRTY | P_DIRTY_SHUTDOWN)
218#define P_DIRTY_IDLE_EXIT_ENABLED (P_DIRTY_TRACK|P_DIRTY_ALLOW_IDLE_EXIT)
219
220
221
222
223#endif /* !_SYS_PROC_H_ */
lib/libc/include/x86_64-macos-gnu/sys/sysctl.h created+775
......@@ -0,0 +1,775 @@
1/*
2 * Copyright (c) 2000-2019 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/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
29/*
30 * Copyright (c) 1989, 1993
31 * The Regents of the University of California. All rights reserved.
32 *
33 * This code is derived from software contributed to Berkeley by
34 * Mike Karels at Berkeley Software Design, Inc.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. All advertising materials mentioning features or use of this software
45 * must display the following acknowledgement:
46 * This product includes software developed by the University of
47 * California, Berkeley and its contributors.
48 * 4. Neither the name of the University nor the names of its contributors
49 * may be used to endorse or promote products derived from this software
50 * without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE.
63 *
64 * @(#)sysctl.h 8.1 (Berkeley) 6/2/93
65 */
66/*
67 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
68 * support for mandatory and extensible security protections. This notice
69 * is included in support of clause 2.2 (b) of the Apple Public License,
70 * Version 2.0.
71 */
72
73#ifndef _SYS_SYSCTL_H_
74#define _SYS_SYSCTL_H_
75
76/*
77 * These are for the eproc structure defined below.
78 */
79#include <sys/cdefs.h>
80
81#include <sys/appleapiopts.h>
82#include <sys/time.h>
83#include <sys/ucred.h>
84#include <sys/proc.h>
85#include <sys/vm.h>
86
87
88/*
89 * Definitions for sysctl call. The sysctl call uses a hierarchical name
90 * for objects that can be examined or modified. The name is expressed as
91 * a sequence of integers. Like a file path name, the meaning of each
92 * component depends on its place in the hierarchy. The top-level and kern
93 * identifiers are defined here, and other identifiers are defined in the
94 * respective subsystem header files.
95 */
96
97#define CTL_MAXNAME 12 /* largest number of components supported */
98
99/*
100 * Each subsystem defined by sysctl defines a list of variables
101 * for that subsystem. Each name is either a node with further
102 * levels defined below it, or it is a leaf of some particular
103 * type given below. Each sysctl level defines a set of name/type
104 * pairs to be used by sysctl(1) in manipulating the subsystem.
105 *
106 * When declaring new sysctl names, use the CTLFLAG_LOCKED flag in the
107 * type to indicate that all necessary locking will be handled
108 * within the sysctl.
109 *
110 * Any sysctl defined without CTLFLAG_LOCKED is considered legacy
111 * and will be protected by a global mutex.
112 *
113 * Note: This is not optimal, so it is best to handle locking
114 * yourself, if you are able to do so. A simple design
115 * pattern for use to avoid in a single function known
116 * to potentially be in the paging path ot doing a DMA
117 * to physical memory in a user space process is:
118 *
119 * lock
120 * perform operation vs. local buffer
121 * unlock
122 * SYSCTL_OUT(rey, local buffer, length)
123 *
124 * ...this assumes you are not using a deep call graph
125 * or are unable to pass a local buffer address as a
126 * parameter into your deep call graph.
127 *
128 * Note that very large user buffers can fail the wire
129 * if to do so would require more physical pages than
130 * are available (the caller will get an ENOMEM error,
131 * see sysctl_mem_hold() for details).
132 */
133struct ctlname {
134 char *ctl_name; /* subsystem name */
135 int ctl_type; /* type of name */
136};
137
138#define CTLTYPE 0xf /* Mask for the type */
139#define CTLTYPE_NODE 1 /* name is a node */
140#define CTLTYPE_INT 2 /* name describes an integer */
141#define CTLTYPE_STRING 3 /* name describes a string */
142#define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
143#define CTLTYPE_OPAQUE 5 /* name describes a structure */
144#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
145
146#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
147#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
148#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
149#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
150#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
151#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
152#define CTLFLAG_MASKED 0x04000000 /* deprecated variable, do not display */
153#define CTLFLAG_NOAUTO 0x02000000 /* do not auto-register */
154#define CTLFLAG_KERN 0x01000000 /* valid inside the kernel */
155#define CTLFLAG_LOCKED 0x00800000 /* node will handle locking itself */
156#define CTLFLAG_OID2 0x00400000 /* struct sysctl_oid has version info */
157
158/*
159 * USE THIS instead of a hardwired number from the categories below
160 * to get dynamically assigned sysctl entries using the linker-set
161 * technology. This is the way nearly all new sysctl variables should
162 * be implemented.
163 *
164 * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
165 *
166 * Note that linker set technology will automatically register all nodes
167 * declared like this on kernel initialization, UNLESS they are defined
168 * in I/O-Kit. In this case, you have to call sysctl_register_oid()
169 * manually - just like in a KEXT.
170 */
171#define OID_AUTO (-1)
172#define OID_AUTO_START 100 /* conventional */
173
174
175#define SYSCTL_DEF_ENABLED
176
177#ifdef SYSCTL_DEF_ENABLED
178/*
179 * Top-level identifiers
180 */
181#define CTL_UNSPEC 0 /* unused */
182#define CTL_KERN 1 /* "high kernel": proc, limits */
183#define CTL_VM 2 /* virtual memory */
184#define CTL_VFS 3 /* file system, mount type is next */
185#define CTL_NET 4 /* network, see socket.h */
186#define CTL_DEBUG 5 /* debugging parameters */
187#define CTL_HW 6 /* generic cpu/io */
188#define CTL_MACHDEP 7 /* machine dependent */
189#define CTL_USER 8 /* user-level */
190#define CTL_MAXID 9 /* number of valid top-level ids */
191
192#define CTL_NAMES { \
193 { 0, 0 }, \
194 { "kern", CTLTYPE_NODE }, \
195 { "vm", CTLTYPE_NODE }, \
196 { "vfs", CTLTYPE_NODE }, \
197 { "net", CTLTYPE_NODE }, \
198 { "debug", CTLTYPE_NODE }, \
199 { "hw", CTLTYPE_NODE }, \
200 { "machdep", CTLTYPE_NODE }, \
201 { "user", CTLTYPE_NODE }, \
202}
203
204/*
205 * CTL_KERN identifiers
206 */
207#define KERN_OSTYPE 1 /* string: system version */
208#define KERN_OSRELEASE 2 /* string: system release */
209#define KERN_OSREV 3 /* int: system revision */
210#define KERN_VERSION 4 /* string: compile time info */
211#define KERN_MAXVNODES 5 /* int: max vnodes */
212#define KERN_MAXPROC 6 /* int: max processes */
213#define KERN_MAXFILES 7 /* int: max open files */
214#define KERN_ARGMAX 8 /* int: max arguments to exec */
215#define KERN_SECURELVL 9 /* int: system security level */
216#define KERN_HOSTNAME 10 /* string: hostname */
217#define KERN_HOSTID 11 /* int: host identifier */
218#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
219#define KERN_VNODE 13 /* struct: vnode structures */
220#define KERN_PROC 14 /* struct: process entries */
221#define KERN_FILE 15 /* struct: file entries */
222#define KERN_PROF 16 /* node: kernel profiling info */
223#define KERN_POSIX1 17 /* int: POSIX.1 version */
224#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
225#define KERN_JOB_CONTROL 19 /* int: is job control available */
226#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
227#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
228#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
229#define KERN_DOMAINNAME KERN_NISDOMAINNAME
230#define KERN_MAXPARTITIONS 23 /* int: number of partitions/disk */
231#define KERN_KDEBUG 24 /* int: kernel trace points */
232#define KERN_UPDATEINTERVAL 25 /* int: update process sleep time */
233#define KERN_OSRELDATE 26 /* int: OS release date */
234#define KERN_NTP_PLL 27 /* node: NTP PLL control */
235#define KERN_BOOTFILE 28 /* string: name of booted kernel */
236#define KERN_MAXFILESPERPROC 29 /* int: max open files per proc */
237#define KERN_MAXPROCPERUID 30 /* int: max processes per uid */
238#define KERN_DUMPDEV 31 /* dev_t: device to dump on */
239#define KERN_IPC 32 /* node: anything related to IPC */
240#define KERN_DUMMY 33 /* unused */
241#define KERN_PS_STRINGS 34 /* int: address of PS_STRINGS */
242#define KERN_USRSTACK32 35 /* int: address of USRSTACK */
243#define KERN_LOGSIGEXIT 36 /* int: do we log sigexit procs? */
244#define KERN_SYMFILE 37 /* string: kernel symbol filename */
245#define KERN_PROCARGS 38
246/* 39 was KERN_PCSAMPLES... now obsolete */
247#define KERN_NETBOOT 40 /* int: are we netbooted? 1=yes,0=no */
248/* 41 was KERN_PANICINFO : panic UI information (deprecated) */
249#define KERN_SYSV 42 /* node: System V IPC information */
250#define KERN_AFFINITY 43 /* xxx */
251#define KERN_TRANSLATE 44 /* xxx */
252#define KERN_CLASSIC KERN_TRANSLATE /* XXX backwards compat */
253#define KERN_EXEC 45 /* xxx */
254#define KERN_CLASSICHANDLER KERN_EXEC /* XXX backwards compatibility */
255#define KERN_AIOMAX 46 /* int: max aio requests */
256#define KERN_AIOPROCMAX 47 /* int: max aio requests per process */
257#define KERN_AIOTHREADS 48 /* int: max aio worker threads */
258#ifdef __APPLE_API_UNSTABLE
259#define KERN_PROCARGS2 49
260#endif /* __APPLE_API_UNSTABLE */
261#define KERN_COREFILE 50 /* string: corefile format string */
262#define KERN_COREDUMP 51 /* int: whether to coredump at all */
263#define KERN_SUGID_COREDUMP 52 /* int: whether to dump SUGID cores */
264#define KERN_PROCDELAYTERM 53 /* int: set/reset current proc for delayed termination during shutdown */
265#define KERN_SHREG_PRIVATIZABLE 54 /* int: can shared regions be privatized ? */
266/* 55 was KERN_PROC_LOW_PRI_IO... now deprecated */
267#define KERN_LOW_PRI_WINDOW 56 /* int: set/reset throttle window - milliseconds */
268#define KERN_LOW_PRI_DELAY 57 /* int: set/reset throttle delay - milliseconds */
269#define KERN_POSIX 58 /* node: posix tunables */
270#define KERN_USRSTACK64 59 /* LP64 user stack query */
271#define KERN_NX_PROTECTION 60 /* int: whether no-execute protection is enabled */
272#define KERN_TFP 61 /* Task for pid settings */
273#define KERN_PROCNAME 62 /* setup process program name(2*MAXCOMLEN) */
274#define KERN_THALTSTACK 63 /* for compat with older x86 and does nothing */
275#define KERN_SPECULATIVE_READS 64 /* int: whether speculative reads are disabled */
276#define KERN_OSVERSION 65 /* for build number i.e. 9A127 */
277#define KERN_SAFEBOOT 66 /* are we booted safe? */
278/* 67 was KERN_LCTX (login context) */
279#define KERN_RAGEVNODE 68
280#define KERN_TTY 69 /* node: tty settings */
281#define KERN_CHECKOPENEVT 70 /* spi: check the VOPENEVT flag on vnodes at open time */
282#define KERN_THREADNAME 71 /* set/get thread name */
283#define KERN_MAXID 72 /* number of valid kern ids */
284/*
285 * Don't add any more sysctls like this. Instead, use the SYSCTL_*() macros
286 * and OID_AUTO. This will have the added benefit of not having to recompile
287 * sysctl(8) to pick up your changes.
288 */
289
290
291#if defined(__LP64__)
292#define KERN_USRSTACK KERN_USRSTACK64
293#else
294#define KERN_USRSTACK KERN_USRSTACK32
295#endif
296
297
298/* KERN_RAGEVNODE types */
299#define KERN_RAGE_PROC 1
300#define KERN_RAGE_THREAD 2
301#define KERN_UNRAGE_PROC 3
302#define KERN_UNRAGE_THREAD 4
303
304/* KERN_OPENEVT types */
305#define KERN_OPENEVT_PROC 1
306#define KERN_UNOPENEVT_PROC 2
307
308/* KERN_TFP types */
309#define KERN_TFP_POLICY 1
310
311/* KERN_TFP_POLICY values . All policies allow task port for self */
312#define KERN_TFP_POLICY_DENY 0 /* Deny Mode: None allowed except privileged */
313#define KERN_TFP_POLICY_DEFAULT 2 /* Default Mode: related ones allowed and upcall authentication */
314
315/* KERN_KDEBUG types */
316#define KERN_KDEFLAGS 1
317#define KERN_KDDFLAGS 2
318#define KERN_KDENABLE 3
319#define KERN_KDSETBUF 4
320#define KERN_KDGETBUF 5
321#define KERN_KDSETUP 6
322#define KERN_KDREMOVE 7
323#define KERN_KDSETREG 8
324#define KERN_KDGETREG 9
325#define KERN_KDREADTR 10
326#define KERN_KDPIDTR 11
327#define KERN_KDTHRMAP 12
328/* Don't use 13 as it is overloaded with KERN_VNODE */
329#define KERN_KDPIDEX 14
330#define KERN_KDSETRTCDEC 15 /* obsolete */
331#define KERN_KDGETENTROPY 16 /* obsolete */
332#define KERN_KDWRITETR 17
333#define KERN_KDWRITEMAP 18
334#define KERN_KDTEST 19
335/* 20 unused */
336#define KERN_KDREADCURTHRMAP 21
337#define KERN_KDSET_TYPEFILTER 22
338#define KERN_KDBUFWAIT 23
339#define KERN_KDCPUMAP 24
340/* 25 - 26 unused */
341#define KERN_KDWRITEMAP_V3 27
342#define KERN_KDWRITETR_V3 28
343
344#define CTL_KERN_NAMES { \
345 { 0, 0 }, \
346 { "ostype", CTLTYPE_STRING }, \
347 { "osrelease", CTLTYPE_STRING }, \
348 { "osrevision", CTLTYPE_INT }, \
349 { "version", CTLTYPE_STRING }, \
350 { "maxvnodes", CTLTYPE_INT }, \
351 { "maxproc", CTLTYPE_INT }, \
352 { "maxfiles", CTLTYPE_INT }, \
353 { "argmax", CTLTYPE_INT }, \
354 { "securelevel", CTLTYPE_INT }, \
355 { "hostname", CTLTYPE_STRING }, \
356 { "hostid", CTLTYPE_INT }, \
357 { "clockrate", CTLTYPE_STRUCT }, \
358 { "vnode", CTLTYPE_STRUCT }, \
359 { "proc", CTLTYPE_STRUCT }, \
360 { "file", CTLTYPE_STRUCT }, \
361 { "profiling", CTLTYPE_NODE }, \
362 { "posix1version", CTLTYPE_INT }, \
363 { "ngroups", CTLTYPE_INT }, \
364 { "job_control", CTLTYPE_INT }, \
365 { "saved_ids", CTLTYPE_INT }, \
366 { "boottime", CTLTYPE_STRUCT }, \
367 { "nisdomainname", CTLTYPE_STRING }, \
368 { "maxpartitions", CTLTYPE_INT }, \
369 { "kdebug", CTLTYPE_INT }, \
370 { "update", CTLTYPE_INT }, \
371 { "osreldate", CTLTYPE_INT }, \
372 { "ntp_pll", CTLTYPE_NODE }, \
373 { "bootfile", CTLTYPE_STRING }, \
374 { "maxfilesperproc", CTLTYPE_INT }, \
375 { "maxprocperuid", CTLTYPE_INT }, \
376 { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \
377 { "ipc", CTLTYPE_NODE }, \
378 { "dummy", CTLTYPE_INT }, \
379 { "dummy", CTLTYPE_INT }, \
380 { "usrstack", CTLTYPE_INT }, \
381 { "logsigexit", CTLTYPE_INT }, \
382 { "symfile",CTLTYPE_STRING },\
383 { "procargs",CTLTYPE_STRUCT },\
384 { "dummy", CTLTYPE_INT }, /* deprecated pcsamples */ \
385 { "netboot", CTLTYPE_INT }, \
386 { "dummy", CTLTYPE_INT }, /* deprecated: panicinfo */ \
387 { "sysv", CTLTYPE_NODE }, \
388 { "dummy", CTLTYPE_INT }, \
389 { "dummy", CTLTYPE_INT }, \
390 { "exec", CTLTYPE_NODE }, \
391 { "aiomax", CTLTYPE_INT }, \
392 { "aioprocmax", CTLTYPE_INT }, \
393 { "aiothreads", CTLTYPE_INT }, \
394 { "procargs2",CTLTYPE_STRUCT }, \
395 { "corefile",CTLTYPE_STRING }, \
396 { "coredump", CTLTYPE_INT }, \
397 { "sugid_coredump", CTLTYPE_INT }, \
398 { "delayterm", CTLTYPE_INT }, \
399 { "shreg_private", CTLTYPE_INT }, \
400 { "proc_low_pri_io", CTLTYPE_INT }, \
401 { "low_pri_window", CTLTYPE_INT }, \
402 { "low_pri_delay", CTLTYPE_INT }, \
403 { "posix", CTLTYPE_NODE }, \
404 { "usrstack64", CTLTYPE_QUAD }, \
405 { "nx", CTLTYPE_INT }, \
406 { "tfp", CTLTYPE_NODE }, \
407 { "procname", CTLTYPE_STRING }, \
408 { "threadsigaltstack", CTLTYPE_INT }, \
409 { "speculative_reads_disabled", CTLTYPE_INT }, \
410 { "osversion", CTLTYPE_STRING }, \
411 { "safeboot", CTLTYPE_INT }, \
412 { "dummy", CTLTYPE_INT }, /* deprecated: lctx */ \
413 { "rage_vnode", CTLTYPE_INT }, \
414 { "tty", CTLTYPE_NODE }, \
415 { "check_openevt", CTLTYPE_INT }, \
416 { "thread_name", CTLTYPE_STRING } \
417}
418
419/*
420 * CTL_VFS identifiers
421 */
422#define CTL_VFS_NAMES { \
423 { "vfsconf", CTLTYPE_STRUCT } \
424}
425
426/*
427 * KERN_PROC subtypes
428 */
429#define KERN_PROC_ALL 0 /* everything */
430#define KERN_PROC_PID 1 /* by process id */
431#define KERN_PROC_PGRP 2 /* by process group id */
432#define KERN_PROC_SESSION 3 /* by session of pid */
433#define KERN_PROC_TTY 4 /* by controlling tty */
434#define KERN_PROC_UID 5 /* by effective uid */
435#define KERN_PROC_RUID 6 /* by real uid */
436#define KERN_PROC_LCID 7 /* by login context id */
437
438/*
439 * KERN_VFSNSPACE subtypes
440 */
441#define KERN_VFSNSPACE_HANDLE_PROC 1
442#define KERN_VFSNSPACE_UNHANDLE_PROC 2
443
444/*
445 * KERN_PROC subtype ops return arrays of augmented proc structures:
446 */
447
448struct _pcred {
449 char pc_lock[72]; /* opaque content */
450 struct ucred *pc_ucred; /* Current credentials. */
451 uid_t p_ruid; /* Real user id. */
452 uid_t p_svuid; /* Saved effective user id. */
453 gid_t p_rgid; /* Real group id. */
454 gid_t p_svgid; /* Saved effective group id. */
455 int p_refcnt; /* Number of references. */
456};
457
458struct _ucred {
459 int32_t cr_ref; /* reference count */
460 uid_t cr_uid; /* effective user id */
461 short cr_ngroups; /* number of groups */
462 gid_t cr_groups[NGROUPS]; /* groups */
463};
464
465struct kinfo_proc {
466 struct extern_proc kp_proc; /* proc structure */
467 struct eproc {
468 struct proc *e_paddr; /* address of proc */
469 struct session *e_sess; /* session pointer */
470 struct _pcred e_pcred; /* process credentials */
471 struct _ucred e_ucred; /* current credentials */
472 struct vmspace e_vm; /* address space */
473 pid_t e_ppid; /* parent process id */
474 pid_t e_pgid; /* process group id */
475 short e_jobc; /* job control counter */
476 dev_t e_tdev; /* controlling tty dev */
477 pid_t e_tpgid; /* tty process group id */
478 struct session *e_tsess; /* tty session pointer */
479#define WMESGLEN 7
480 char e_wmesg[WMESGLEN + 1]; /* wchan message */
481 segsz_t e_xsize; /* text size */
482 short e_xrssize; /* text rss */
483 short e_xccount; /* text references */
484 short e_xswrss;
485 int32_t e_flag;
486#define EPROC_CTTY 0x01 /* controlling tty vnode active */
487#define EPROC_SLEADER 0x02 /* session leader */
488#define COMAPT_MAXLOGNAME 12
489 char e_login[COMAPT_MAXLOGNAME]; /* short setlogin() name */
490 int32_t e_spare[4];
491 } kp_eproc;
492};
493
494
495
496/*
497 * KERN_IPC identifiers
498 */
499#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
500#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */
501#define KIPC_SOMAXCONN 3 /* int: max length of connection q */
502#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */
503#define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */
504#define KIPC_MAX_HDR 6 /* int: max total length of headers */
505#define KIPC_MAX_DATALEN 7 /* int: max length of data? */
506#define KIPC_MBSTAT 8 /* struct: mbuf usage statistics */
507#define KIPC_NMBCLUSTERS 9 /* int: maximum mbuf clusters */
508#define KIPC_SOQLIMITCOMPAT 10 /* int: socket queue limit */
509
510/*
511 * CTL_VM identifiers
512 */
513#define VM_METER 1 /* struct vmmeter */
514#define VM_LOADAVG 2 /* struct loadavg */
515/*
516 * Note: "3" was skipped sometime ago and should probably remain unused
517 * to avoid any new entry from being accepted by older kernels...
518 */
519#define VM_MACHFACTOR 4 /* struct loadavg with mach factor*/
520#define VM_SWAPUSAGE 5 /* total swap usage */
521#define VM_MAXID 6 /* number of valid vm ids */
522
523#define CTL_VM_NAMES { \
524 { 0, 0 }, \
525 { "vmmeter", CTLTYPE_STRUCT }, \
526 { "loadavg", CTLTYPE_STRUCT }, \
527 { 0, 0 }, /* placeholder for "3" (see comment above) */ \
528 { "dummy", CTLTYPE_INT }, \
529 { "swapusage", CTLTYPE_STRUCT } \
530}
531
532struct xsw_usage {
533 u_int64_t xsu_total;
534 u_int64_t xsu_avail;
535 u_int64_t xsu_used;
536 u_int32_t xsu_pagesize;
537 boolean_t xsu_encrypted;
538};
539
540#ifdef __APPLE_API_PRIVATE
541/* Load average structure. Use of fixpt_t assume <sys/types.h> in scope. */
542/* XXX perhaps we should protect fixpt_t, and define it here (or discard it) */
543struct loadavg {
544 fixpt_t ldavg[3];
545 long fscale;
546};
547extern struct loadavg averunnable;
548#define LSCALE 1000 /* scaling for "fixed point" arithmetic */
549
550#endif /* __APPLE_API_PRIVATE */
551
552
553/*
554 * CTL_HW identifiers
555 */
556#define HW_MACHINE 1 /* string: machine class */
557#define HW_MODEL 2 /* string: specific machine model */
558#define HW_NCPU 3 /* int: number of cpus */
559#define HW_BYTEORDER 4 /* int: machine byte order */
560#define HW_PHYSMEM 5 /* int: total memory */
561#define HW_USERMEM 6 /* int: non-kernel memory */
562#define HW_PAGESIZE 7 /* int: software page size */
563#define HW_DISKNAMES 8 /* strings: disk drive names */
564#define HW_DISKSTATS 9 /* struct: diskstats[] */
565#define HW_EPOCH 10 /* int: 0 for Legacy, else NewWorld */
566#define HW_FLOATINGPT 11 /* int: has HW floating point? */
567#define HW_MACHINE_ARCH 12 /* string: machine architecture */
568#define HW_VECTORUNIT 13 /* int: has HW vector unit? */
569#define HW_BUS_FREQ 14 /* int: Bus Frequency */
570#define HW_CPU_FREQ 15 /* int: CPU Frequency */
571#define HW_CACHELINE 16 /* int: Cache Line Size in Bytes */
572#define HW_L1ICACHESIZE 17 /* int: L1 I Cache Size in Bytes */
573#define HW_L1DCACHESIZE 18 /* int: L1 D Cache Size in Bytes */
574#define HW_L2SETTINGS 19 /* int: L2 Cache Settings */
575#define HW_L2CACHESIZE 20 /* int: L2 Cache Size in Bytes */
576#define HW_L3SETTINGS 21 /* int: L3 Cache Settings */
577#define HW_L3CACHESIZE 22 /* int: L3 Cache Size in Bytes */
578#define HW_TB_FREQ 23 /* int: Bus Frequency */
579#define HW_MEMSIZE 24 /* uint64_t: physical ram size */
580#define HW_AVAILCPU 25 /* int: number of available CPUs */
581#define HW_MAXID 26 /* number of valid hw ids */
582
583#define CTL_HW_NAMES { \
584 { 0, 0 }, \
585 { "machine", CTLTYPE_STRING }, \
586 { "model", CTLTYPE_STRING }, \
587 { "ncpu", CTLTYPE_INT }, \
588 { "byteorder", CTLTYPE_INT }, \
589 { "physmem", CTLTYPE_INT }, \
590 { "usermem", CTLTYPE_INT }, \
591 { "pagesize", CTLTYPE_INT }, \
592 { "disknames", CTLTYPE_STRUCT }, \
593 { "diskstats", CTLTYPE_STRUCT }, \
594 { "epoch", CTLTYPE_INT }, \
595 { "floatingpoint", CTLTYPE_INT }, \
596 { "machinearch", CTLTYPE_STRING }, \
597 { "vectorunit", CTLTYPE_INT }, \
598 { "busfrequency", CTLTYPE_INT }, \
599 { "cpufrequency", CTLTYPE_INT }, \
600 { "cachelinesize", CTLTYPE_INT }, \
601 { "l1icachesize", CTLTYPE_INT }, \
602 { "l1dcachesize", CTLTYPE_INT }, \
603 { "l2settings", CTLTYPE_INT }, \
604 { "l2cachesize", CTLTYPE_INT }, \
605 { "l3settings", CTLTYPE_INT }, \
606 { "l3cachesize", CTLTYPE_INT }, \
607 { "tbfrequency", CTLTYPE_INT }, \
608 { "memsize", CTLTYPE_QUAD }, \
609 { "availcpu", CTLTYPE_INT } \
610}
611
612/*
613 * XXX This information should be moved to the man page.
614 *
615 * These are the support HW selectors for sysctlbyname. Parameters that are byte counts or frequencies are 64 bit numbers.
616 * All other parameters are 32 bit numbers.
617 *
618 * hw.memsize - The number of bytes of physical memory in the system.
619 *
620 * hw.ncpu - The maximum number of processors that could be available this boot.
621 * Use this value for sizing of static per processor arrays; i.e. processor load statistics.
622 *
623 * hw.activecpu - The number of processors currently available for executing threads.
624 * Use this number to determine the number threads to create in SMP aware applications.
625 * This number can change when power management modes are changed.
626 *
627 * hw.physicalcpu - The number of physical processors available in the current power management mode.
628 * hw.physicalcpu_max - The maximum number of physical processors that could be available this boot
629 *
630 * hw.logicalcpu - The number of logical processors available in the current power management mode.
631 * hw.logicalcpu_max - The maximum number of logical processors that could be available this boot
632 *
633 * hw.tbfrequency - This gives the time base frequency used by the OS and is the basis of all timing services.
634 * In general is is better to use mach's or higher level timing services, but this value
635 * is needed to convert the PPC Time Base registers to real time.
636 *
637 * hw.cpufrequency - These values provide the current, min and max cpu frequency. The min and max are for
638 * hw.cpufrequency_max - all power management modes. The current frequency is the max frequency in the current mode.
639 * hw.cpufrequency_min - All frequencies are in Hz.
640 *
641 * hw.busfrequency - These values provide the current, min and max bus frequency. The min and max are for
642 * hw.busfrequency_max - all power management modes. The current frequency is the max frequency in the current mode.
643 * hw.busfrequency_min - All frequencies are in Hz.
644 *
645 * hw.cputype - These values provide the mach-o cpu type and subtype. A complete list is in <mach/machine.h>
646 * hw.cpusubtype - These values should be used to determine what processor family the running cpu is from so that
647 * the best binary can be chosen, or the best dynamic code generated. They should not be used
648 * to determine if a given processor feature is available.
649 * hw.cputhreadtype - This value will be present if the processor supports threads. Like hw.cpusubtype this selector
650 * should not be used to infer features, and only used to name the processors thread architecture.
651 * The values are defined in <mach/machine.h>
652 *
653 * hw.byteorder - Gives the byte order of the processor. 4321 for big endian, 1234 for little.
654 *
655 * hw.pagesize - Gives the size in bytes of the pages used by the processor and VM system.
656 *
657 * hw.cachelinesize - Gives the size in bytes of the processor's cache lines.
658 * This value should be use to control the strides of loops that use cache control instructions
659 * like dcbz, dcbt or dcbst.
660 *
661 * hw.l1dcachesize - These values provide the size in bytes of the L1, L2 and L3 caches. If a cache is not present
662 * hw.l1icachesize - then the selector will return and error.
663 * hw.l2cachesize -
664 * hw.l3cachesize -
665 *
666 * hw.packages - Gives the number of processor packages.
667 *
668 * These are the selectors for optional processor features for specific processors. Selectors that return errors are not support
669 * on the system. Supported features will return 1 if they are recommended or 0 if they are supported but are not expected to help .
670 * performance. Future versions of these selectors may return larger values as necessary so it is best to test for non zero.
671 *
672 * For PowerPC:
673 *
674 * hw.optional.floatingpoint - Floating Point Instructions
675 * hw.optional.altivec - AltiVec Instructions
676 * hw.optional.graphicsops - Graphics Operations
677 * hw.optional.64bitops - 64-bit Instructions
678 * hw.optional.fsqrt - HW Floating Point Square Root Instruction
679 * hw.optional.stfiwx - Store Floating Point as Integer Word Indexed Instructions
680 * hw.optional.dcba - Data Cache Block Allocate Instruction
681 * hw.optional.datastreams - Data Streams Instructions
682 * hw.optional.dcbtstreams - Data Cache Block Touch Steams Instruction Form
683 *
684 * For x86 Architecture:
685 *
686 * hw.optional.floatingpoint - Floating Point Instructions
687 * hw.optional.mmx - Original MMX vector instructions
688 * hw.optional.sse - Streaming SIMD Extensions
689 * hw.optional.sse2 - Streaming SIMD Extensions 2
690 * hw.optional.sse3 - Streaming SIMD Extensions 3
691 * hw.optional.supplementalsse3 - Supplemental Streaming SIMD Extensions 3
692 * hw.optional.x86_64 - 64-bit support
693 */
694
695
696/*
697 * CTL_USER definitions
698 */
699#define USER_CS_PATH 1 /* string: _CS_PATH */
700#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
701#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
702#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
703#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
704#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
705#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
706#define USER_LINE_MAX 8 /* int: LINE_MAX */
707#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
708#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
709#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
710#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
711#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
712#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
713#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
714#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
715#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
716#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
717#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
718#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
719#define USER_MAXID 21 /* number of valid user ids */
720
721#define CTL_USER_NAMES { \
722 { 0, 0 }, \
723 { "cs_path", CTLTYPE_STRING }, \
724 { "bc_base_max", CTLTYPE_INT }, \
725 { "bc_dim_max", CTLTYPE_INT }, \
726 { "bc_scale_max", CTLTYPE_INT }, \
727 { "bc_string_max", CTLTYPE_INT }, \
728 { "coll_weights_max", CTLTYPE_INT }, \
729 { "expr_nest_max", CTLTYPE_INT }, \
730 { "line_max", CTLTYPE_INT }, \
731 { "re_dup_max", CTLTYPE_INT }, \
732 { "posix2_version", CTLTYPE_INT }, \
733 { "posix2_c_bind", CTLTYPE_INT }, \
734 { "posix2_c_dev", CTLTYPE_INT }, \
735 { "posix2_char_term", CTLTYPE_INT }, \
736 { "posix2_fort_dev", CTLTYPE_INT }, \
737 { "posix2_fort_run", CTLTYPE_INT }, \
738 { "posix2_localedef", CTLTYPE_INT }, \
739 { "posix2_sw_dev", CTLTYPE_INT }, \
740 { "posix2_upe", CTLTYPE_INT }, \
741 { "stream_max", CTLTYPE_INT }, \
742 { "tzname_max", CTLTYPE_INT } \
743}
744
745
746
747/*
748 * CTL_DEBUG definitions
749 *
750 * Second level identifier specifies which debug variable.
751 * Third level identifier specifies which stucture component.
752 */
753#define CTL_DEBUG_NAME 0 /* string: variable name */
754#define CTL_DEBUG_VALUE 1 /* int: variable value */
755#define CTL_DEBUG_MAXID 20
756
757
758#if (CTL_MAXID != 9) || (KERN_MAXID != 72) || (VM_MAXID != 6) || (HW_MAXID != 26) || (USER_MAXID != 21) || (CTL_DEBUG_MAXID != 20)
759#error Use the SYSCTL_*() macros and OID_AUTO instead!
760#endif
761
762
763
764__BEGIN_DECLS
765int sysctl(int *, u_int, void *, size_t *, void *, size_t);
766int sysctlbyname(const char *, void *, size_t *, void *, size_t);
767int sysctlnametomib(const char *, int *, size_t *);
768__END_DECLS
769
770
771
772#endif /* SYSCTL_DEF_ENABLED */
773
774
775#endif /* !_SYS_SYSCTL_H_ */
lib/libc/include/x86_64-macos-gnu/sys/ucred.h created+116
......@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) 2000-2004 Apple Computer, 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/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */
29/*
30 * Copyright (c) 1989, 1993
31 * The Regents of the University of California. All rights reserved.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 * must display the following acknowledgement:
43 * This product includes software developed by the University of
44 * California, Berkeley and its contributors.
45 * 4. Neither the name of the University nor the names of its contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 * SUCH DAMAGE.
60 *
61 * @(#)ucred.h 8.4 (Berkeley) 1/9/95
62 */
63/*
64 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
65 * support for mandatory and extensible security protections. This notice
66 * is included in support of clause 2.2 (b) of the Apple Public License,
67 * Version 2.0.
68 */
69
70#ifndef _SYS_UCRED_H_
71#define _SYS_UCRED_H_
72
73#include <sys/appleapiopts.h>
74#include <sys/cdefs.h>
75#include <sys/param.h>
76#include <bsm/audit.h>
77
78struct label;
79
80#ifdef __APPLE_API_UNSTABLE
81struct ucred;
82struct posix_cred;
83
84#ifndef _KAUTH_CRED_T
85#define _KAUTH_CRED_T
86typedef struct ucred *kauth_cred_t;
87typedef struct posix_cred *posix_cred_t;
88#endif /* !_KAUTH_CRED_T */
89
90/*
91 * Credential flags that can be set on a credential
92 */
93#define CRF_NOMEMBERD 0x00000001 /* memberd opt out by setgroups() */
94#define CRF_MAC_ENFORCE 0x00000002 /* force entry through MAC Framework */
95 /* also forces credential cache miss */
96
97/*
98 * This is the external representation of struct ucred.
99 */
100struct xucred {
101 u_int cr_version; /* structure layout version */
102 uid_t cr_uid; /* effective user id */
103 short cr_ngroups; /* number of advisory groups */
104 gid_t cr_groups[NGROUPS]; /* advisory group list */
105};
106#define XUCRED_VERSION 0
107
108#define cr_gid cr_groups[0]
109#define NOCRED ((kauth_cred_t )0) /* no credential available */
110#define FSCRED ((kauth_cred_t )-1) /* filesystem credential */
111
112#define IS_VALID_CRED(_cr) ((_cr) != NOCRED && (_cr) != FSCRED)
113
114#endif /* __APPLE_API_UNSTABLE */
115
116#endif /* !_SYS_UCRED_H_ */
lib/libc/include/x86_64-macos-gnu/sys/vm.h created+89
......@@ -0,0 +1,89 @@
1/*
2 * Copyright (c) 2000-2006 Apple Computer, 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/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
29/*
30 * Copyright (c) 1991, 1993
31 * The Regents of the University of California. All rights reserved.
32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 * must display the following acknowledgement:
43 * This product includes software developed by the University of
44 * California, Berkeley and its contributors.
45 * 4. Neither the name of the University nor the names of its contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 * SUCH DAMAGE.
60 *
61 * @(#)vm.h 8.5 (Berkeley) 5/11/95
62 */
63/* HISTORY
64 * 05-Jun-95 Mac Gillon (mgillon) at NeXT
65 * 4.4 code uses this file to import MACH API
66 */
67
68#ifndef _SYS_VM_H
69#define _SYS_VM_H
70
71#include <sys/appleapiopts.h>
72#include <sys/cdefs.h>
73
74
75#include <sys/_types/_caddr_t.h> /* caddr_t */
76#include <sys/_types/_int32_t.h> /* int32_t */
77
78/* just to keep kinfo_proc happy */
79/* NOTE: Pointer fields are size variant for LP64 */
80struct vmspace {
81 int32_t dummy;
82 caddr_t dummy2;
83 int32_t dummy3[5];
84 caddr_t dummy4[3];
85};
86
87
88
89#endif /* _SYS_VM_H */