Received: by mail.netbsd.org (Postfix, from userid 605) id A37A385EB0; Tue, 4 Oct 2016 09:41:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 311A785E9A for ; Tue, 4 Oct 2016 09:41:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id YFnDgezAfFeP for ; Tue, 4 Oct 2016 09:41:41 +0000 (UTC) Received: from cvs.NetBSD.org (unknown [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 8BACE84C6C for ; Tue, 4 Oct 2016 09:41:41 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 86268FBD2; Tue, 4 Oct 2016 09:41:41 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Tue, 4 Oct 2016 09:41:41 +0000 From: "Kamil Rytarowski" Subject: CVS commit: src To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20161004094141.86268FBD2@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Kamil Rytarowski" Mail-Followup-To: source-changes-d@NetBSD.org Module Name: src Committed By: kamil Date: Tue Oct 4 09:41:41 UTC 2016 Modified Files: src/distrib/sets/lists/comp: mi src/include: time.h src/lib/libc/gen: Makefile.inc Added Files: src/lib/libc/gen: timespec_get.3 timespec_get.c Log Message: Add timespec_get(3) in and enable unconditionally struct timespec These changes conforms to the C11 standard References: - 7.27.1/3 Components of time (struct timespec) - 7.27.2.5 The timespec_get function According to ISO/IEC 9899:201x (draft) defines the timespec structure and declares the timespec_get(3) function with TIME_UTC definition. According to a C++17 standard draft offers the same interface in the std:: namespace. The timespec_get function modifies the timespec object pointed by ts to hold the current calendar time in the given base. The standard notes only the TIME_UTC base with implementation defined value, set it to 1 as zero is reserved for error handling. Once operation was successful this function returns passed base, otherwise exits with zero. The timespec struct was already part of the POSIX standard in . Enable this interface unconditionally in the header to allow to use it in a code prior C11 and C++17 as an extension. Review notes from To generate a diff of this commit: cvs rdiff -u -r1.2063 -r1.2064 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.46 -r1.47 src/include/time.h cvs rdiff -u -r1.195 -r1.196 src/lib/libc/gen/Makefile.inc cvs rdiff -u -r0 -r1.1 src/lib/libc/gen/timespec_get.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.