xref: /xnu-10063.121.3/libsyscall/wrappers/spawn/spawn_private.h (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1*2c2f96dcSApple OSS Distributions /*
2*2c2f96dcSApple OSS Distributions  * Copyright (c) 2006, 2008 Apple,Inc. All rights reserved.
3*2c2f96dcSApple OSS Distributions  *
4*2c2f96dcSApple OSS Distributions  * @APPLE_LICENSE_HEADER_START@
5*2c2f96dcSApple OSS Distributions  *
6*2c2f96dcSApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*2c2f96dcSApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*2c2f96dcSApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*2c2f96dcSApple OSS Distributions  * compliance with the License. Please obtain a copy of the License at
10*2c2f96dcSApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this
11*2c2f96dcSApple OSS Distributions  * file.
12*2c2f96dcSApple OSS Distributions  *
13*2c2f96dcSApple OSS Distributions  * The Original Code and all software distributed under the License are
14*2c2f96dcSApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15*2c2f96dcSApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16*2c2f96dcSApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17*2c2f96dcSApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18*2c2f96dcSApple OSS Distributions  * Please see the License for the specific language governing rights and
19*2c2f96dcSApple OSS Distributions  * limitations under the License.
20*2c2f96dcSApple OSS Distributions  *
21*2c2f96dcSApple OSS Distributions  * @APPLE_LICENSE_HEADER_END@
22*2c2f96dcSApple OSS Distributions  */
23*2c2f96dcSApple OSS Distributions 
24*2c2f96dcSApple OSS Distributions #ifndef _SPAWN_PRIVATE_H_
25*2c2f96dcSApple OSS Distributions #define _SPAWN_PRIVATE_H_
26*2c2f96dcSApple OSS Distributions 
27*2c2f96dcSApple OSS Distributions #include <spawn.h>
28*2c2f96dcSApple OSS Distributions #include <sys/cdefs.h>
29*2c2f96dcSApple OSS Distributions #include <sys/types.h>
30*2c2f96dcSApple OSS Distributions #include <Availability.h>
31*2c2f96dcSApple OSS Distributions #include <TargetConditionals.h>
32*2c2f96dcSApple OSS Distributions 
33*2c2f96dcSApple OSS Distributions __BEGIN_DECLS
34*2c2f96dcSApple OSS Distributions 
35*2c2f96dcSApple OSS Distributions int     posix_spawnattr_getpcontrol_np(const posix_spawnattr_t * __restrict, int * __restrict) __API_AVAILABLE(macos(10.6), ios(3.2));
36*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setpcontrol_np(posix_spawnattr_t *, const int) __API_AVAILABLE(macos(10.6), ios(3.2));
37*2c2f96dcSApple OSS Distributions 
38*2c2f96dcSApple OSS Distributions int     posix_spawnattr_getprocesstype_np(const posix_spawnattr_t * __restrict, int * __restrict) __API_AVAILABLE(macos(10.8), ios(6.0));
39*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setprocesstype_np(posix_spawnattr_t *, const int) __API_AVAILABLE(macos(10.8), ios(6.0));
40*2c2f96dcSApple OSS Distributions 
41*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setcpumonitor(posix_spawnattr_t * __restrict, uint64_t, uint64_t) __API_AVAILABLE(macos(10.8), ios(6.0));
42*2c2f96dcSApple OSS Distributions int     posix_spawnattr_getcpumonitor(posix_spawnattr_t * __restrict, uint64_t *, uint64_t *) __API_AVAILABLE(macos(10.8), ios(6.0));
43*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setcpumonitor_default(posix_spawnattr_t * __restrict) __API_AVAILABLE(macos(10.9), ios(6.0));
44*2c2f96dcSApple OSS Distributions 
45*2c2f96dcSApple OSS Distributions #if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
46*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setjetsam(posix_spawnattr_t * __restrict attr,
47*2c2f96dcSApple OSS Distributions     short flags, int priority, int memlimit) __API_UNAVAILABLE(macos) __API_AVAILABLE(ios(5.0));
48*2c2f96dcSApple OSS Distributions #endif /* (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) */
49*2c2f96dcSApple OSS Distributions 
50*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setjetsam_ext(posix_spawnattr_t * __restrict attr,
51*2c2f96dcSApple OSS Distributions     short flags, int priority, int memlimit_active, int memlimit_inactive) __API_AVAILABLE(macos(10.11), ios(9.0));
52*2c2f96dcSApple OSS Distributions 
53*2c2f96dcSApple OSS Distributions // time-to-relaunch after jetsam, set by launchd
54*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_jetsam_ttr_np(const posix_spawnattr_t * __restrict attr, uint32_t count, uint32_t *ttrs_millis) __OSX_AVAILABLE_STARTING(__MAC_10_15, __IPHONE_13_0);
55*2c2f96dcSApple OSS Distributions 
56*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_threadlimit_ext(posix_spawnattr_t * __restrict attr,
57*2c2f96dcSApple OSS Distributions     int thread_limit)  __API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
58*2c2f96dcSApple OSS Distributions 
59*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_portlimits_ext(posix_spawnattr_t * __restrict attr,
60*2c2f96dcSApple OSS Distributions     uint32_t port_soft_limit, uint32_t port_hard_limit)  __API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0));
61*2c2f96dcSApple OSS Distributions 
62*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_filedesclimit_ext(posix_spawnattr_t * __restrict attr,
63*2c2f96dcSApple OSS Distributions     uint32_t filedesc_soft_limit, uint32_t filedesc_hard_limit)  __API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0));
64*2c2f96dcSApple OSS Distributions 
65*2c2f96dcSApple OSS Distributions #define POSIX_SPAWN_IMPORTANCE_PORT_COUNT 128
66*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_kqworklooplimit_ext(posix_spawnattr_t * __restrict attr,
67*2c2f96dcSApple OSS Distributions     uint32_t kqwl_soft_limit, uint32_t kqwl_hard_limit) __API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), watchos(10.4));
68*2c2f96dcSApple OSS Distributions 
69*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_importancewatch_port_np(posix_spawnattr_t * __restrict attr,
70*2c2f96dcSApple OSS Distributions     int count, mach_port_t portarray[])  __API_AVAILABLE(macos(10.9), ios(6.0));
71*2c2f96dcSApple OSS Distributions 
72*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_registered_ports_np(posix_spawnattr_t * __restrict attr, mach_port_t portarray[], uint32_t count) __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
73*2c2f96dcSApple OSS Distributions 
74*2c2f96dcSApple OSS Distributions int
75*2c2f96dcSApple OSS Distributions posix_spawnattr_set_ptrauth_task_port_np(posix_spawnattr_t * __restrict attr,
76*2c2f96dcSApple OSS Distributions     mach_port_t port) __API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0));
77*2c2f96dcSApple OSS Distributions 
78*2c2f96dcSApple OSS Distributions #define POSIX_SPAWN_MACPOLICYINFO_WITHSIZE 1
79*2c2f96dcSApple OSS Distributions int     posix_spawnattr_getmacpolicyinfo_np(const posix_spawnattr_t * __restrict, const char *, void **, size_t *) __API_AVAILABLE(macos(10.9), ios(7.0));
80*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setmacpolicyinfo_np(posix_spawnattr_t * __restrict, const char *, void *, size_t) __API_AVAILABLE(macos(10.9), ios(7.0));
81*2c2f96dcSApple OSS Distributions 
82*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setcoalition_np(const posix_spawnattr_t * __restrict, uint64_t, int, int) __API_AVAILABLE(macos(10.10), ios(8.0));
83*2c2f96dcSApple OSS Distributions 
84*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_qos_clamp_np(const posix_spawnattr_t * __restrict, uint64_t) __API_AVAILABLE(macos(10.10), ios(8.0));
85*2c2f96dcSApple OSS Distributions int     posix_spawnattr_get_qos_clamp_np(const posix_spawnattr_t * __restrict, uint64_t * __restrict) __API_AVAILABLE(macos(10.10), ios(8.0));
86*2c2f96dcSApple OSS Distributions 
87*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_darwin_role_np(const posix_spawnattr_t * __restrict, uint64_t) __API_AVAILABLE(macos(10.11), ios(9.0));
88*2c2f96dcSApple OSS Distributions int     posix_spawnattr_get_darwin_role_np(const posix_spawnattr_t * __restrict, uint64_t * __restrict) __API_AVAILABLE(macos(10.11), ios(9.0));
89*2c2f96dcSApple OSS Distributions 
90*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_persona_np(const posix_spawnattr_t * __restrict, uid_t, uint32_t) __API_AVAILABLE(macos(10.11), ios(9.0));
91*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_persona_uid_np(const posix_spawnattr_t * __restrict, uid_t) __API_AVAILABLE(macos(10.11), ios(9.0));
92*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t * __restrict, gid_t) __API_AVAILABLE(macos(10.11), ios(9.0));
93*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_persona_groups_np(const posix_spawnattr_t * __restrict, int, gid_t * __restrict, uid_t) __API_AVAILABLE(macos(10.11), ios(9.0));
94*2c2f96dcSApple OSS Distributions 
95*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_max_addr_np(const posix_spawnattr_t * __restrict attr, uint64_t max_addr) __API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
96*2c2f96dcSApple OSS Distributions 
97*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_uid_np(const posix_spawnattr_t * __restrict, uid_t) __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
98*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_gid_np(const posix_spawnattr_t * __restrict, gid_t) __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
99*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_groups_np(const posix_spawnattr_t * __restrict, int, gid_t * __restrict, uid_t) __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
100*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_login_np(const posix_spawnattr_t * __restrict, const char * __restrict) __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
101*2c2f96dcSApple OSS Distributions 
102*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_subsystem_root_path_np(posix_spawnattr_t *attr, char *path) __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
103*2c2f96dcSApple OSS Distributions 
104*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_platform_np(posix_spawnattr_t *attr, int platform, uint32_t flags) __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
105*2c2f96dcSApple OSS Distributions 
106*2c2f96dcSApple OSS Distributions int     posix_spawnattr_disable_ptr_auth_a_keys_np(posix_spawnattr_t *attr, uint32_t flags) __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
107*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_alt_rosetta_np(posix_spawnattr_t *attr, uint32_t flags) __API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0));
108*2c2f96dcSApple OSS Distributions 
109*2c2f96dcSApple OSS Distributions int     posix_spawn_file_actions_add_fileportdup2_np(posix_spawn_file_actions_t * __restrict, mach_port_t, int) __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
110*2c2f96dcSApple OSS Distributions 
111*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_crash_count_np(posix_spawnattr_t * __restrict attr, uint32_t crash_count, uint32_t timeout) __SPI_AVAILABLE(macos(13.1), ios(16.2), tvos(16.2), watchos(9.2));
112*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_crash_behavior_np(posix_spawnattr_t *attr, uint32_t flags) __API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0));
113*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_crash_behavior_deadline_np(posix_spawnattr_t *attr, uint64_t deadline, uint32_t flags) __API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0));
114*2c2f96dcSApple OSS Distributions 
115*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_launch_type_np(posix_spawnattr_t *attr, uint8_t launch_type) __SPI_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0));
116*2c2f96dcSApple OSS Distributions 
117*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_use_sec_transition_shims_np(posix_spawnattr_t *attr, uint32_t flags) __SPI_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0));
118*2c2f96dcSApple OSS Distributions 
119*2c2f96dcSApple OSS Distributions int     posix_spawnattr_setdataless_iopolicy_np(posix_spawnattr_t * __restrict attr, const int policy) __SPI_AVAILABLE(macos(13.3), ios(16.4), tvos(16.4), watchos(9.4));
120*2c2f96dcSApple OSS Distributions 
121*2c2f96dcSApple OSS Distributions int     posix_spawnattr_set_conclave_id_np(const posix_spawnattr_t *attr, const char *conclave_id) __SPI_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0));
122*2c2f96dcSApple OSS Distributions 
123*2c2f96dcSApple OSS Distributions __END_DECLS
124*2c2f96dcSApple OSS Distributions 
125*2c2f96dcSApple OSS Distributions #endif /* !defined _SPAWN_PRIVATE_H_*/
126