]> xenbits.xensource.com Git - unikraft/libs/pthread-embedded.git/commitdiff
Add pthread_condattr_{get, set}clock() stubs
authorCostin Lupu <costin.lupu@cs.pub.ro>
Fri, 6 Dec 2019 13:12:31 +0000 (15:12 +0200)
committerCostin Lupu <costin.lupu@cs.pub.ro>
Mon, 9 Dec 2019 05:46:48 +0000 (07:46 +0200)
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Makefile.uk
include/pthread.h
pthread_condattr.c [new file with mode: 0644]

index 90626e844079f381b32eb04880c49affbdd56776..89eb3452ca2c2b6ae4492dbaebf897c68837ecf0 100644 (file)
@@ -68,6 +68,7 @@ LIBPTHREAD-EMBEDDED_SRCS-y += $(LIBPTHREAD-EMBEDDED_BASE)/pte_osal.c|glue
 LIBPTHREAD-EMBEDDED_SRCS-y += $(LIBPTHREAD-EMBEDDED_BASE)/attributes.c|glue
 LIBPTHREAD-EMBEDDED_SRCS-y += $(LIBPTHREAD-EMBEDDED_BASE)/pthread_atfork.c|glue
 LIBPTHREAD-EMBEDDED_SRCS-y += $(LIBPTHREAD-EMBEDDED_BASE)/pthread_sigmask.c|glue
+LIBPTHREAD-EMBEDDED_SRCS-y += $(LIBPTHREAD-EMBEDDED_BASE)/pthread_condattr.c|glue
 
 ################################################################################
 # pthread-embedded code
index a71fe34957f1bdca8a08c0877405d97738fe0118..077017ed07904e551e92d9bf26e5765bdc237b12 100644 (file)
@@ -57,6 +57,10 @@ int pthread_setname_np(pthread_t thread, const char *name);
 int pthread_getname_np(pthread_t thread, char *name, size_t len);
 #endif /* _GNU_SOURCE */
 
+int pthread_condattr_getclock(const pthread_condattr_t *__restrict attr,
+               clockid_t *__restrict clock_id);
+int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/pthread_condattr.c b/pthread_condattr.c
new file mode 100644 (file)
index 0000000..53dcc64
--- /dev/null
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: LGPL-2.0-or-later */
+/*
+ *      Unikraft port of POSIX Threads Library for embedded systems
+ *      Copyright(C) 2019 Costin Lupu, University Politehnica of Bucharest
+ *
+ *      This library is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU Lesser General Public
+ *      License as published by the Free Software Foundation; either
+ *      version 2 of the License, or (at your option) any later version.
+ *
+ *      This library is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *      Lesser General Public License for more details.
+ *
+ *      You should have received a copy of the GNU Lesser General Public
+ *      License along with this library in the file COPYING.LIB;
+ *      if not, write to the Free Software Foundation, Inc.,
+ *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <uk/print.h>
+#include <errno.h>
+#include <time.h>
+#include <pthread.h>
+
+
+int pthread_condattr_getclock(const pthread_condattr_t *__restrict attr,
+               clockid_t *__restrict clock_id)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
+int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}