git: Implement clock_nanosleep(2) system call

Aaron LI aly at crater.dragonflybsd.org
Tue Jan 19 05:57:53 PST 2021


commit 86ccdacbb5c12b58383e4e562abc3f6c8240249a
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Jan 17 16:08:41 2021 +0800

    Implement clock_nanosleep(2) system call
    
    * Extend the nanosleep1() function in kern_time.c to support the
      clock_nanosleep(2) system call.  Add {kern,sys}_clock_nanosleep()
      functions and update kern_nanosleep() accordingly.
    
    * Add clock_nanosleep() syscall to syscalls.master and regenerate
      syscall-related files.
    
    * Update libc symbols with the new syscall.
    
    * Add clock_nanosleep() warpper in libthread_xu.
    
    * Update nanosleep.2 man page to describe clock_nanosleep().
    
    * Update <time.h> and bump __DragonFly_version.
    
    This work is loosely based on the FreeBSD implementation:
    https://reviews.freebsd.org/rS315526
    
    This clock_nanosleep(2) syscall passed all tests in the Open POSIX Test
    Suite [0]:
    
    conformance/interfaces/clock_nanosleep/1-1: execution: PASS
    conformance/interfaces/clock_nanosleep/1-2: execution: PASS
    conformance/interfaces/clock_nanosleep/1-3: execution: PASS
    conformance/interfaces/clock_nanosleep/1-4: execution: PASS
    conformance/interfaces/clock_nanosleep/1-5: execution: PASS
    conformance/interfaces/clock_nanosleep/2-1: execution: PASS
    conformance/interfaces/clock_nanosleep/2-2: execution: PASS
    conformance/interfaces/clock_nanosleep/2-3: execution: PASS
    conformance/interfaces/clock_nanosleep/3-1: execution: PASS
    conformance/interfaces/clock_nanosleep/4-1: execution: PASS
    conformance/interfaces/clock_nanosleep/5-1: execution: PASS
    conformance/interfaces/clock_nanosleep/6-1: execution: PASS
    conformance/interfaces/clock_nanosleep/9-1: execution: PASS
    conformance/interfaces/clock_nanosleep/8-1: execution: PASS
    conformance/interfaces/clock_nanosleep/10-1: execution: PASS
    conformance/interfaces/clock_nanosleep/11-1: execution: PASS
    conformance/interfaces/clock_nanosleep/13-1: execution: PASS
    conformance/interfaces/clock_nanosleep/15-1: execution: PASS
    
    [0] Open POSIX Test Suite: http://posixtest.sourceforge.net/
    
    Reviewed-by: swildner, dillon, tuxillo, zach

Summary of changes:
 include/time.h                         |   2 +-
 lib/libc/include/namespace.h           |   1 +
 lib/libc/include/un-namespace.h        |   1 +
 lib/libc/sys/Makefile.inc              |   5 +-
 lib/libc/sys/Symbol.map                |   6 ++
 lib/libc/sys/nanosleep.2               | 185 ++++++++++++++++++++++++++++-----
 lib/libpthread/pthread_testcancel.3    |   3 +-
 lib/libthread_xu/thread/thr_private.h  |   2 +
 lib/libthread_xu/thread/thr_syscalls.c |  20 ++++
 sys/kern/init_sysent.c                 |   2 +-
 sys/kern/kern_time.c                   | 136 +++++++++++++++++++-----
 sys/kern/syscalls.c                    |   2 +-
 sys/kern/syscalls.master               |   4 +-
 sys/sys/param.h                        |   3 +-
 sys/sys/syscall.h                      |   1 +
 sys/sys/syscall.mk                     |   1 +
 sys/sys/sysproto.h                     |   7 ++
 sys/sys/sysunion.h                     |   1 +
 sys/sys/time.h                         |  10 +-
 19 files changed, 329 insertions(+), 63 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/86ccdacbb5c12b58383e4e562abc3f6c8240249a


-- 
DragonFly BSD source repository



More information about the Commits mailing list