NetBSD Problem Report #58608

From www@netbsd.org  Fri Aug 16 11:09:20 2024
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) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A29C71A9242
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 16 Aug 2024 11:09:20 +0000 (UTC)
Message-Id: <20240816110919.257121A9243@mollari.NetBSD.org>
Date: Fri, 16 Aug 2024 11:09:19 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: C23: <time.h> timespec_getres, timegm, TIME_*
X-Send-Pr-Version: www-1.0

>Number:         58608
>Category:       standards
>Synopsis:       C23: <time.h> timespec_getres, timegm, TIME_*
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 16 11:10:00 +0000 2024
>Last-Modified:  Tue Apr 22 14:30:02 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 10, 9
>Organization:
The NetBSD time23_t Foundation
>Environment:
>Description:
C23 7.29: Date and time <time.h>

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf#page=417

New timespec_get bases:
- TIME_MONOTONIC
- TIME_ACTIVE
- TIME_THREAD_ACTIVE

New functions:
- time_t timegm(struct tm *timeptr); (newly standard, needs visibility outside _NETBSD_SOURCE)
- int timespec_getres(struct timespec *ts, int base);

>How-To-Repeat:
standards inspection
>Fix:
Yes, please!

>Audit-Trail:
From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58608 CVS commit: src
Date: Mon, 21 Apr 2025 08:57:32 +0000

 Module Name:	src
 Committed By:	nia
 Date:		Mon Apr 21 08:57:32 UTC 2025

 Modified Files:
 	src/include: time.h
 	src/lib/libc/gen: timespec_get.3 timespec_get.c

 Log Message:
 libc: C23: Add TIME_MONOTONIC as a base for timespec_get

 PR standards/58608


 To generate a diff of this commit:
 cvs rdiff -u -r1.54 -r1.55 src/include/time.h
 cvs rdiff -u -r1.5 -r1.6 src/lib/libc/gen/timespec_get.3
 cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/timespec_get.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58608 CVS commit: src
Date: Mon, 21 Apr 2025 13:21:34 +0000

 Module Name:	src
 Committed By:	nia
 Date:		Mon Apr 21 13:21:33 UTC 2025

 Modified Files:
 	src/include: time.h
 	src/lib/libc/gen: Makefile.inc timespec_get.3
 Added Files:
 	src/lib/libc/gen: timespec_getres.3 timespec_getres.c

 Log Message:
 libc: C23: add timespec_getres(3) function

 timespec_getres is to timespec_get as clock_getres is to clock_gettime.

 PR standards/58608
 PR lib/59140


 To generate a diff of this commit:
 cvs rdiff -u -r1.55 -r1.56 src/include/time.h
 cvs rdiff -u -r1.223 -r1.224 src/lib/libc/gen/Makefile.inc
 cvs rdiff -u -r1.6 -r1.7 src/lib/libc/gen/timespec_get.3
 cvs rdiff -u -r0 -r1.1 src/lib/libc/gen/timespec_getres.3 \
     src/lib/libc/gen/timespec_getres.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58608 CVS commit: src
Date: Tue, 22 Apr 2025 13:48:24 +0000

 Module Name:	src
 Committed By:	nia
 Date:		Tue Apr 22 13:48:24 UTC 2025

 Modified Files:
 	src/distrib/sets/lists/debug: mi
 	src/distrib/sets/lists/tests: mi
 	src/tests/lib/libc/gen: Makefile
 Added Files:
 	src/tests/lib/libc/gen: t_timespec_get.c

 Log Message:
 Add basic tests for timespec_get(3), timespec_getres(3)

 PR standards/58608


 To generate a diff of this commit:
 cvs rdiff -u -r1.477 -r1.478 src/distrib/sets/lists/debug/mi
 cvs rdiff -u -r1.1370 -r1.1371 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.59 -r1.60 src/tests/lib/libc/gen/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/gen/t_timespec_get.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/58608 CVS commit: src
Date: Tue, 22 Apr 2025 14:27:00 +0000

 Do we want to support TIME_ACTIVE and TIME_THREAD_ACTIVE? These are
 optional.

 Do they map cleanly to CLOCK_PROCESS_CPUTIME_ID and
 CLOCK_THREAD_CPUTIME_ID or is more work needed?

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.