From owner-svn-src-all@freebsd.org Fri Aug 10 15:16:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E0B106DB83; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C20D8F1E6; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EF191D6F; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFGfOJ037411; Fri, 10 Aug 2018 15:16:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGfjx037410; Fri, 10 Aug 2018 15:16:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGfjx037410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337578 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 15:16:42 -0000 Author: imp Date: Fri Aug 10 15:16:41 2018 New Revision: 337578 URL: https://svnweb.freebsd.org/changeset/base/337578 Log: Update man page to include FreeBSD-specific details. While this implements a standards-conforming C11 function, there's implementation details the programmer needs to know. Include those here. Make changes inspired by comments on the initial review as well, though mostly this involves stealing the epoch verbage from gettimeofday(2). Add myself to authors since I've now changed a substantial amount of this man page. Modified: head/lib/libc/gen/timespec_get.3 Modified: head/lib/libc/gen/timespec_get.3 ============================================================================== --- head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:36 2018 (r337577) +++ head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:41 2018 (r337578) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 4, 2016 +.Dd August 10, 2018 .Dt TIMESPEC_GET 3 .Os .Sh NAME @@ -39,7 +39,6 @@ .Lb libc .Sh SYNOPSIS .In time.h -.Vt #define TIME_UTC 1 .Ft int .Fn timespec_get "struct timespec *ts" "int base" .Sh DESCRIPTION @@ -50,9 +49,14 @@ function sets the interval pointed to by to hold the current calendar time based on the specified time base in .Fa base . .Pp -Currently the only supported valid base is -.Dv TIME_UTC . -It returns time elapsed since epoch. +The base +.Dv TIME_UTC +returns the time since the epoch. +This time is expressed in seconds and nanoseconds since midnight (0 hour), January 1, 1970. +In +.Fx , +this corresponds to +.Dv CLOCK_REALTIME . .Sh RETURN VALUES The .Nm @@ -61,16 +65,22 @@ function returns the passed value of if successful, otherwise .Dv 0 on failure. -.\" .Sh ERRORS .Sh SEE ALSO -.Xr clock_gettime 2 +.Xr gettimeofday 2 , +.Xr clock_gettime 2 , +.Xr time 3 .Sh STANDARDS The .Nm -function conforms to +function with a +.Fa base +of +.Dv TIME_UTC +conforms to .St -isoC-2011 . .Sh HISTORY This interface first appeared in -.Nx 8 . +.Fx 12 . .Sh AUTHORS .An Kamil Rytarowski Aq Mt kamil@NetBSD.org +.An Warner Losh Aq Mt imp@FreeBSD.org