]>
Commit | Line | Data |
---|---|---|
e91b9f68 A |
1 | /* |
2 | * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. | |
3 | * | |
ed34e3c3 | 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ |
e91b9f68 | 5 | * |
ed34e3c3 A |
6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | * you may not use this file except in compliance with the License. | |
8 | * You may obtain a copy of the License at | |
e91b9f68 | 9 | * |
ed34e3c3 | 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
e91b9f68 | 11 | * |
ed34e3c3 A |
12 | * Unless required by applicable law or agreed to in writing, software |
13 | * distributed under the License is distributed on an "AS IS" BASIS, | |
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
15 | * See the License for the specific language governing permissions and | |
16 | * limitations under the License. | |
17 | * | |
18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | |
e91b9f68 A |
19 | */ |
20 | /* | |
21 | * bootstrap -- fundamental service initiator and port server | |
22 | * Mike DeMoney, NeXT, Inc. | |
23 | * Copyright, 1990. All rights reserved. | |
e91b9f68 A |
24 | */ |
25 | ||
26 | subsystem bootstrap 400; | |
27 | ||
e91b9f68 A |
28 | #include <mach/std_types.defs> |
29 | #include <mach/mach_types.defs> | |
5b0a4722 | 30 | #include "launchd_mig_types.defs" |
ed34e3c3 A |
31 | import "bootstrap_public.h"; |
32 | import "bootstrap_private.h"; | |
e91b9f68 | 33 | |
5b0a4722 A |
34 | userprefix vproc_mig_; |
35 | serverprefix job_mig_; | |
e91b9f68 | 36 | |
5b0a4722 A |
37 | routine create_server( |
38 | __bs_port : job_t; | |
e91b9f68 A |
39 | __server_cmd : cmd_t; |
40 | __server_uid : natural_t; | |
41 | __on_demand : boolean_t; | |
ed34e3c3 | 42 | ServerAuditToken __token : audit_token_t; |
e91b9f68 A |
43 | out __server_port : mach_port_make_send_t); |
44 | ||
5b0a4722 | 45 | skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ |
e91b9f68 | 46 | |
5b0a4722 A |
47 | routine check_in( |
48 | __bs_port : job_t; | |
e91b9f68 | 49 | __service_name : name_t; |
ed34e3c3 | 50 | ServerAuditToken __token : audit_token_t; |
e91b9f68 A |
51 | out __service_port : mach_port_move_receive_t); |
52 | ||
5b0a4722 A |
53 | routine register( |
54 | __bs_port : job_t; | |
ed34e3c3 | 55 | ServerAuditToken __token : audit_token_t; |
e91b9f68 A |
56 | __service_name : name_t; |
57 | __service_port : mach_port_t); | |
58 | ||
5b0a4722 A |
59 | routine look_up( |
60 | __bs_port : job_t; | |
ed34e3c3 | 61 | ServerAuditToken __token : audit_token_t; |
e91b9f68 | 62 | __service_name : name_t; |
ed34e3c3 | 63 | out __service_port : mach_port_send_t); |
e91b9f68 | 64 | |
ed34e3c3 | 65 | skip; /* last used in 10.4 */ |
e91b9f68 | 66 | |
5b0a4722 A |
67 | routine parent( |
68 | __bs_port : job_t; | |
ed34e3c3 | 69 | out __parent_port : mach_port_send_t); |
e91b9f68 | 70 | |
ed34e3c3 | 71 | skip; /* last used in 10.4 */ |
e91b9f68 | 72 | |
5b0a4722 A |
73 | routine info( |
74 | __bs_port : job_t; | |
e91b9f68 | 75 | out __service_names : name_array_t, dealloc; |
e91b9f68 A |
76 | out __service_active : bootstrap_status_array_t, dealloc); |
77 | ||
5b0a4722 A |
78 | routine subset( |
79 | __bs_port : job_t; | |
e91b9f68 | 80 | __requestor_port: mach_port_t; |
ed34e3c3 | 81 | out __subset_port : mach_port_make_send_t); |
e91b9f68 | 82 | |
5b0a4722 A |
83 | routine create_service( |
84 | __bs_port : job_t; | |
e91b9f68 A |
85 | __service_name : name_t; |
86 | out __service_port : mach_port_t); | |
87 | ||
5b0a4722 A |
88 | routine transfer_subset( |
89 | __bs_port : job_t; | |
ed34e3c3 A |
90 | out __bs_reqport : mach_port_t; |
91 | out __bs_rcvright : mach_port_move_receive_t; | |
92 | out __service_names : name_array_t, dealloc; | |
5b0a4722 | 93 | out __service_pids : pointer_t, dealloc; |
ed34e3c3 A |
94 | out __service_ports : mach_port_array_t, dealloc); |
95 | ||
5b0a4722 A |
96 | routine getsocket( |
97 | __bs_port : job_t; | |
ed34e3c3 A |
98 | out __sockpath : name_t); |
99 | ||
5b0a4722 A |
100 | routine spawn( |
101 | __bs_port : job_t; | |
ed34e3c3 A |
102 | ServerAuditToken __token : audit_token_t; |
103 | __chars : _internal_string_t; | |
104 | __argc : uint32_t; | |
105 | __envc : uint32_t; | |
106 | __flags : uint64_t; | |
107 | __umask : uint16_t; | |
108 | out __pid : pid_t; | |
109 | out __obsvr_port : mach_port_make_send_t); | |
110 | ||
5b0a4722 A |
111 | routine wait( |
112 | __bs_port : job_t; | |
ed34e3c3 A |
113 | sreplyport __rport : mach_port_make_send_once_t; |
114 | ServerAuditToken __token : audit_token_t; | |
115 | out __waitval : integer_t); | |
116 | ||
5b0a4722 A |
117 | routine uncork_fork( |
118 | __bs_port : job_t; | |
ed34e3c3 | 119 | ServerAuditToken __token : audit_token_t); |
5b0a4722 A |
120 | |
121 | /* Essentially the inverse of bootstrap_unprivileged() */ | |
122 | routine get_self( | |
123 | __bs_port : job_t; | |
124 | ServerAuditToken __token : audit_token_t; | |
125 | out __job_port : mach_port_make_send_t); |