summaryrefslogtreecommitdiff
path: root/libgcompat/syslog.c
blob: 5409eba5ee68c0f93840800a9f880bb4a23adead (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
}