about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/clock_settime.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-08-16 14:03:43 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-08-16 14:03:43 +0000
commit93a78ac437ba44f493333d7e2a4b0249839ce460 (patch)
treebe93f2f5a76313d6decc7ccca7623671e23c7974 /sysdeps/unix/sysv/linux/clock_settime.c
parent4b4f2771c217d7b038bcfc17c985ba057da554db (diff)
downloadglibc-93a78ac437ba44f493333d7e2a4b0249839ce460.tar.gz
glibc-93a78ac437ba44f493333d7e2a4b0249839ce460.tar.xz
glibc-93a78ac437ba44f493333d7e2a4b0249839ce460.zip
Remove __ASSUME_POSIX_TIMERS.
Diffstat (limited to 'sysdeps/unix/sysv/linux/clock_settime.c')
-rw-r--r--sysdeps/unix/sysv/linux/clock_settime.c74
1 files changed, 10 insertions, 64 deletions
diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c
index 8cf3209803..f75ceca249 100644
--- a/sysdeps/unix/sysv/linux/clock_settime.c
+++ b/sysdeps/unix/sysv/linux/clock_settime.c
@@ -32,7 +32,6 @@
 #endif
 
 #if __ASSUME_POSIX_CPU_TIMERS <= 0 && defined __NR_clock_settime
-extern int __libc_missing_posix_timers attribute_hidden;
 extern int __libc_missing_posix_cpu_timers attribute_hidden;
 
 static int
@@ -48,26 +47,15 @@ maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
 	return 0;
 
       e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
-      if (e == ENOSYS)
+      if (e == EINVAL)
 	{
-	  __libc_missing_posix_timers = 1;
-	  __libc_missing_posix_cpu_timers = 1;
-	  e = EINVAL;
-	}
-      else
-# endif
-	{
-	  if (e == EINVAL)
-	    {
-	      /* Check whether the kernel supports CPU clocks at all.
-		 If not, record it for the future.  */
-	      r = INTERNAL_VSYSCALL (clock_getres, err, 2,
-				     MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
-				     NULL);
-	      if (INTERNAL_SYSCALL_ERROR_P (r, err))
-		__libc_missing_posix_cpu_timers = 1;
-	    }
+	  /* Check whether the kernel supports CPU clocks at all.
+	     If not, record it for the future.  */
+	  r = INTERNAL_VSYSCALL (clock_getres, err, 2,
+				 MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
+				 NULL);
+	  if (INTERNAL_SYSCALL_ERROR_P (r, err))
+	    __libc_missing_posix_cpu_timers = 1;
 	}
     }
 
@@ -76,53 +64,11 @@ maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
 #endif
 
 
-#ifdef __ASSUME_POSIX_TIMERS
-/* This means the REALTIME clock is definitely supported in the
-   kernel.  */
-# define SYSDEP_SETTIME \
+/* The REALTIME clock is definitely supported in the kernel.  */
+#define SYSDEP_SETTIME \
   case CLOCK_REALTIME:							      \
     retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp);		      \
     break
-#elif defined __NR_clock_settime
-/* Is the syscall known to exist?  */
-extern int __libc_missing_posix_timers attribute_hidden;
-
-/* The REALTIME clock might be available.  Try the syscall first.  */
-# define SYSDEP_SETTIME \
-  case CLOCK_REALTIME:							      \
-  case CLOCK_REALTIME_COARSE:						      \
-    {									      \
-      int e = EINVAL;							      \
-									      \
-      if (!__libc_missing_posix_timers)					      \
-	{								      \
-	  INTERNAL_SYSCALL_DECL (err);					      \
-	  int r = INTERNAL_SYSCALL (clock_settime, err, 2, clock_id, tp);     \
-	  if (!INTERNAL_SYSCALL_ERROR_P (r, err))			      \
-	    {								      \
-	      retval = 0;						      \
-	      break;							      \
-	    }								      \
-									      \
-	  e = INTERNAL_SYSCALL_ERRNO (r, err);				      \
-	  if (e == ENOSYS)						      \
-	    {								      \
-	      __libc_missing_posix_timers = 1;				      \
-	      e = EINVAL;						      \
-	    }								      \
-	}								      \
-									      \
-      /* Fallback code.  */						      \
-      if (e == EINVAL && clock_id == CLOCK_REALTIME)			      \
-	HANDLE_REALTIME;						      \
-      else								      \
-	{								      \
-	  __set_errno (e);						      \
-	  retval = -1;							      \
-	}								      \
-    }									      \
-    break
-#endif
 
 #ifdef __NR_clock_settime
 /* We handled the REALTIME clock here.  */