Added BSD extension vsyslog() - is also found on Linux.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23835 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6b1fc6fcb7
commit
e5bc2a9e7a
@ -6,6 +6,9 @@
|
|||||||
#define _SYSLOG_H_
|
#define _SYSLOG_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
|
||||||
/* options for openlog() */
|
/* options for openlog() */
|
||||||
|
|
||||||
#define LOG_PID (1 << 12) /* log the process (thread/team) ID with each message */
|
#define LOG_PID (1 << 12) /* log the process (thread/team) ID with each message */
|
||||||
@ -80,6 +83,9 @@ extern void openlog_thread(const char *ident, int logopt, int facility);
|
|||||||
extern void log_thread(int priority, const char *message, ...);
|
extern void log_thread(int priority, const char *message, ...);
|
||||||
extern int setlogmask_thread(int priorityMask);
|
extern int setlogmask_thread(int priorityMask);
|
||||||
|
|
||||||
|
/* BSD extensions */
|
||||||
|
extern void vsyslog(int priority, const char *message, va_list args);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
* Copyright 2003-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -162,7 +162,42 @@ send_syslog_message(syslog_context *context, int priority, const char *text,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - public Be API
|
// #pragma mark - POSIX API
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
closelog(void)
|
||||||
|
{
|
||||||
|
closelog_thread();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
openlog(const char *ident, int options, int facility)
|
||||||
|
{
|
||||||
|
openlog_thread(ident, options, facility);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
setlogmask(int priorityMask)
|
||||||
|
{
|
||||||
|
return setlogmask_thread(priorityMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
syslog(int priority, const char *message, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, message);
|
||||||
|
send_syslog_message(get_context(), priority, message, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - Be extensions
|
||||||
// ToDo: it would probably be better to export these symbols as weak symbols only
|
// ToDo: it would probably be better to export these symbols as weak symbols only
|
||||||
|
|
||||||
|
|
||||||
@ -255,38 +290,12 @@ log_thread(int priority, const char *message, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - POSIX API
|
// #pragma mark - BSD extensions
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
closelog(void)
|
vsyslog(int priority, const char *message, va_list args)
|
||||||
{
|
{
|
||||||
closelog_thread();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
openlog(const char *ident, int options, int facility)
|
|
||||||
{
|
|
||||||
openlog_thread(ident, options, facility);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
setlogmask(int priorityMask)
|
|
||||||
{
|
|
||||||
return setlogmask_thread(priorityMask);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
syslog(int priority, const char *message, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start(args, message);
|
|
||||||
send_syslog_message(get_context(), priority, message, args);
|
send_syslog_message(get_context(), priority, message, args);
|
||||||
va_end(args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user