Home | History | Annotate | Download | only in linux
      1 /** Test program for the syslog() system call.
      2  *  From the syslog(2) man page:
      3  *    If you need the libc function syslog()  (which  talks  to  syslogd(8)),
      4  *    then look at syslog(3).  The system call of this name is about control-
      5  *    ling the kernel printk()  buffer,  and  the  glibc  version  is  called
      6  *    klogctl().
      7  */
      8 
      9 #include "../../config.h"
     10 #include <stdio.h>
     11 #if defined(HAVE_SYS_KLOG_H)
     12 #include <sys/klog.h>
     13 #endif
     14 
     15 int main(int argc, char** argv)
     16 {
     17   int number_of_unread_characters;
     18 #if defined HAVE_KLOGCTL
     19   number_of_unread_characters = klogctl(9, 0, 0);
     20 #endif
     21   fprintf(stderr, "Done.\n");
     22   return 0 * number_of_unread_characters;
     23 }
     24