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

Re: [Minios-devel] [UNIKRAFT PATCH 4/6] lib/uktime: Introduce POSIX timer stubs



On 06.12.19 14:41, Costin Lupu wrote:
We simply introduce the stubs for these functions. They will have to be
implemented later, therefore we do not add any license for now.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
  lib/uktime/Makefile.uk |  3 +++
  lib/uktime/timer.c     | 39 +++++++++++++++++++++++++++++++++++++++
  2 files changed, 42 insertions(+)
  create mode 100644 lib/uktime/timer.c

diff --git a/lib/uktime/Makefile.uk b/lib/uktime/Makefile.uk
index 47fbb4b3..7a039738 100644
--- a/lib/uktime/Makefile.uk
+++ b/lib/uktime/Makefile.uk
@@ -5,9 +5,12 @@ LIBUKTIME_COMMON_INCLUDES-y      += 
-I$(LIBUKTIME_BASE)/musl-imported/include
  CINCLUDES-$(CONFIG_LIBUKTIME)    += $(LIBUKTIME_COMMON_INCLUDES-y)
  CXXINCLUDES-$(CONFIG_LIBUKTIME)  += $(LIBUKTIME_COMMON_INCLUDES-y)
+LIBUKTIME_CFLAGS-y += -Wno-unused-parameter
+

We should not switch of compiler warnings to the core repository if avoidable. Could you use the `__unused` attribute macro from essentials.h for your stubs instead?

  LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/musl-imported/src/__month_to_secs.c
  LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/musl-imported/src/__secs_to_tm.c
  LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/musl-imported/src/timegm.c
  LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/musl-imported/src/__tm_to_secs.c
  LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/musl-imported/src/__year_to_secs.c
  LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/time.c
+LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/timer.c
diff --git a/lib/uktime/timer.c b/lib/uktime/timer.c
new file mode 100644
index 00000000..60d159c9
--- /dev/null
+++ b/lib/uktime/timer.c
@@ -0,0 +1,39 @@
+#include <errno.h>
+#include <time.h>
+#include <uk/print.h>
+
+
+int timer_create(clockid_t clockid, struct sigevent *__restrict sevp, timer_t 
*__restrict timerid)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_delete(timer_t timerid)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_settime(timer_t timerid, int flags, const struct itimerspec 
*__restrict new_value, struct itimerspec *__restrict old_value)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_gettime(timer_t timerid, struct itimerspec *curr_value)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_getoverrun(timer_t timerid)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -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®.