]>
Commit | Line | Data |
---|---|---|
5b0a4722 A |
1 | #ifndef _VPROC_INTERNAL_H_ |
2 | #define _VPROC_INTERNAL_H_ | |
3 | /* | |
4 | * Copyright (c) 2006-2007 Apple Inc. All rights reserved. | |
5 | * | |
6 | * @APPLE_APACHE_LICENSE_HEADER_START@ | |
7 | * | |
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 | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
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. | |
19 | * | |
20 | * @APPLE_APACHE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | ||
23 | #include <mach/mach.h> | |
24 | #include <sys/queue.h> | |
25 | #include <sys/time.h> | |
26 | #include <stdarg.h> | |
ef398931 A |
27 | #include "launch.h" |
28 | #include "bootstrap.h" | |
29 | #include "vproc.h" | |
5b0a4722 A |
30 | |
31 | typedef char * _internal_string_t; | |
32 | typedef char * logmsg_t; | |
33 | typedef pid_t * pid_array_t; | |
34 | typedef mach_port_t vproc_mig_t; | |
35 | ||
36 | #ifdef protocol_vproc_MSG_COUNT | |
37 | /* HACK */ | |
38 | #include "launchd_core_logic.h" | |
39 | #endif | |
40 | ||
41 | #define VPROC_ERR_TRY_PER_USER 1099 | |
42 | ||
43 | #pragma GCC visibility push(default) | |
44 | ||
45 | vproc_err_t _vprocmgr_init(const char *session_type); | |
46 | vproc_err_t _vproc_post_fork_ping(void); | |
47 | ||
48 | #define SPAWN_HAS_PATH 0x0001 | |
49 | #define SPAWN_HAS_WDIR 0x0002 | |
50 | #define SPAWN_HAS_UMASK 0x0004 | |
51 | #define SPAWN_WANTS_WAIT4DEBUGGER 0x0008 | |
52 | ||
53 | kern_return_t | |
54 | _vproc_grab_subset(mach_port_t bp, mach_port_t *reqport, mach_port_t *rcvright, launch_data_t *outval, | |
55 | mach_port_array_t *ports, mach_msg_type_number_t *portCnt); | |
56 | ||
57 | kern_return_t _vprocmgr_getsocket(name_t); | |
58 | ||
59 | ||
60 | struct logmsg_s { | |
61 | STAILQ_ENTRY(logmsg_s) sqe; | |
62 | struct timeval when; | |
63 | pid_t from_pid; | |
64 | pid_t about_pid; | |
65 | uid_t sender_uid; | |
66 | gid_t sender_gid; | |
67 | int err_num; | |
68 | int pri; | |
69 | const char *from_name; | |
70 | const char *about_name; | |
71 | const char *session_name; | |
72 | const char *msg; | |
73 | size_t obj_sz; | |
74 | char data[0]; | |
75 | }; | |
76 | ||
77 | ||
78 | void _vproc_logv(int pri, int err, const char *msg, va_list ap); | |
79 | vproc_err_t _vprocmgr_log_forward(mach_port_t mp, void *data, size_t len); | |
80 | ||
81 | ||
82 | kern_return_t | |
83 | bootstrap_info( | |
84 | mach_port_t bp, | |
85 | name_array_t *service_names, | |
86 | mach_msg_type_number_t *service_namesCnt, | |
87 | bootstrap_status_array_t *service_active, | |
88 | mach_msg_type_number_t *service_activeCnt); | |
89 | ||
90 | #pragma GCC visibility pop | |
91 | ||
92 | #endif |