Back to index

glibc  2.9
syslog.h
Go to the documentation of this file.
00001 /* Checking macros for syslog functions.
00002    Copyright (C) 2005, 2007 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SYS_SYSLOG_H
00021 # error "Never include <bits/syslog.h> directly; use <sys/syslog.h> instead."
00022 #endif
00023 
00024 
00025 extern void __syslog_chk (int __pri, int __flag, __const char *__fmt, ...)
00026      __attribute__ ((__format__ (__printf__, 3, 4)));
00027 
00028 #ifdef __va_arg_pack
00029 __extern_always_inline void
00030 syslog (int __pri, __const char *__fmt, ...)
00031 {
00032   return __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
00033 }
00034 #elif !defined __cplusplus
00035 # define syslog(pri, ...) \
00036   __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
00037 #endif
00038 
00039 
00040 #ifdef __USE_BSD
00041 extern void __vsyslog_chk (int __pri, int __flag, __const char *__fmt,
00042                         __gnuc_va_list __ap)
00043      __attribute__ ((__format__ (__printf__, 3, 0)));
00044 
00045 __extern_always_inline void
00046 vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
00047 {
00048   return __vsyslog_chk (__pri,  __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
00049 }
00050 #endif