/usr/lib/gcc/x86_64-linux-gnu/5/include/d/core/sys/posix/syslog.d is in libphobos-5-dev 5.5.0-12ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | /**
* 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 (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( OSX )
{
//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( 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();
}
|