1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * This module intercepts syslog() library calls and redirects their output 3*7c478bd9Sstevel@tonic-gate * to the standard output stream. For interactive testing. 4*7c478bd9Sstevel@tonic-gate * 5*7c478bd9Sstevel@tonic-gate * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. 6*7c478bd9Sstevel@tonic-gate */ 7*7c478bd9Sstevel@tonic-gate 8*7c478bd9Sstevel@tonic-gate #ifndef lint 9*7c478bd9Sstevel@tonic-gate static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21"; 10*7c478bd9Sstevel@tonic-gate #endif 11*7c478bd9Sstevel@tonic-gate 12*7c478bd9Sstevel@tonic-gate #include <stdio.h> 13*7c478bd9Sstevel@tonic-gate 14*7c478bd9Sstevel@tonic-gate #include "mystdarg.h" 15*7c478bd9Sstevel@tonic-gate 16*7c478bd9Sstevel@tonic-gate /* openlog - dummy */ 17*7c478bd9Sstevel@tonic-gate 18*7c478bd9Sstevel@tonic-gate /* ARGSUSED */ 19*7c478bd9Sstevel@tonic-gate 20*7c478bd9Sstevel@tonic-gate openlog(name, logopt, facility) 21*7c478bd9Sstevel@tonic-gate char *name; 22*7c478bd9Sstevel@tonic-gate int logopt; 23*7c478bd9Sstevel@tonic-gate int facility; 24*7c478bd9Sstevel@tonic-gate { 25*7c478bd9Sstevel@tonic-gate /* void */ 26*7c478bd9Sstevel@tonic-gate } 27*7c478bd9Sstevel@tonic-gate 28*7c478bd9Sstevel@tonic-gate /* vsyslog - format one record */ 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate vsyslog(severity, fmt, ap) 31*7c478bd9Sstevel@tonic-gate int severity; 32*7c478bd9Sstevel@tonic-gate char *fmt; 33*7c478bd9Sstevel@tonic-gate va_list ap; 34*7c478bd9Sstevel@tonic-gate { 35*7c478bd9Sstevel@tonic-gate char buf[BUFSIZ]; 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate vprintf(percent_m(buf, fmt), ap); 38*7c478bd9Sstevel@tonic-gate printf("\n"); 39*7c478bd9Sstevel@tonic-gate fflush(stdout); 40*7c478bd9Sstevel@tonic-gate } 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate /* syslog - format one record */ 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate /* VARARGS */ 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate VARARGS(syslog, int, severity) 47*7c478bd9Sstevel@tonic-gate { 48*7c478bd9Sstevel@tonic-gate va_list ap; 49*7c478bd9Sstevel@tonic-gate char *fmt; 50*7c478bd9Sstevel@tonic-gate 51*7c478bd9Sstevel@tonic-gate VASTART(ap, int, severity); 52*7c478bd9Sstevel@tonic-gate fmt = va_arg(ap, char *); 53*7c478bd9Sstevel@tonic-gate vsyslog(severity, fmt, ap); 54*7c478bd9Sstevel@tonic-gate VAEND(ap); 55*7c478bd9Sstevel@tonic-gate } 56*7c478bd9Sstevel@tonic-gate 57*7c478bd9Sstevel@tonic-gate /* closelog - dummy */ 58*7c478bd9Sstevel@tonic-gate 59*7c478bd9Sstevel@tonic-gate closelog() 60*7c478bd9Sstevel@tonic-gate { 61*7c478bd9Sstevel@tonic-gate /* void */ 62*7c478bd9Sstevel@tonic-gate } 63