git: libc/libpthread: Add clock_getcpuclockid() and pthread_getcpuclockid().

Sascha Wildner swildner at crater.dragonflybsd.org
Wed Jul 26 11:01:24 PDT 2017


commit 725edadf86d63f56a584adf23265845c8590d734
Author: Sascha Wildner <saw at online.de>
Date:   Wed Jul 26 19:57:32 2017 +0200

    libc/libpthread: Add clock_getcpuclockid() and pthread_getcpuclockid().
    
    * Adjust clock_gettime() and clock_getres() to accept values obtained
      this way.
    
    * Also set _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME, although we should
      really support values obtained by these functions in clock_settime()
      too.
    
    Based on and taken from FreeBSD's code.
    
    Reviewed-by: sephe

Summary of changes:
 include/pthread.h                                  |  1 +
 include/time.h                                     | 10 ++-
 include/unistd.h                                   |  1 -
 lib/libc/gen/Makefile.inc                          |  4 +-
 lib/libc/gen/Symbol.map                            |  3 +
 lib/libc/gen/_pthread_stubs.c                      |  1 +
 .../clock_getcpuclockid.3}                         | 97 +++++++++++-----------
 .../libc/gen/clock_getcpuclockid.c                 | 16 ++--
 lib/libc/include/namespace.h                       |  1 +
 lib/libc/include/un-namespace.h                    |  1 +
 lib/libc/sys/Symbol.map                            |  6 ++
 lib/libc/sys/clock_gettime.2                       | 68 ++++++++-------
 lib/libpthread/Makefile                            |  1 +
 .../pthread_getcpuclockid.3}                       | 73 +++++++++-------
 lib/libthread_xu/pthread.map                       |  2 +
 lib/libthread_xu/thread/Makefile.inc               |  1 +
 .../{thr_getthreadid_np.c => thr_getcpuclockid.c}  | 18 ++--
 lib/libthread_xu/thread/thr_init.c                 |  2 +
 sys/kern/init_sysent.c                             |  1 +
 sys/kern/kern_time.c                               | 80 +++++++++++++++++-
 sys/kern/syscalls.c                                |  1 +
 sys/kern/syscalls.master                           |  1 +
 sys/sys/param.h                                    |  3 +-
 sys/sys/syscall.h                                  |  3 +-
 sys/sys/syscall.mk                                 |  3 +-
 sys/sys/sysproto.h                                 |  9 ++
 sys/sys/sysunion.h                                 |  1 +
 sys/sys/unistd.h                                   |  3 +-
 28 files changed, 281 insertions(+), 130 deletions(-)
 copy lib/libc/{iconv/__iconv_get_list.3 => gen/clock_getcpuclockid.3} (61%)
 copy include/bitstring.h => lib/libc/gen/clock_getcpuclockid.c (87%)
 copy lib/{libc/iconv/iconv_canonicalize.3 => libpthread/pthread_getcpuclockid.3} (65%)
 copy lib/libthread_xu/thread/{thr_getthreadid_np.c => thr_getcpuclockid.c} (76%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/725edadf86d63f56a584adf23265845c8590d734


-- 
DragonFly BSD source repository


More information about the Commits mailing list