Files
Iain Buclaw 7e7ebe3e35 d: Merge upstream dmd, druntime e4f8919591, phobos 3ad507b51.
D front-end changes:

    - Import dmd v2.101.0-beta.1.
    - Add predefined version `D_Optimized' when compiling with `-O'.
    - Shortened method syntax (DIP1043) is now enabled by default.
    - Array literals assigned to `scope' array variables are now
      allocated on the stack.
    - Implement `@system' variables (DIP1035), available behind the
      preview feature flag `-fpreview=systemvariables'.

D runtime changes:

    - Import druntime v2.101.0-beta.1.

Phobos changes:

    - Import phobos v2.101.0-beta.1.
    - Added `std.typecons.SafeRefCounted', that can be used in `@safe'
      code with `-fpreview=dip1000'.

gcc/d/ChangeLog:

	* d-attribs.cc (apply_user_attributes): Update for new front-end
	interface.
	* d-builtins.cc (d_init_versions): Predefine `D_Optimized' with
	compiling with optimizations enabled.
	* d-lang.cc (d_handle_option): Update for new front-end interface.
	Handle new option `-fpreview=systemvariables'.
	* dmd/MERGE: Merge upstream dmd e4f8919591.
	* dmd/VERSION: Bump version to v2.101.0-beta.1.
	* expr.cc (ExprVisitor::visit (AssignExp *)): Treat construction of
	static arrays from a call expression as a simple assignment.
	(ExprVisitor::visit (ArrayLiteralExp *)): Handle array literals with
	`scope' storage.
	* gdc.texi: Update documentation of `-fpreview=' options.
	* lang.opt (fpreview=shortenedmethods): Remove.
	(fpreview=systemvariables):  New option.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e4f8919591.
	* src/MERGE: Merge upstream phobos 3ad507b51.

gcc/testsuite/ChangeLog:

	* gdc.dg/simd19630.d: Move tests with errors to ...
	* gdc.dg/simd19630b.d: ... here.  New test.
	* gdc.dg/simd19630c.d: New test.
	* gdc.dg/simd_ctfe.d: Removed.
	* gdc.dg/simd18867.d: New test.
	* gdc.dg/simd19788.d: New test.
	* gdc.dg/simd21469.d: New test.
	* gdc.dg/simd21672.d: New test.
	* gdc.dg/simd23077.d: New test.
	* gdc.dg/simd23084.d: New test.
	* gdc.dg/simd23085.d: New test.
	* gdc.dg/torture/simd19632.d: New test.
	* gdc.dg/torture/simd20041.d: New test.
	* gdc.dg/torture/simd21673.d: New test.
	* gdc.dg/torture/simd21676.d: New test.
	* gdc.dg/torture/simd22438.d: New test.
	* gdc.dg/torture/simd23009.d: New test.
	* gdc.dg/torture/simd23077.d: New test.
	* gdc.dg/torture/simd8.d: New test.
	* gdc.dg/torture/simd9.d: New test.
	* gdc.dg/torture/simd_prefetch.d: New test.
2022-10-29 13:02:26 +02:00

589 lines
24 KiB
D

/**
* D header file for POSIX system logger API.
* (http://pubs.opengroup.org/onlinepubs/007904875/basedefs/syslog.h.html)
*
* Copyright: Copyright Adil Baig 2013.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Adil Baig
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/
/* Copyright Adil Baig 2013.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module core.sys.posix.syslog;
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
version (Posix):
extern (C) nothrow @nogc:
version (CRuntime_Glibc)
{
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (Darwin)
{
//http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/osfmk/sys/syslog.h
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (FreeBSD)
{
//http://fxr.watson.org/fxr/source/sys/syslog.h
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
LOG_NTP = (12<<3), /* NTP subsystem */
LOG_SECURITY = (13<<3), /* security subsystems (firewalling, etc.) */
LOG_CONSOLE = (14<<3), /* /dev/console output */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (NetBSD)
{
//http://fxr.watson.org/fxr/source/sys/syslog.h
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
LOG_NTP = (12<<3), /* NTP subsystem */
LOG_SECURITY = (13<<3), /* security subsystems (firewalling, etc.) */
LOG_CONSOLE = (14<<3), /* /dev/console output */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (OpenBSD)
{
//PRIORITY
enum
{
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum
{
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum
{
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
// OpenBSD does not define the following:
//LOG_NTP
//LOG_SECURITY
//LOG_CONSOLE
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
extern(D) int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
extern(D) int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog(const char *, int, int);
int setlogmask(int);
void syslog(int, const char *, ...);
void closelog();
}
else version (DragonFlyBSD)
{
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
LOG_NTP = (12<<3), /* NTP subsystem */
LOG_SECURITY = (13<<3), /* security subsystems (firewalling, etc.) */
LOG_CONSOLE = (14<<3), /* /dev/console output */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (Solaris)
{
//http://pubs.opengroup.org/onlinepubs/007904875/basedefs/syslog.h.html
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (CRuntime_UClibc)
{
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}
else version (CRuntime_Musl)
{
//PRIORITY
enum {
LOG_EMERG = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */
LOG_DEBUG = 7, /* debug-level messages */
}
//OPTIONS
enum {
LOG_PID = 0x01, /* log the pid with each message */
LOG_CONS = 0x02, /* log on the console if errors in sending */
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
LOG_NDELAY = 0x08, /* don't delay open */
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
LOG_PERROR = 0x20, /* log to stderr as well */
}
//FACILITY
enum {
LOG_KERN = (0<<3), /* kernel messages */
LOG_USER = (1<<3), /* random user-level messages */
LOG_MAIL = (2<<3), /* mail system */
LOG_DAEMON = (3<<3), /* system daemons */
LOG_AUTH = (4<<3), /* security/authorization messages */
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
LOG_LPR = (6<<3), /* line printer subsystem */
LOG_NEWS = (7<<3), /* network news subsystem */
LOG_UUCP = (8<<3), /* UUCP subsystem */
LOG_CRON = (9<<3), /* clock daemon */
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
LOG_FTP = (11<<3), /* ftp daemon */
/* other codes through 15 reserved for system use */
LOG_LOCAL0 = (16<<3), /* reserved for local use */
LOG_LOCAL1 = (17<<3), /* reserved for local use */
LOG_LOCAL2 = (18<<3), /* reserved for local use */
LOG_LOCAL3 = (19<<3), /* reserved for local use */
LOG_LOCAL4 = (20<<3), /* reserved for local use */
LOG_LOCAL5 = (21<<3), /* reserved for local use */
LOG_LOCAL6 = (22<<3), /* reserved for local use */
LOG_LOCAL7 = (23<<3), /* reserved for local use */
LOG_NFACILITIES = 24, /* current number of facilities */
}
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
void openlog (const char *, int __option, int __facility);
int setlogmask (int __mask);
void syslog (int __pri, const char *__fmt, ...);
void closelog();
}