aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libspl/timestamp.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace dead opensolaris.org license linkTino Reichardt2022-07-111-1/+1
| | | | | | | | | The commit replaces all findings of the link: http://www.opensolaris.org/os/licensing with this one: https://opensource.org/licenses/CDDL-1.0 Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tino Reichardt <[email protected]> Closes #13619
* libspl: print_timestamp: use localtime_r()наб2022-04-051-2/+3
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13284
* Always use "%lld" for formatting time_tsнаб2020-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the following test program: #include <time.h> #include <stdio.h> #include <stdint.h> int main() { printf("time_t: %d\n", sizeof(time_t)); printf("long: %d\n", sizeof(long)); printf("long long: %d\n", sizeof(long long)); } These are output on various x86 architectures: x32$ time_t: 8 x32$ long: 4 x32$ long long: 8 amd64$ time_t: 8 amd64$ long: 8 amd64$ long long: 8 i386$ time_t: 4 i386$ long: 4 i386$ long long: 8 Therefore code using "%l[du]" to format time_ts produced warnings on x32 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #10357 Closes #844
* Fix `zpool iostat -T d 1` on muslRichard Yao2017-04-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When building on Gentoo against musl, GCC complains: timestamp.c: In function ‘print_timestamp’: timestamp.c:32:19: warning: passing argument 1 of ‘nl_langinfo’ makes integer from pointer without a cast #define _DATE_FMT "%+" ^ timestamp.c:47:21: note: in expansion of macro ‘_DATE_FMT’ fmt = nl_langinfo(_DATE_FMT); ^ The error was wrapped to meet comment style requirements. This code is used by `zpool iostat -T d 1` to print a date and upon testing it, I see no date printed. Lets use D_T_FMT so that something gets printed and if D_T_FMT is not avaliable, then we can fall back to "%+". Reviewed-by: George Melikov <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #5993
* Set _DATE_FMT to '%+' if not defined in libspl/timestamp.cCarlo Landmeter2016-03-291-0/+4
| | | | | | Signed-off-by: Carlo Landmeter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4458
* Add linux libspl supportBrian Behlendorf2010-08-311-0/+55
All changes needed for the libspl layer. This includes modifications to files directly copied from OpenSolaris and the addition of new files needed to fill in the gaps. Signed-off-by: Brian Behlendorf <[email protected]>