summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--libgcompat/syslog.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 98f87ad..dbea5b6 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ LIBGCOMPAT_SRC = \
libgcompat/stdlib.c \
libgcompat/string.c \
libgcompat/sysctl.c \
+ libgcompat/syslog.c \
libgcompat/ucontext.c \
libgcompat/version.c \
libgcompat/wchar.c
diff --git a/libgcompat/syslog.c b/libgcompat/syslog.c
new file mode 100644
index 0000000..5409eba
--- /dev/null
+++ b/libgcompat/syslog.c
@@ -0,0 +1,32 @@
+#include <assert.h> /* assert */
+#include <stdarg.h> /* va_list, va_start, va_end */
+#include <stddef.h> /* NULL */
+#include <syslog.h> /* vsyslog */
+
+void __vsyslog_chk(int priority, int flag, const char *format, va_list ap);
+
+/**
+ * Log a message, with stack checking.
+ *
+ * LSB 5.0: LSB-Core-generic/baselib---syslog-chk-1.html
+ */
+void __syslog_chk(int priority, int flag, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ __vsyslog_chk(priority, flag, format, ap);
+ va_end(ap);
+}
+
+/**
+ * Log a message, with stack checking.
+ *
+ * LSB 5.0: LSB-Core-generic/baselib---vsyslog-chk-1.html
+ */
+void __vsyslog_chk(int priority, int flag, const char *format, va_list ap)
+{
+ assert(format != NULL);
+
+ vsyslog(priority, format, ap);
+}