--- a/clock_gettime.c
+++ b/clock_gettime.c
@@ -29,8 +29,8 @@ int clock_gettime(clockid_t clk_id UNUSE
     struct timeval tv;
     if (gettimeofday(&tv, NULL) < 0)
 	return -1;
-    tp->ts_sec = tv.tv_sec;
-    tp->ts_nsec = tv.tv_usec * 1000;
+    tp->tv_sec = tv.tv_sec;
+    tp->tv_nsec = tv.tv_usec * 1000;
     /* paranoid programming */
     if (1000000 <= (tv)->tv_usec) {
 	(tv)->tv_usec -= 1000000;
