[PATCH] nvptx: Provide stub 'gettimeofday'

Thomas Schwinge <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Instead of them FAILing due to 'unresolved symbol gettimeofday', this
makes PASS a number of GCC 'gfortran.dg' test cases, for example.
---
 newlib/libc/machine/nvptx/misc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/newlib/libc/machine/nvptx/misc.c b/newlib/libc/machine/nvptx/misc.c
index ef76eaae1..897ddc807 100644
--- a/newlib/libc/machine/nvptx/misc.c
+++ b/newlib/libc/machine/nvptx/misc.c
@@ -16,6 +16,8 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/time.h>
+
 #undef errno
 extern int errno;

@@ -29,6 +31,11 @@ fstat (int fd, struct stat *buf) {
   return -1;
 }

+int
+gettimeofday (struct timeval *tv, void *tz) {
+  return -1;
+}
+
 int
 isatty (int fd) {
   return fd == 1;
--
2.25.1

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.