[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/NEWLIB PATCH 1/6] syslog.h: Import from musl


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Wed, 14 Aug 2019 21:57:00 +0300
  • Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx, Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
  • Delivery-date: Wed, 14 Aug 2019 18:57:23 +0000
  • Ironport-phdr: 9a23:lAx52xPCGcdAByDLIAIl6mtUPXoX/o7sNwtQ0KIMzox0K/zyosbcNUDSrc9gkEXOFd2Cra4d0ayP6fGrBzNIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfK1+IA+roQnPssQajopvJ6QswRbVv3VEfPhby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnDUBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulSwKLCAy/n3JhcNsjaJbuBOhqAJ5w47Ie4GeKf5ycrrAcd8GWWZNW8BcXDFDDIyhdYsCF+oPM/hFoYfzpFUAqhmxBQe3Ce/z1jNFnGP60Lcm3+g9FwzNwQwuH8gJsHTRtNj4KqASUfupzKnJyzXIcvVY2Srl6IjVbxsspu2DXbVrccrNyEkvERnJjlGNqYz9IjOYzfgCs3OB4+p4SOKgkHQrqxt2ojW2wMonl4fHhoUQyl/e9CV5xp44JdilSE5gZd6oCZ9QtyCBOIRqWM8iRHtouCk8x7YbupC7ZDAHxIkoyhLCcfCKcIiF7gj9WOqPIzp0nnxodKqiixu97ESs0O7xW8mu3FpUoCdInMPAum0C2hDN7MWMV+Fz8V272TmV0gDe8uREIUcpmqXFM5Mh2bswloYLsUTEAy/2hF36jK+IeUUg/eil8/rnYrD8qZ+dM494kB3xMr80lsynHOQ3KRICX3Kc+eik1b3j+1P2QKlSg/ErnaTVrYrWKMcbq6KjHQNZzIQu5wyxAju+1dQXh3gHLFZLeBKdiIjpPknDL+z/Dfekn1SskTFry+rCPr38GpXNM2POn6v6fbpn805c1RE8wcpF55JTEr0BOu78WlfttNzECR80Kwi0zPz8CNphy4MSQ3mAAqiWMKzPq1CI4OYiLuiXaY8avTbyMfkl5/r0gXAlnl8deLGj3YELZ3CgAvRmP0KZbGLpgtcAF2cKvw0+TPfzhFKfTzFTeWi9X6Yn6zE/CYKmFpvDRpu3jL2Owii7GIdaZmdcClCDCX3obZmLW+8QaCKOJc9sijIEWqalS48gzRGhqhX2y7p6LurV5iIYtInu1N5r6OLPkRE97yd7A96D3GGQV2t0hH8HRycq3KBjpkxw0kyD0ahijPxCD9NT4elFUhwgOp7a0+x6C8r9WgTbcdeMU1umRMupDi01Tt0r2NACeVhyG8i6hBDZwyWqG6MVl6CMBJEs6aLc3n3xJ8F7y3rc16khkkcpQs1ONGK4nK5y7A7TCJDVnEWdjamlbr4Q0zDQ9DTL8W3buUBeUQlrFKnIQ30bTk/XtsjioFPPSfmpE7t0HBFGzJupLbBWa9uhqUheWb+3M9PFf2O33WOtHQugzajKdJfgPX8ainaOQHMYmhweqC7VfTM1AT2s9ieHVGRj
  • Ironport-sdr: ul7MYGyEFj29kBUBBHxVnSSeHjS/klGLr2ui4/fu3hQAClITPBTMvIm+rdhnlEHX383KJE5Kfg WWTXH/mOPg2w==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

From: Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>

Copied as is from the official musl git mirror
git://git.musl-libc.org/musl, commit 6fcb440d.

Original file locations:
* include/sys/syslog.h
* include/syslog.h

Signed-off-by: Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 musl-imported/include/sys/syslog.h |   1 +
 musl-imported/include/syslog.h     | 100 +++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)
 create mode 100644 musl-imported/include/sys/syslog.h
 create mode 100644 musl-imported/include/syslog.h

