1 #ifndef __LAUNCHD_LOG_H__
2 #define __LAUNCHD_LOG_H__
9 #include <malloc/malloc.h>
20 extern char *launchd_username
;
21 extern char *launchd_label
;
22 extern mach_port_t launchd_drain_reply_port
;
23 extern bool launchd_var_available
;
24 extern int64_t launchd_system_start
;
26 struct launchd_syslog_attr
{
27 const char *from_name
;
28 const char *about_name
;
29 const char *session_name
;
36 /* These constants must not have the high bit set so we can safely mask them
37 * mask them with LOG_CONSOLE.
39 #define LOG_PERF 0x5252615d
40 #define LOG_APPLEONLY 0x4141504c
41 #define LOG_CONSOLE (1 << 31)
43 __attribute__((visibility("default")))
46 _launchd_os_redirect(const char *message
);
49 runtime_setlogmask(int maskpri
);
52 launchd_closelog(void);
54 __attribute__((format(printf
, 2, 3)))
56 launchd_syslog(int pri
, const char *message
, ...);
58 __attribute__((format(printf
, 2, 0)))
60 launchd_vsyslog(struct launchd_syslog_attr
*attr
, const char *message
, va_list args
);
63 launchd_log_push(void);
66 launchd_log_forward(uid_t forward_uid
, gid_t forward_gid
, vm_offset_t inval
, mach_msg_type_number_t invalCnt
);
69 launchd_log_drain(mach_port_t srp
, vm_offset_t
*outval
, mach_msg_type_number_t
*outvalCnt
);
71 #endif /* __LAUNCHD_LOG_H__ */