summaryrefslogtreecommitdiff
path: root/libgcompat
diff options
context:
space:
mode:
Diffstat (limited to 'libgcompat')
-rw-r--r--libgcompat/syslog.c32
1 files changed, 32 insertions, 0 deletions
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);
+}