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