haiku/headers/private/syslog_daemon/syslog_daemon.h
Axel Dörfler 4bf862e368 syslog_daemon: Converted to BServer.
* Instead of letting the kernel search for the syslog port, the
  daemon now registers itself with the kernel (which even solves
  a TODO).
* A port is created for the actual log messages from the launch_daemon,
  and used on start.
* However, the SyslogTest does not yet work, due to the BMessage <->
  KMessage communication problems.
2015-07-22 20:40:47 +02:00

39 lines
1018 B
C

/*
* Copyright 2003-2015, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef SYSLOG_DAEMON_H
#define SYSLOG_DAEMON_H
#include <OS.h>
#define B_SYSTEM_LOGGER_SIGNATURE "application/x-vnd.Haiku-SystemLogger"
#define SYSLOG_MESSAGE '_Syl'
#define SYSLOG_ADD_LISTENER 'aSyl'
#define SYSLOG_REMOVE_LISTENER 'rSyl'
// This message is sent from both, the POSIX syslog API and the kernel's
// dprintf() logging facility if logging to syslog was enabled.
struct syslog_message {
thread_id from;
time_t when;
int32 options;
int16 priority;
char ident[B_OS_NAME_LENGTH];
char message[1];
};
#define SYSLOG_MESSAGE_BUFFER_SIZE 8192
#define SYSLOG_MAX_MESSAGE_LENGTH (SYSLOG_MESSAGE_BUFFER_SIZE - sizeof(struct syslog_message))
#define SYSLOG_PRIORITY(options) ((options) & 0x7)
#define SYSLOG_FACILITY(options) ((options) & 0x03f8)
#define SYSLOG_FACILITY_INDEX(options) (SYSLOG_FACILITY(options) >> 3)
#endif /* SYSLOG_DAEMON_H */