]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libelftc/elftc_timestamp.3
Import ELF Tool Chain snapshot at r3668
[FreeBSD/FreeBSD.git] / libelftc / elftc_timestamp.3
1 .\" Copyright (c) 2016 The FreeBSD Foundation.  All rights reserved.
2 .\"
3 .\" This documentation was written by Ed Maste under sponsorship of
4 .\" the FreeBSD Foundation.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" This software is provided by the author and contributors ``as is'' and
16 .\" any express or implied warranties, including, but not limited to, the
17 .\" implied warranties of merchantability and fitness for a particular purpose
18 .\" are disclaimed.  In no event shall the author or contributors be liable
19 .\" for any direct, indirect, incidental, special, exemplary, or consequential
20 .\" damages (including, but not limited to, procurement of substitute goods
21 .\" or services; loss of use, data, or profits; or business interruption)
22 .\" however caused and on any theory of liability, whether in contract, strict
23 .\" liability, or tort (including negligence or otherwise) arising in any way
24 .\" out of the use of this software, even if advised of the possibility of
25 .\" such damage.
26 .\"
27 .\" $Id$
28 .\"
29 .Dd August 24, 2016
30 .Dt ELFTC_TIMESTAMP 3
31 .Os
32 .Sh NAME
33 .Nm elftc_timestamp
34 .Nd return the current or environment-provided timestamp
35 .Sh LIBRARY
36 .Lb libelftc
37 .Sh SYNOPSIS
38 .In libelftc.h
39 .Ft int
40 .Fo elftc_timestamp
41 .Fa "time_t *timestamp"
42 .Fc
43 .Sh DESCRIPTION
44 The
45 .Fn elftc_timestamp
46 function returns a timestamp supplied by the
47 .Ev SOURCE_DATE_EPOCH
48 environment variable, or the current time provided by
49 .Xr time 3
50 if the environment variable is not set.
51 .Pp
52 The
53 .Ar timestamp
54 argument specifies a pointer to the location where the timestamp will be
55 stored.
56 .Sh RETURN VALUES
57 Function
58 .Fn elftc_timestamp
59 returns 0 on success, and -1 in the event of an error.
60 .Sh ERRORS
61 The
62 .Fn elftc_timestamp
63 function may fail with the following errors:
64 .Bl -tag -width ".Bq Er ERANGE"
65 .It Bq Er EINVAL
66 .Ev SOURCE_DATE_EPOCH
67 contains invalid characters.
68 .It Bq Er ERANGE
69 .Ev SOURCE_DATE_EPOCH
70 specifies a negative value or a value that cannot be stored in a
71 time_t.
72 .El
73 The
74 .Fn elftc_timestamp
75 function may also fail for any of the reasons described in
76 .Xr strtoll 3 .
77 .Sh SEE ALSO
78 .Xr strtoll 3 ,
79 .Xr time 3