musl/include/sys/time.h, branch master musl - an implementation of the standard library for Linux-based systems add time64 symbol name redirects to public headers, under arch control 2019年10月28日T23:26:52+00:00 Rich Felker dalias@aerifal.cx 2019年07月31日T19:24:58+00:00 1febd21d3fb7b78f6fc13e48b3ff2a396a607a15 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.
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.
remove redundant feature test macro checks in sys/time.h 2016年11月07日T16:49:22+00:00 Rich Felker dalias@aerifal.cx 2016年11月07日T16:49:22+00:00 7352b59d68aa6d931f9f882b2e0f9de6314d733f this header is XSI-shaded itself and thus does not need to limit specific content to _XOPEN_SOURCE.
this header is XSI-shaded itself and thus does not need to limit
specific content to _XOPEN_SOURCE.
make brace placement in public header struct definitions consistent 2016年07月03日T19:02:25+00:00 Rich Felker dalias@aerifal.cx 2016年07月03日T18:40:11+00:00 befa5866ee30d09c0c96e88af2eabff5911342ea 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.
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.
add nonstandard timespec/timeval conversion macros in sys/time.h 2014年02月05日T21:34:23+00:00 Rich Felker dalias@aerifal.cx 2014年02月05日T21:34:23+00:00 ad87c2eecf70c6f2852a4908b04a6329cbebaf7d 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.
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.
timeradd/timersub: cast result to void to get rid of warnings 2013年11月23日T12:01:53+00:00 rofl0r retnyg@gmx.net 2013年11月23日T12:01:53+00:00 8ff810d779daa29b78d14e477f5a68b51ed232d1 previously: timersub(&now, t, &diff); warning: value computed is not used [-Wunused-value]
previously:
timersub(&now, t, &diff);
warning: value computed is not used [-Wunused-value]
fix the prototype of settimeofday to follow the original BSD declaration 2013年05月26日T16:01:38+00:00 Szabolcs Nagy nsz@port70.net 2013年05月26日T16:01:38+00:00 31ff797787d89bc01a69ca672fb2340ff21a827e
add obsolete futimesat() 2012年12月06日T19:27:54+00:00 rofl0r retnyg@gmx.net 2012年12月06日T18:29:38+00:00 7aec71c411373f8b28a8ba1443f2631ad08d4a1b 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.
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.
default features: make musl usable without feature test macros 2012年09月08日T03:13:55+00:00 Rich Felker dalias@aerifal.cx 2012年09月08日T03:13:55+00:00 c1a9658bd19245ff0fb52d3da567815d822fb622 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.
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.
use restrict everywhere it's required by c99 and/or posix 2008 2012年09月07日T02:44:55+00:00 Rich Felker dalias@aerifal.cx 2012年09月07日T02:44:55+00:00 400c5e5c8307a2ebe44ef1f203f5a15669f20347 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.
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.
support _BSD_SOURCE feature test macro 2012年05月23日T01:52:08+00:00 Rich Felker dalias@aerifal.cx 2012年05月23日T01:52:08+00:00 419ae6d5c95629d3ebaff6f1880d52cb027ba924 patch by Isaac Dunham. matched closely (maybe not exact) to glibc's idea of what _BSD_SOURCE should make visible.
patch by Isaac Dunham. matched closely (maybe not exact) to glibc's
idea of what _BSD_SOURCE should make visible.

AltStyle によって変換されたページ (->オリジナル) /