X-Git-Url: https://git.saurik.com/apple/launchd.git/blobdiff_plain/ed34e3c3e5fb80e0702ac7fb92f189862089d820..f271391cf54cba14d21d45675781491323ebe16d:/launchd/src/launchd.h?ds=sidebyside diff --git a/launchd/src/launchd.h b/launchd/src/launchd.h index cfc0c55..a8a0c92 100644 --- a/launchd/src/launchd.h +++ b/launchd/src/launchd.h @@ -23,73 +23,37 @@ #include #include #include "launch.h" -#include "bootstrap_public.h" - -/* - * Use launchd_assumes() when we can recover, even if it means we leak or limp along. - * - * Use launchd_assert() for core initialization routines. - */ -#define launchd_assumes(e) \ - (__builtin_expect(!(e), 0) ? _log_launchd_bug(__rcs_file_version__, __FILE__, __LINE__, #e), false : true) - -#define launchd_blame(e, b) \ - (__builtin_expect(!(e), 0) ? syslog(LOG_DEBUG, "Encountered bug: %d", b), false : true) - -#define launchd_assert(e) launchd_assumes(e) ? true : abort(); - -#define FIRSTBORN_LABEL "com.apple.launchd.firstborn" -#define READCONF_LABEL "com.apple.launchd.readconfig" +#include "bootstrap.h" +#include "launchd_runtime.h" struct kevent; struct conncb; -typedef void (*kq_callback)(void *, struct kevent *); - -extern kq_callback kqsimple_zombie_reaper; -extern sigset_t blocked_signals; extern bool shutdown_in_progress; +extern bool fake_shutdown_in_progress; extern bool network_up; -extern int batch_disabler_count; -extern mach_port_t launchd_internal_port; -extern mach_port_t ipc_port_set; +extern bool g_force_old_kill_path; +extern bool g_simulate_pid1_crash; +extern FILE *g_console; +extern char g_launchd_database_dir[PATH_MAX]; bool init_check_pid(pid_t); -int kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata); -void batch_job_enable(bool e, struct conncb *c); - launch_data_t launchd_setstdio(int d, launch_data_t o); void launchd_SessionCreate(void); void launchd_shutdown(void); void launchd_single_user(void); -pid_t launchd_fork(void); boolean_t launchd_mach_ipc_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply); -kern_return_t launchd_set_bport(mach_port_t name); -kern_return_t launchd_get_bport(mach_port_t *name); -kern_return_t launchd_mport_notify_req(mach_port_t name, mach_msg_id_t which); -kern_return_t launchd_mport_notify_cancel(mach_port_t name, mach_msg_id_t which); -kern_return_t launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg); -kern_return_t launchd_mport_create_recv(mach_port_t *name); -kern_return_t launchd_mport_deallocate(mach_port_t name); -kern_return_t launchd_mport_make_send(mach_port_t name); -kern_return_t launchd_mport_close_recv(mach_port_t name); - -void init_boot(bool sflag); -void init_pre_kevent(void); - -void update_ttys(void); -void catatonia(void); +enum { + LAUNCHD_DB_TYPE_OVERRIDES, + LAUNCHD_DB_TYPE_JOBCACHE, + LAUNCHD_DB_TYPE_LAST, +}; +char *launchd_data_base_path(int db_type); void mach_start_shutdown(void); -void mach_init_init(mach_port_t, mach_port_t, name_array_t, mach_port_array_t, mach_msg_type_number_t); -void mach_init_reap(void); int _fd(int fd); -void _log_launchd_bug(const char *rcs_rev, const char *path, unsigned int line, const char *test); - -bool progeny_check(pid_t p); - #endif