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

[Minios-devel] [UNIKRAFT/NEWLIB PATCH 4/6] syslog.c: Make it compile


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Wed, 14 Aug 2019 21:57:03 +0300
  • Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx
  • Delivery-date: Wed, 14 Aug 2019 18:57:20 +0000
  • Ironport-phdr: 9a23:buZXYhCs6oYP2wzX6jJyUyQJP3N1i/DPJgcQr6AfoPdwSPX/ocbcNUDSrc9gkEXOFd2Cra4d0ayP6fGrBzNIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfK1+IA+roQnPssQajopvJ6QswRbVv3VEfPhby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnDUBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulSwKMSMy/mPKhcxqlK9VoAyvqQFxzYDXZ4+aNvR+c7jBcd8GX2dNQtxcWzBdDo66coABD/ABPeFdr4TluVYOqgC+BRWtBOPp1zRGgGL23bUn0+88FgzJwAsgH8kSsHTVqtX5LqMSUf2tzKnV1jjMc+hW1S3l6IjVaR8tu+uMXbVpfMfX1EIhFBvFg02NpYHqIj+ZzOcAvmiB4+Z+S+6iiXQrpg9prjSyycogl5PFi4EVx1ze6yl0zog4KcelREN0f9KpFoZbuTuAOItsWMwiRnlluCM9yrIbp5G2ZDMKyJE7xx7HbPyHbpSI7grjVOmPJTd4g2poeKy6hxmo8EigzvfwWdWv0FpQtipFj8LDumoX1xzU8sSHS/198Vm92TuXygze5fxILVo3mKfbMZIt3KA8m5gJvUnNBiP2nV/5jK6SdkUq4Oio7OHnb636qZ+bLI90lgD+MqI0lsy7HOQ4KhUOUnOH9uSnzrHj5VD5T65Qgv0slanVqIraKtgDpq6lHw9V1Z4u6xO+Dzeg0dQYmmIHIEtYdx2ZkYjmJVXOLev8Dfe+mFSsjCxry+rJP7L/BJXBNH/DkK3ufbxl8U5T1BIzzcxD55JTErwBLuz8WkvwtNzAEBA1KQy0w/vmCNph14MTQmSPDbGFP6PWq1CH/fgjLPeRZIUNojbyN+Al5+LyjX8+gVIdZqmp0oENaH+iGPRqOV6ZbmDqgtcdEWcFpAw+Q/bviFCZVz5ceWq9X6Ym6T4gEo6pE5rDTJi3gLOdxCe7AoFWZmdeB1CXEHfocoKEW/EWZCKRP89ujDoEVLm/RI87zhyushH1xKZjLuXO4SIUr4zs1MUmr9HUwBQz8z1zFIGR3n+AS0lwn3gUXHkm0aY5plZymXmZ1q0tqPtDCd1Vr9dUShpyYZXb1PB7DZb2RxrcVtySDk67SJO8BmdiHZoK39YSbhMlSJ2ZhRfZ0n/yDg==
  • Ironport-sdr: TOODwYcq34+hCd7/1cdxydg3a7+CaW1jR1TyDVMt2K1CiOL+/yfCUitNUF5uKpY80gZTfDv6ei X5E1m4hG2qRA==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

* Use Unikraft mutex
* Replace __syslog_chk() with syslog()

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Makefile.uk                |  1 +
 musl-imported/src/syslog.c | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Makefile.uk b/Makefile.uk
index a4e9f6a..12e5e7e 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -113,6 +113,7 @@ LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/time.c|glue
 LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/locale.c
 LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/dev.c
 LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/signal.c
+LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/syslog.c
 LIBNEWLIBGLUE_SRCS-y += 
$(LIBNEWLIBC_BASE)/musl-imported/src/termios/tcsetattr.c
 LIBNEWLIBGLUE_SRCS-y += 
$(LIBNEWLIBC_BASE)/musl-imported/src/termios/tcgetattr.c
 
diff --git a/musl-imported/src/syslog.c b/musl-imported/src/syslog.c
index be7cfb6..941a175 100644
--- a/musl-imported/src/syslog.c
+++ b/musl-imported/src/syslog.c
@@ -7,9 +7,13 @@
 #include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <libc.h>
+#include <uk/mutex.h>
 
-static mutex_t lock;
+
+#define LOCK(x) uk_mutex_lock(&(x))
+#define UNLOCK(x) uk_mutex_unlock(&(x))
+
+static struct uk_mutex lock = UK_MUTEX_INITIALIZER(lock);
 static char log_ident[32];
 static int log_opt;
 static int log_facility = LOG_USER;
@@ -35,7 +39,7 @@ void closelog(void)
 {
 }
 
-void __syslog_chk(int priority, int flag, const char *message, ...)
+void syslog(int priority, const char *message, ...)
 {
     LOCK(lock);
 
@@ -70,4 +74,3 @@ void __syslog_chk(int priority, int flag, const char 
*message, ...)
 
     UNLOCK(lock);
 }
-
-- 
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®.