diff --git a/musl-imported/include/sys/syslog.h 
b/musl-imported/include/sys/syslog.h
new file mode 100644
index 0000000..7761ece
--- /dev/null
+++ b/musl-imported/include/sys/syslog.h
@@ -0,0 +1 @@
+#include <syslog.h>
diff --git a/musl-imported/include/syslog.h b/musl-imported/include/syslog.h
new file mode 100644
index 0000000..5b4d296
--- /dev/null
+++ b/musl-imported/include/syslog.h
@@ -0,0 +1,100 @@
+#ifndef _SYSLOG_H
+#define _SYSLOG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <features.h>
+
+#define LOG_EMERG   0
+#define LOG_ALERT   1
+#define LOG_CRIT    2
+#define LOG_ERR     3
+#define LOG_WARNING 4
+#define LOG_NOTICE  5
+#define LOG_INFO    6
+#define LOG_DEBUG   7
+
+#define LOG_PRIMASK 7
+#define LOG_PRI(p) ((p)&LOG_PRIMASK)
+#define        LOG_MAKEPRI(f, p) (((f)<<3)|(p))
+
+#define LOG_MASK(p) (1<<(p))
+#define LOG_UPTO(p) ((1<<((p)+1))-1)
+
+#define LOG_KERN     (0<<3)
+#define LOG_USER     (1<<3)
+#define LOG_MAIL     (2<<3)
+#define LOG_DAEMON   (3<<3)
+#define LOG_AUTH     (4<<3)
+#define LOG_SYSLOG   (5<<3)
+#define LOG_LPR      (6<<3)
+#define LOG_NEWS     (7<<3)
+#define LOG_UUCP     (8<<3)
+#define LOG_CRON     (9<<3)
+#define        LOG_AUTHPRIV (10<<3)
+#define        LOG_FTP      (11<<3)
+
+#define LOG_LOCAL0   (16<<3)
+#define LOG_LOCAL1   (17<<3)
+#define LOG_LOCAL2   (18<<3)
+#define LOG_LOCAL3   (19<<3)
+#define LOG_LOCAL4   (20<<3)
+#define LOG_LOCAL5   (21<<3)
+#define LOG_LOCAL6   (22<<3)
+#define LOG_LOCAL7   (23<<3)
+
+#define LOG_NFACILITIES 24
+#define LOG_FACMASK 0x3f8
+#define LOG_FAC(p) (((p)&LOG_FACMASK)>>3)
+
+#define LOG_PID    0x01
+#define LOG_CONS   0x02
+#define LOG_ODELAY 0x04
+#define LOG_NDELAY 0x08
+#define LOG_NOWAIT 0x10
+#define LOG_PERROR 0x20
+
+void closelog (void);
+void openlog (const char *, int, int);
+int setlogmask (int);
+void syslog (int, const char *, ...);
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define _PATH_LOG "/dev/log"
+#define __NEED_va_list
+#include <bits/alltypes.h>
+void vsyslog (int, const char *, va_list);
+#if defined(SYSLOG_NAMES)
+#define        INTERNAL_NOPRI 0x10
+#define        INTERNAL_MARK (LOG_NFACILITIES<<3)
+typedef struct {
+       char *c_name;
+       int c_val;
+} CODE;
+#define prioritynames ((CODE *)(const CODE []){ \
+       { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "debug", LOG_DEBUG }, \
+       { "emerg", LOG_EMERG }, { "err", LOG_ERR }, { "error", LOG_ERR }, \
+       { "info", LOG_INFO }, { "none", INTERNAL_NOPRI }, \
+       { "notice", LOG_NOTICE }, { "panic", LOG_EMERG }, \
+       { "warn", LOG_WARNING }, { "warning", LOG_WARNING }, { 0, -1 } })
+#define facilitynames ((CODE *)(const CODE []){ \
+       { "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 }, { "news", LOG_NEWS }, \
+       { "security", LOG_AUTH }, { "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 }, { 0, -1 } })
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.