]> git.saurik.com Git - apple/launchd.git/blame - src/core.h
launchd-442.26.2.tar.gz
[apple/launchd.git] / src / core.h
CommitLineData
ed34e3c3
A
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
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
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
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@
19 */
20
eabd1701
A
21#ifndef __LAUNCHD_CORE_LOGIC__
22#define __LAUNCHD_CORE_LOGIC__
23
24#include "runtime.h"
ef398931
A
25#include "bootstrap.h"
26#include "launch.h"
ed34e3c3 27
5b0a4722
A
28typedef struct job_s *job_t;
29typedef struct jobmgr_s *jobmgr_t;
ed34e3c3 30
5b0a4722 31extern jobmgr_t root_jobmgr;
eabd1701
A
32extern mach_port_t launchd_audit_port;
33extern au_asid_t launchd_audit_session;
34extern bool launchd_flat_mach_namespace;
35extern bool launchd_embedded_handofgod;
ed34e3c3 36
5b0a4722
A
37void jobmgr_init(bool);
38jobmgr_t jobmgr_shutdown(jobmgr_t jm);
39void jobmgr_dispatch_all_semaphores(jobmgr_t jm);
ddbbfbc1 40void jobmgr_dispatch_all_interested(jobmgr_t jm, job_t j);
5b0a4722 41jobmgr_t jobmgr_delete_anything_with_port(jobmgr_t jm, mach_port_t port);
ed34e3c3 42
ed34e3c3 43launch_data_t job_export_all(void);
ed34e3c3 44
5b0a4722 45job_t job_dispatch(job_t j, bool kickstart); /* returns j on success, NULL on job removal */
dcace88f 46job_t job_find(jobmgr_t jm, const char *label);
5b0a4722
A
47job_t job_find_by_service_port(mach_port_t p);
48bool job_ack_port_destruction(mach_port_t p);
49bool job_is_anonymous(job_t j);
50launch_data_t job_export(job_t j);
51void job_stop(job_t j);
52void job_checkin(job_t j);
53void job_remove(job_t j);
ddbbfbc1 54bool job_is_god(job_t j);
5b0a4722
A
55job_t job_import(launch_data_t pload);
56launch_data_t job_import_bulk(launch_data_t pload);
57job_t job_mig_intran(mach_port_t mp);
58void job_mig_destructor(job_t j);
59void job_ack_no_senders(job_t j);
60void job_log(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4)));
ddbbfbc1
A
61void job_set_pid_crashed(pid_t p);
62
eabd1701 63#if TARGET_OS_EMBEDDED
ddbbfbc1 64int launchd_set_jetsam_priorities(launch_data_t priorities);
eabd1701 65int launchd_update_jetsam_list(job_t j);
ed34e3c3 66#endif
eabd1701
A
67
68bool xpc_event_demux(mach_port_t p, xpc_object_t request, xpc_object_t *reply);
69
70#endif /* __LAUNCHD_CORE_LOGIC__ */