syslog.c revision 1.7 1 1.1 christos #include <sys/types.h>
2 1.1 christos #include <sys/syslog.h>
3 1.1 christos #include <stdio.h>
4 1.7 abs #include <string.h>
5 1.7 abs #include <errno.h>
6 1.1 christos #include <stdarg.h>
7 1.1 christos
8 1.1 christos void
9 1.1 christos openlog(const char *path, int opt, int fac)
10 1.1 christos {
11 1.1 christos }
12 1.1 christos
13 1.1 christos void
14 1.1 christos closelog(void)
15 1.1 christos {
16 1.1 christos }
17 1.1 christos
18 1.2 christos int
19 1.2 christos setlogmask(int mask)
20 1.2 christos {
21 1.4 he return 0xff;
22 1.2 christos }
23 1.2 christos
24 1.3 dsl __strong_alias(_syslog, syslog)
25 1.1 christos void
26 1.1 christos syslog(int fac, const char *fmt, ...)
27 1.1 christos {
28 1.1 christos va_list ap;
29 1.1 christos va_start(ap, fmt);
30 1.7 abs vsyslog(fac, fmt, ap);
31 1.1 christos va_end(ap);
32 1.1 christos }
33 1.1 christos
34 1.3 dsl __strong_alias(_vsyslog, vsyslog)
35 1.1 christos void
36 1.1 christos vsyslog(int fac, const char *fmt, va_list ap)
37 1.1 christos {
38 1.1 christos (void)vfprintf(stderr, fmt, ap);
39 1.7 abs /* Cheap hack to ensure %m causes error message string to be shown */
40 1.7 abs if (strstr(fmt, "%m"))
41 1.7 abs (void)fprintf(stderr, " (%s)", strerror(errno));
42 1.3 dsl (void)fprintf(stderr, "\n");
43 1.3 dsl fflush(stderr);
44 1.1 christos }
45 1.5 he
46 1.6 christos void syslog_ss(int, struct syslog_data *, const char *, ...);
47 1.5 he __strong_alias(_syslog_ss, syslog_ss)
48 1.5 he void
49 1.5 he syslog_ss(int priority, struct syslog_data *data, const char *fmt, ...)
50 1.5 he {
51 1.5 he va_list ap;
52 1.5 he va_start(ap, fmt);
53 1.5 he vsyslog(priority, fmt, ap);
54 1.5 he va_end(ap);
55 1.5 he }
56 1.5 he
57 1.6 christos void vsyslog_ss(int, struct syslog_data *, const char *, va_list);
58 1.5 he __strong_alias(_vsyslog_ss, vsyslog_ss)
59 1.5 he void
60 1.5 he vsyslog_ss(int priority, struct syslog_data *data, const char *fmt, va_list ap)
61 1.5 he {
62 1.5 he vsyslog(priority, fmt, ap);
63 1.5 he }
64 1.5 he
65 1.5 he __strong_alias(_syslog_r, syslog_r)
66 1.5 he void
67 1.5 he syslog_r(int priority, struct syslog_data *data, const char *fmt, ...)
68 1.5 he {
69 1.5 he va_list ap;
70 1.5 he va_start(ap, fmt);
71 1.5 he vsyslog(priority, fmt, ap);
72 1.5 he va_end(ap);
73 1.5 he }
74 1.5 he
75 1.5 he __strong_alias(_vsyslog_r, vsyslog_r)
76 1.5 he void
77 1.5 he vsyslog_r(int priority, struct syslog_data *data, const char *fmt, va_list ap)
78 1.5 he {
79 1.5 he vsyslog(priority, fmt, ap);
80 1.5 he }
81 1.5 he
82 1.5 he __strong_alias(_closelog_r, closelog_r)
83 1.5 he void
84 1.5 he closelog_r(struct syslog_data *data)
85 1.5 he {
86 1.5 he }
87 1.5 he
88 1.5 he __strong_alias(_setlogmask_r, setlogmask_r)
89 1.5 he int
90 1.5 he setlogmask_r(int maskpri, struct syslog_data *data)
91 1.5 he {
92 1.5 he return 0xff;
93 1.5 he }
94 1.5 he
95 1.5 he __strong_alias(_openlog_r, openlog_r)
96 1.5 he void
97 1.5 he openlog_r(const char *id, int logopt, int facility, struct syslog_data *data)
98 1.5 he {
99 1.5 he }
100