This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14438] clock_gettime CLOCK_THREAD_CPUTIME_ID doesn't delegate to vsyscall


http://sourceware.org/bugzilla/show_bug.cgi?id=14438

--- Comment #5 from Siddhesh Poyarekar <siddhesh at redhat dot com> ---
It calls vdso_clock_gettime for all clockids.  If vdso function has support for
some clockids but not others, for which it does a context switch into the
kernel.

sysdeps/unix/clock_gettime.c:
...
    default:
#ifdef SYSDEP_GETTIME_CPU
      SYSDEP_GETTIME_CPU (clock_id, tp);
#endif
...

sysdeps/unix/sysv/linux/clock_gettime.c
...
#define SYSDEP_GETTIME_CPU(clock_id, tp) \
  retval = SYSCALL_GETTIME (clock_id, tp); \
  break
...

sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
...
# define SYSCALL_GETTIME(id, tp) \
  ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
  long int v_ret;                                                         \
  PTR_DEMANGLE (f);                                                       \
  v_ret = f (id, tp);                                                     \
  if (INTERNAL_SYSCALL_ERROR_P (v_ret, )) {                               \
    __set_errno (INTERNAL_SYSCALL_ERRNO (v_ret, ));                       \
    v_ret = -1;                                                           \
  }                                                                       \
  v_ret; })
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]