]>
git.saurik.com Git - apple/launchd.git/blob - launchd/src/vproc_internal.h
1 #ifndef _VPROC_INTERNAL_H_
2 #define _VPROC_INTERNAL_H_
4 * Copyright (c) 2006-2007 Apple Inc. All rights reserved.
6 * @APPLE_APACHE_LICENSE_HEADER_START@
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
20 * @APPLE_APACHE_LICENSE_HEADER_END@
23 #include <mach/mach.h>
24 #include <sys/queue.h>
27 #include <sys/syscall.h>
28 #include <bsm/audit.h>
30 #include "bootstrap_priv.h"
33 typedef char * _internal_string_t
;
34 typedef char * logmsg_t
;
35 typedef pid_t
* pid_array_t
;
36 typedef mach_port_t vproc_mig_t
;
37 typedef uint64_t event_token_array_t
[1024];
39 #define VPROC_SHMEM_EXITING 0x1
41 struct vproc_shmem_s
{
42 int32_t vp_shmem_transaction_cnt
;
43 int32_t vp_shmem_standby_cnt
;
44 uint32_t vp_shmem_standby_timeout
;
45 int32_t vp_shmem_flags
;
48 #if defined(protocol_vproc_MSG_COUNT) || defined (xpc_domain_MSG_COUNT) || defined (xpc_events_MSG_COUNT)
50 #include "launchd_core_logic.h"
53 #define VPROC_ERR_TRY_PER_USER 1099
55 #pragma GCC visibility push(default)
57 vproc_err_t
_vprocmgr_init(const char *session_type
);
58 vproc_err_t
_vproc_post_fork_ping(void);
60 #if !TARGET_OS_EMBEDDED
61 #define _audit_session_self(v) (mach_port_t)syscall(SYS_audit_session_self)
62 #define _audit_session_join(s) (au_asid_t)syscall(SYS_audit_session_join, session)
64 #define _audit_session_self(v) MACH_PORT_NULL
65 #define _audit_session_join(s) 0
68 #define SPAWN_HAS_PATH 0x0001
69 #define SPAWN_HAS_WDIR 0x0002
70 #define SPAWN_HAS_UMASK 0x0004
71 #define SPAWN_WANTS_WAIT4DEBUGGER 0x0008
74 _vproc_grab_subset(mach_port_t bp
, mach_port_t
*reqport
, mach_port_t
*rcvright
, launch_data_t
*outval
,
75 mach_port_array_t
*ports
, mach_msg_type_number_t
*portCnt
);
77 kern_return_t
_vprocmgr_getsocket(name_t
);
81 STAILQ_ENTRY(logmsg_s
) sqe
;
92 const char *from_name
;
93 uint64_t from_name_offset
;
96 const char *about_name
;
97 uint64_t about_name_offset
;
100 const char *session_name
;
101 uint64_t session_name_offset
;
112 vproc_err_t
_vprocmgr_log_forward(mach_port_t mp
, void *data
, size_t len
);
116 bootstrap_info(mach_port_t bp
,
117 name_array_t
*service_names
,
118 mach_msg_type_number_t
*service_namesCnt
,
119 name_array_t
*service_jobs
,
120 mach_msg_type_number_t
*service_jobsCnt
,
121 bootstrap_status_array_t
*service_active
,
122 mach_msg_type_number_t
*service_activeCnt
,
125 #pragma GCC visibility pop