]> git.saurik.com Git - apple/launchd.git/blame - src/log.h
launchd-842.92.1.tar.gz
[apple/launchd.git] / src / log.h
CommitLineData
eabd1701
A
1#ifndef __LAUNCHD_LOG_H__
2#define __LAUNCHD_LOG_H__
3
4#include <mach/mach.h>
5#include <sys/types.h>
6#include <sys/time.h>
7#include <sys/queue.h>
8#include <sys/fcntl.h>
9#include <malloc/malloc.h>
10#include <unistd.h>
11#include <pthread.h>
12#include <errno.h>
13#include <string.h>
14#include <ctype.h>
15#include <stdio.h>
16#include <stdlib.h>
17#include <stdbool.h>
18#include <syslog.h>
19
20extern char *launchd_username;
21extern char *launchd_label;
22extern mach_port_t launchd_drain_reply_port;
23extern bool launchd_var_available;
24extern int64_t launchd_system_start;
25
26struct launchd_syslog_attr {
27 const char *from_name;
28 const char *about_name;
29 const char *session_name;
30 int priority;
31 uid_t from_uid;
32 pid_t from_pid;
33 pid_t about_pid;
34};
35
36/* These constants must not have the high bit set so we can safely mask them
37 * mask them with LOG_CONSOLE.
38 */
39#define LOG_PERF 0x5252615d
40#define LOG_APPLEONLY 0x4141504c
41#define LOG_CONSOLE (1 << 31)
42
43__attribute__((visibility("default")))
44__attribute__((used))
45extern bool
95379394 46_launchd_os_redirect(const char *message);
eabd1701
A
47
48int
49runtime_setlogmask(int maskpri);
50
51void
52launchd_closelog(void);
53
54__attribute__((format(printf, 2, 3)))
55void
56launchd_syslog(int pri, const char *message, ...);
57
58__attribute__((format(printf, 2, 0)))
59void
60launchd_vsyslog(struct launchd_syslog_attr *attr, const char *message, va_list args);
61
62void
63launchd_log_push(void);
64
65kern_return_t
66launchd_log_forward(uid_t forward_uid, gid_t forward_gid, vm_offset_t inval, mach_msg_type_number_t invalCnt);
67
68kern_return_t
69launchd_log_drain(mach_port_t srp, vm_offset_t *outval, mach_msg_type_number_t *outvalCnt);
70
71#endif /* __LAUNCHD_LOG_H__ */