git: nanosleep(2): Return EINVAL if tv_sec < 0 (POSIX-compliant)

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


commit af23a4c2dab7b68bbde7d5141dbace6f93b11646
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Jan 18 12:41:41 2021 +0800

    nanosleep(2): Return EINVAL if tv_sec < 0 (POSIX-compliant)
    
    When the requested sleep interval is negative, return EINVAL.  This
    behavior is the same as Linux and makes our nanosleep(2) pass all tests
    in the Open POSIX Test Suite [0].
    
    conformance/interfaces/nanosleep/1-1: execution: PASS
    conformance/interfaces/nanosleep/1-2: execution: PASS
    conformance/interfaces/nanosleep/1-3: execution: PASS
    conformance/interfaces/nanosleep/2-1: execution: PASS
    conformance/interfaces/nanosleep/3-1: execution: PASS
    conformance/interfaces/nanosleep/3-2: execution: PASS
    conformance/interfaces/nanosleep/4-1: execution: PASS
    conformance/interfaces/nanosleep/5-1: execution: PASS
    conformance/interfaces/nanosleep/5-2: execution: PASS
    conformance/interfaces/nanosleep/6-1: execution: PASS
    conformance/interfaces/nanosleep/7-1: execution: PASS
    conformance/interfaces/nanosleep/7-2: execution: PASS
    conformance/interfaces/nanosleep/10000-1: execution: PASS
    
    [0] Open POSIX Test Suite: http://posixtest.sourceforge.net/

Summary of changes:
 sys/kern/kern_time.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/af23a4c2dab7b68bbde7d5141dbace6f93b11646


-- 
DragonFly BSD source repository


More information about the Commits mailing list