NetBSD Problem Report #59246

From www@netbsd.org  Wed Apr  2 02:49:10 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 96F2D1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  2 Apr 2025 02:49:10 +0000 (UTC)
Message-Id: <20250402024909.6313B1A923E@mollari.NetBSD.org>
Date: Wed,  2 Apr 2025 02:49:09 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: clock_nanosleep return value audit
X-Send-Pr-Version: www-1.0

>Number:         59246
>Category:       misc
>Synopsis:       clock_nanosleep return value audit
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 02 02:50:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetBSD_Nanosleep Erroration
>Environment:
>Description:
Unlike most system calls, clock_nanosleep returns an error code, rather than returning -1 and setting errno.

I have written some calls that got this wrong, e.g. using the RL macro in atf tests (check for -1, report errno) when it should use RZ.

Time to audit all the callers for this class of mistakes!
>How-To-Repeat:
code inspection
>Fix:
Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.49 2026/05/14 01:52:41 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.