summaryrefslogtreecommitdiff
path: root/src/drivers/Posix
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Posix')
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.H3
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx11
2 files changed, 12 insertions, 2 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.H b/src/drivers/Posix/Fl_Posix_System_Driver.H
index fb33d9e9e..5b2060283 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.H
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.H
@@ -4,7 +4,7 @@
// Definition of Posix system driver
// for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2016 by Bill Spitzak and others.
+// Copyright 2010-2017 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -74,6 +74,7 @@ public:
virtual int file_type(const char *filename);
virtual const char *home_directory_name() { return ::getenv("HOME"); }
virtual int dot_file_hidden() {return 1;}
+ virtual void gettime(time_t *sec, int *usec);
};
#endif // FL_POSIX_SYSTEM_DRIVER_H
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
index 9fb0fc5cd..c2576b268 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -3,7 +3,7 @@
//
// Definition of Apple Darwin system driver.
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2017 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -30,6 +30,7 @@
#endif
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <pwd.h>
#include <unistd.h>
#include <time.h>
@@ -90,6 +91,14 @@ const char *Fl_Posix_System_Driver::getpwnam(const char *login) {
return pwd ? pwd->pw_dir : NULL;
}
+
+void Fl_Posix_System_Driver::gettime(time_t *sec, int *usec) {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ *sec = tv.tv_sec;
+ *usec = tv.tv_usec;
+}
+
//
// End of "$Id$".
//