summaryrefslogtreecommitdiff
path: root/include/sys/time.h
AgeCommit message (Collapse)AuthorLines
2019-10-28add time64 symbol name redirects to public headers, under arch controlRich Felker-0/+14
a _REDIR_TIME64 macro is introduced, which the arch's alltypes.h is expected to define, to control redirection of symbol names for interfaces that involve time_t and derived types. this ensures that object files will only be linked to libc interfaces matching the ABI whose headers they were compiled against. along with time32 compat shims, which will be introduced separately, the redirection also makes it possible for a single libc (static or shared) to be used with object files produced with either the old (32-bit time_t) headers or the new ones after 64-bit time_t switchover takes place. mixing of such object files (or shared libraries) in the same program will also be possible, but must be done with care; ABI between libc and a consumer of the libc interfaces is guaranteed to match by the the symbol name redirection, but pairwise ABI between consumers of libc that define interfaces between each other in terms of time_t is not guaranteed to match. this change adds a dependency on an additional "GNU C" feature to the public headers for existing 32-bit archs, which is generally undesirable; however, the feature is one which glibc has depended on for a long time, and thus which any viable alternative compiler is going to need to provide. 64-bit archs are not affected, nor will future 32-bit archs be, regardless of whether they are "new" on the kernel side (e.g. riscv32) or just newly-added (e.g. a new sparc or xtensa port). the same applies to newly-added ABIs for existing machine-level archs.
2016-11-07remove redundant feature test macro checks in sys/time.hRich Felker-5/+0
this header is XSI-shaded itself and thus does not need to limit specific content to _XOPEN_SOURCE.
2016-07-03make brace placement in public header struct definitions consistentRich Felker-2/+1
placing the opening brace on the same line as the struct keyword/tag is the style I prefer and seems to be the prevailing practice in more recent additions. these changes were generated by the command: find include/ arch/*/bits -name '*.h' \ -exec sed -i '/^struct [^;{]*$/{N;s/\n/ /;}' {} + and subsequently checked by hand to ensure that the regex did not pick up any false positives.
2014-02-05add nonstandard timespec/timeval conversion macros in sys/time.hRich Felker-0/+11
these are poorly designed (illogical argument order) and even poorly implemented (brace issues) on glibc, but unfortunately some software is using them. we could consider removing them again in the future at some point if they're documented as deprecated, but for now the simplest thing to do is just to provide them under _GNU_SOURCE.
2013-11-23timeradd/timersub: cast result to void to get rid of warningsrofl0r-2/+2
previously: timersub(&now, t, &diff); warning: value computed is not used [-Wunused-value]
2013-05-26fix the prototype of settimeofday to follow the original BSD declarationSzabolcs Nagy-5/+5
2012-12-06add obsolete futimesat()rofl0r-0/+1
this function is obsolete, however it's available as a syscall and as such qemu userspace emulation tries to forward it to the host kernel.
2012-09-07default features: make musl usable without feature test macrosRich Felker-5/+1
the old behavior of exposing nothing except plain ISO C can be obtained by defining __STRICT_ANSI__ or using a compiler option (such as -std=c99) that predefines it. the new default featureset is POSIX with XSI plus _BSD_SOURCE. any explicit feature test macros will inhibit the default. installation docs have also been updated to reflect this change.
2012-09-06use restrict everywhere it's required by c99 and/or posix 2008Rich Felker-2/+8
to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
2012-05-22support _BSD_SOURCE feature test macroRich Felker-2/+3
patch by Isaac Dunham. matched closely (maybe not exact) to glibc's idea of what _BSD_SOURCE should make visible.
2012-01-24add legacy futimes and lutimes functionsRich Felker-0/+2
based on patch by sh4rm4. these functions are deprecated; futimens and utimensat should be used instead in new programs.
2011-04-13fix and cleanup suseconds_t/timeval stuff (broken on 64-bit)Rich Felker-9/+0
trash in the upper 32 bits was making the kernel sleep forever in select on 64-bit systems.
2011-04-10add legacy BSD-style timer*() macros in sys/time.hRich Felker-0/+10
2011-02-27cleanup namespace in sys/time.hRich Felker-4/+5
2011-02-14extensive header cleanup for standards conformance & correctnessRich Felker-1/+1
thanks to Peter Mazinger (psm) for pointing many of these issues out and submitting a patch on which this commit is loosely based
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+49