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

[Minios-devel] [UNIKRAFT PATCH v3 1/3] lib/uktime: Introduce POSIX timer stubs



From: Costin Lupu <costin.lupu@xxxxxxxxx>

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>
Signed-off-by: Stefan Teodorescu <stefanl.teodorescu@xxxxxxxxx>
---
 lib/uktime/Makefile.uk   |  1 +
 lib/uktime/exportsyms.uk |  5 +++
 lib/uktime/timer.c       | 80 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+)
 create mode 100644 lib/uktime/timer.c

diff --git a/lib/uktime/Makefile.uk b/lib/uktime/Makefile.uk
index 47fbb4b3..2976a10f 100644
--- a/lib/uktime/Makefile.uk
+++ b/lib/uktime/Makefile.uk
@@ -11,3 +11,4 @@ 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/exportsyms.uk b/lib/uktime/exportsyms.uk
index bd9c49cf..82b70b7f 100644
--- a/lib/uktime/exportsyms.uk
+++ b/lib/uktime/exportsyms.uk
@@ -9,3 +9,8 @@ timegm
 times
 usleep
 utime
+timer_create
+timer_delete
+timer_settime
+timer_gettime
+timer_getoverrun
diff --git a/lib/uktime/timer.c b/lib/uktime/timer.c
new file mode 100644
index 00000000..0c8db40d
--- /dev/null
+++ b/lib/uktime/timer.c
@@ -0,0 +1,80 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Costin Lupu <costin.lupu@xxxxxxxxx>
+ *
+ * Copyright (c) 2019, University Politehnica of Bucharest. All rights 
reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+
+#include <errno.h>
+#include <time.h>
+#include <uk/essentials.h>
+#include <uk/print.h>
+
+
+int timer_create(clockid_t clockid __unused,
+               struct sigevent *__restrict sevp __unused,
+               timer_t *__restrict timerid __unused)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_delete(timer_t timerid __unused)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_settime(timer_t timerid __unused,
+               int flags __unused,
+               const struct itimerspec *__restrict new_value __unused,
+               struct itimerspec *__restrict old_value __unused)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_gettime(timer_t timerid __unused,
+               struct itimerspec *curr_value __unused)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int timer_getoverrun(timer_t timerid __unused)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
-- 
2.25.0


_______________________________________________
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®.