syslog.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * <syslog.h> wrapper functions.
  3. *
  4. * Authors:
  5. * Jonathan Pryor ([email protected])
  6. *
  7. * Copyright (C) 2005 Jonathan Pryor
  8. */
  9. #include <stdarg.h>
  10. #include <syslog.h>
  11. #include <errno.h>
  12. #include "map.h"
  13. #include "mph.h"
  14. #include <glib.h>
  15. G_BEGIN_DECLS
  16. int
  17. Mono_Posix_Syscall_openlog (void* ident, int option, int facility)
  18. {
  19. openlog ((const char*) ident, option, facility);
  20. return 0;
  21. }
  22. int
  23. Mono_Posix_Syscall_closelog (void)
  24. {
  25. closelog ();
  26. return 0;
  27. }
  28. #ifdef __GNUC__
  29. #pragma GCC diagnostic push
  30. #pragma GCC diagnostic ignored "-Wformat-security"
  31. #endif
  32. int
  33. Mono_Posix_Syscall_syslog (int priority, const char* message)
  34. {
  35. syslog (priority, message);
  36. return 0;
  37. }
  38. #ifdef __GNUC__
  39. #pragma GCC diagnostic pop
  40. #endif
  41. /* vararg version of syslog(3). */
  42. gint32
  43. Mono_Posix_Syscall_syslog2 (int priority, const char *format, ...);
  44. gint32
  45. Mono_Posix_Syscall_syslog2 (int priority, const char *format, ...)
  46. {
  47. va_list ap;
  48. va_start (ap, format);
  49. vsyslog (priority, format, ap);
  50. va_end (ap);
  51. return 0;
  52. }
  53. G_END_DECLS
  54. /*
  55. * vim: noexpandtab
  56. */