]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
Add missing stubs and declarations to support Ruby
authorCostin Lupu <costin.lupu@cs.pub.ro>
Fri, 6 Dec 2019 13:25:16 +0000 (15:25 +0200)
committerCostin Lupu <costin.lupu@cs.pub.ro>
Mon, 9 Dec 2019 20:43:05 +0000 (22:43 +0200)
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Stefan Teodorescu <stefanl.teodorescu@gmail.com>
console.c
file.c
include/fcntl.h
include/sys/poll.h
signal.c

index bf9cfe8a95ff3dfb3968ffb64687d5825f7941c4..6ec84cdc95b38653a8abdebc53132a1ca6c7bb9c 100644 (file)
--- a/console.c
+++ b/console.c
@@ -38,6 +38,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <uk/essentials.h>
+#include <uk/print.h>
 
 int isatty(int fd)
 {
@@ -63,3 +64,10 @@ char *ctermid(char *s __unused)
 {
        return 0;
 }
+
+int grantpt(int fd)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
diff --git a/file.c b/file.c
index 7a6e04640a5aed2c1173455f0ebcc11555964c2a..4d5de248d3eae9173490a772aebfdc2562656c68 100644 (file)
--- a/file.c
+++ b/file.c
@@ -38,6 +38,7 @@
 #include <uk/config.h>
 #include <uk/sched.h>
 #include <uk/plat/console.h>
+#include <uk/print.h>
 #if CONFIG_LWIP_SOCKET
 #include <lwip/sockets.h>
 #else
@@ -79,6 +80,13 @@ int select(int nfds, fd_set *readfds __unused, fd_set *writefds __unused,
 }
 #endif /* !CONFIG_LWIP_SOCKET */
 
+int eventfd(unsigned int initval, int flags)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}
+
 char *realpath(const char *restrict file_name, char *restrict resolved_name)
 {
        return 0;
index cb271d26a07c0c1343de874b917b7199d64f8611..feb4f7c2fc792600121aeabb1911516db6248441 100644 (file)
@@ -46,4 +46,6 @@
 #define AT_EMPTY_PATH 0x1000
 #endif
 
+int posix_fadvise(int fd, off_t offset, off_t len, int advice);
+
 #endif
index 0827738b951e198fb6f249d849ae88d7301e3923..446ab3f8df2081671bb945a0284e8a65ff0e937b 100644 (file)
@@ -84,4 +84,9 @@ struct pollfd {
 
 int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
 
+#ifdef _GNU_SOURCE
+int ppoll(struct pollfd *fds, nfds_t nfds,
+        const struct timespec *tmo_p, const sigset_t *sigmask);
+#endif
+
 #endif /* _POSIX_SYS_POLL_H_ */
index 0530291e31d58db491a66b140369cdd9c1b81d6c..4279ee7e08521e4e2ce2d6a0ed02873cbd9172fb 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -33,6 +33,7 @@
  */
 
 #include <uk/process.h>
+#include <uk/print.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -77,3 +78,10 @@ int killpg(int pgrp, int sig __unused)
                errno = ESRCH;
        return -1;
 }
+
+int sigaltstack(const stack_t *ss, stack_t *old_ss)
+{
+       WARN_STUBBED();
+       errno = ENOTSUP;
+       return -1;
+}