]>
git.saurik.com Git - apple/launchd.git/blob - liblaunch/vproc_internal.h
2 * Copyright (c) 2006-2007 Apple Inc. All rights reserved.
4 * @APPLE_APACHE_LICENSE_HEADER_START@
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @APPLE_APACHE_LICENSE_HEADER_END@
21 #ifndef __VPROC_INTERNAL_H__
22 #define __VPROC_INTERNAL_H__
24 #include <mach/mach.h>
25 #include <sys/queue.h>
28 #include <sys/syscall.h>
29 #include <bsm/audit.h>
31 #include "bootstrap_priv.h"
34 typedef char * _internal_string_t
;
35 typedef char * logmsg_t
;
36 typedef pid_t
* pid_array_t
;
37 typedef mach_port_t vproc_mig_t
;
39 #if defined(job_MSG_COUNT) || defined (xpc_domain_MSG_COUNT)
44 #define VPROC_ERR_TRY_PER_USER 1099
46 #pragma GCC visibility push(default)
48 vproc_err_t
_vprocmgr_init(const char *session_type
);
49 vproc_err_t
_vproc_post_fork_ping(void);
51 #if !TARGET_OS_EMBEDDED
52 #define _audit_session_self(v) (mach_port_t)syscall(SYS_audit_session_self)
53 #define _audit_session_join(s) (au_asid_t)syscall(SYS_audit_session_join, session)
55 #define _audit_session_self(v) MACH_PORT_NULL
56 #define _audit_session_join(s) 0
59 #define __LAUNCH_MACH_PORT_CONTEXT_T_DEFINED__ 0
61 #define SPAWN_HAS_PATH 0x0001
62 #define SPAWN_HAS_WDIR 0x0002
63 #define SPAWN_HAS_UMASK 0x0004
64 #define SPAWN_WANTS_WAIT4DEBUGGER 0x0008
67 _vproc_grab_subset(mach_port_t bp
, mach_port_t
*reqport
, mach_port_t
*rcvright
, launch_data_t
*outval
,
68 mach_port_array_t
*ports
, mach_msg_type_number_t
*portCnt
);
70 kern_return_t
_vprocmgr_getsocket(name_t
);
74 STAILQ_ENTRY(logmsg_s
) sqe
;
85 const char *from_name
;
86 uint64_t from_name_offset
;
89 const char *about_name
;
90 uint64_t about_name_offset
;
93 const char *session_name
;
94 uint64_t session_name_offset
;
105 vproc_err_t
_vprocmgr_log_forward(mach_port_t mp
, void *data
, size_t len
);
108 bootstrap_info(mach_port_t bp
,
109 name_array_t
*service_names
,
110 mach_msg_type_number_t
*service_namesCnt
,
111 name_array_t
*service_jobs
,
112 mach_msg_type_number_t
*service_jobsCnt
,
113 bootstrap_status_array_t
*service_active
,
114 mach_msg_type_number_t
*service_activeCnt
,
117 #pragma GCC visibility pop
119 #endif /* __VPROC_INTERNAL_H__ */