Skip to content

Commit

Permalink
options/posix: Add missing defines for util-linux into syslog.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Dec 13, 2024
1 parent d12b367 commit cc11837
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions options/posix/include/syslog.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,58 @@ extern "C" {
#define LOG_INFO 6
#define LOG_DEBUG 7

#if defined SYSLOG_NAMES && defined __USE_MISC
typedef struct _code {
char *c_name;
int c_val;
} CODE;

#define INTERNAL_NOPRI 0x10
#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES << 3, 0)

CODE prioritynames[] = {
{ "alert", LOG_ALERT },
{ "crit", LOG_CRIT },
{ "debug", LOG_DEBUG },
{ "emerg", LOG_EMERG },
{ "err", LOG_ERR },
{ "error", LOG_ERR }, /* DEPRECATED */
{ "info", LOG_INFO },
{ "none", INTERNAL_NOPRI }, /* INTERNAL */
{ "notice", LOG_NOTICE },
{ "panic", LOG_EMERG }, /* DEPRECATED */
{ "warn", LOG_WARNING }, /* DEPRECATED */
{ "warning", LOG_WARNING },
{ NULL, -1 }
};

CODE facilitynames[] = {
{ "auth", LOG_AUTH },
{ "authpriv", LOG_AUTHPRIV },
{ "cron", LOG_CRON },
{ "daemon", LOG_DAEMON },
{ "ftp", LOG_FTP },
{ "kern", LOG_KERN },
{ "lpr", LOG_LPR },
{ "mail", LOG_MAIL },
{ "mark", INTERNAL_MARK }, /* INTERNAL */
{ "news", LOG_NEWS },
{ "security", LOG_AUTH }, /* DEPRECATED */
{ "syslog", LOG_SYSLOG },
{ "user", LOG_USER },
{ "uucp", LOG_UUCP },
{ "local0", LOG_LOCAL0 },
{ "local1", LOG_LOCAL1 },
{ "local2", LOG_LOCAL2 },
{ "local3", LOG_LOCAL3 },
{ "local4", LOG_LOCAL4 },
{ "local5", LOG_LOCAL5 },
{ "local6", LOG_LOCAL6 },
{ "local7", LOG_LOCAL7 },
{ NULL, -1 }
};
#endif

#ifndef __MLIBC_ABI_ONLY

void closelog(void);
Expand Down

0 comments on commit cc11837

Please sign in to comment.