* mini-s390.c: Fix ATOMIC_ADD_I4 operation.
[mono.git] / support / syslog.c
blobf5b96607a28ed2a6cc705aa2fd638d06b14d67c2
1 /*
2 * <syslog.h> wrapper functions.
4 * Authors:
5 * Jonathan Pryor (jonpryor@vt.edu)
7 * Copyright (C) 2005 Jonathan Pryor
8 */
10 #include <stdarg.h>
11 #include <syslog.h>
12 #include <errno.h>
14 #include "mph.h"
15 #include <glib/gtypes.h>
17 G_BEGIN_DECLS
19 int
20 Mono_Posix_Syscall_openlog (void* ident, int option, int facility)
22 errno = 0;
23 openlog ((const char*) ident, option, facility);
24 return errno == 0 ? 0 : -1;
27 int
28 Mono_Posix_Syscall_closelog (void)
30 errno = 0;
31 closelog ();
32 return errno == 0 ? 0 : -1;
35 int
36 Mono_Posix_Syscall_syslog (int priority, const char* message)
38 errno = 0;
39 syslog (priority, message);
40 return errno == 0 ? 0 : -1;
43 /* vararg version of syslog(3). */
44 gint32
45 Mono_Posix_Syscall_syslog2 (int priority, const char *format, ...)
47 va_list ap;
49 errno = 0;
51 va_start (ap, format);
52 vsyslog (priority, format, ap);
53 va_end (ap);
55 if (errno != 0)
56 return -1;
57 return 0;
61 G_END_DECLS
64 * vim: noexpandtab