9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3c / timespec_get.3c
blob532af5ce3c6ca5fa99007b2845d33b80d1462085
1 .\"
2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
5 .\" 1.0 of the CDDL.
6 .\"
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source.  A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
10 .\"
11 .\"
12 .\" Copyright 2016 Joyent, Inc.
13 .\"
14 .Dd "Mar 25, 2016"
15 .Dt TIMESPEC_GET 3C
16 .Os
17 .Sh NAME
18 .Nm timespec_get
19 .Nd get time information
20 .Sh SYNOPSIS
21 .In time.h
22 .Ft int
23 .Fo timespec_get
24 .Fa "struct timespec *ts"
25 .Fa "int base"
26 .Fc
27 .Sh DESCRIPTION
28 The
29 .Fn timespec_get
30 function provides access nanosecond resolution time.
31 The meaning and source of time is defined by the
32 .Fa base
33 argument.
34 The following values are defined for
35 .Fa base :
36 .Bl -tag -width Ds
37 .It Sy TIME_UTC
38 Obtain the current time of day from the realtime clock on the system.
39 It represents the amount of time in second and nanoseconds since the Epoch.
40 This is logically equivalent to calling
41 .Xr clock_gettime 3C
42 with
43 .Sy CLOCK_REALTIME .
44 .El
45 .Pp
46 For the definition of the
47 .Sy timespec
48 structure, see
49 .Xr time.h 3HEAD .
50 .Sh RETURN VALUES
51 Upon successful completion, the
52 .Fn timespec_get
53 function returns the passed in value of
54 .Fa base .
55 Otherwise,
56 .Sy 0
57 is returned to represent an error.
58 .Sh ERRORS
59 Unlike other functions, the
60 .Fn timespec_get
61 function is not defined to set
62 .Sy errno .
63 However, the
64 .Fn timespec_get
65 function will fail if:
66 .Bl -bullet -offset indent
67 .It
68 The value of
69 .Fa base
70 does not refer to a known time specification.
71 .It
72 There was an error obtaining the time for
73 .Fa base .
74 .El
75 .Sh INTERFACE STABILITY
76 .Sy Standard
77 .Sh MT-LEVEL
78 .Sy MT-Safe
79 .Sh SEE ALSO
80 .Xr clock_gettime 3C ,
81 .Xr time.h 3HEAD ,
82 .Xr attributes 5