use glibc syscall wrapper for clock_gettime
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 29 Jan 2018 08:03:38 +0000 (09:03 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 8 Aug 2018 11:42:29 +0000 (13:42 +0200)
These are available on any non-ancient system by now so it’s safe
to drop them.

src/timefunc.cpp

index 245c95e..e8b1917 100644 (file)
@@ -37,7 +37,6 @@ on this file might be covered by the GNU General Public License.
 #include <unistd.h>
 #include <string.h>
 #include <sys/timeb.h>
-#include <sys/syscall.h>
 
 #include <timefunc.hxx>
 #include <i18n.h>
@@ -723,7 +722,7 @@ Intervals& Intervals::operator-=(const Intervals& other)
 bool monotonic_clock_gettime(long int& seconds, long int& nano_seconds)
 {
     struct timespec tp[1];
-    int res= ::syscall(__NR_clock_gettime, CLOCK_MONOTONIC, tp);
+    int res= clock_gettime (CLOCK_MONOTONIC, tp);
     if (0 == res)
     {
         seconds= tp->tv_sec;
@@ -762,7 +761,7 @@ long long monotonic_clock_gettime_nano()
 bool realtime_clock_gettime(long int& seconds, long int& nano_seconds)
 {
     struct timespec tp[1];
-    int res= ::syscall(__NR_clock_gettime, CLOCK_REALTIME, tp);
+    int res= clock_gettime(CLOCK_REALTIME, tp);
     if (0 == res)
     {
         seconds= tp->tv_sec;