syslog.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Checking macros for syslog functions.
  2. Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _SYS_SYSLOG_H
  17. # error "Never include <bits/syslog.h> directly; use <sys/syslog.h> instead."
  18. #endif
  19. extern void __syslog_chk (int __pri, int __flag, __const char *__fmt, ...)
  20. __attribute__ ((__format__ (__printf__, 3, 4)));
  21. #ifdef __va_arg_pack
  22. __extern_always_inline void
  23. syslog (int __pri, __const char *__fmt, ...)
  24. {
  25. __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
  26. }
  27. #elif !defined __cplusplus
  28. # define syslog(pri, ...) \
  29. __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
  30. #endif
  31. #ifdef __USE_BSD
  32. extern void __vsyslog_chk (int __pri, int __flag, __const char *__fmt,
  33. __gnuc_va_list __ap)
  34. __attribute__ ((__format__ (__printf__, 3, 0)));
  35. __extern_always_inline void
  36. vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
  37. {
  38. __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
  39. }
  40. #endif