History log of /seL4-camkes-master/projects/musllibc/include/stdlib.h
Revision Date Author Comments
# 2ed4e9d9 20-Oct-2016 Rich Felker <dalias@aerifal.cx>

remove parameter names from public headers

inclusion of these names was unintentional and in most cases is a
namespace violation. Daniel Sabogal tracked down and reported these.


# f22a9eda 16-Jun-2015 Rich Felker <dalias@aerifal.cx>

byte-based C locale, phase 3: make MB_CUR_MAX variable to activate code

this patch activates the new byte-based C locale (high bytes treated
as abstract code unit "characters" rather than decoded as multibyte
characters) by making the value of MB_CUR_MAX depend on the active
locale. for the C locale, the LC_CTYPE category pointer is null,
yielding a value of 1. all other locales yield a value of 4.


# ab8f6a6e 09-Sep-2014 Rich Felker <dalias@aerifal.cx>

fix places where _BSD_SOURCE failed to yield a superset of _XOPEN_SOURCE

the vast majority of these failures seem to have been oversights at
the time _BSD_SOURCE was added, or perhaps shortly afterward. the one
which may have had some reason behind it is omission of setpgrp from
the _BSD_SOURCE feature profile, since the standard setpgrp interface
conflicts with a legacy (pre-POSIX) BSD interface by the same name.
however, such omission is not aligned with our general policy in this
area (for example, handling of similar _GNU_SOURCE cases) and should
not be preserved.


# b1ae7b78 07-Aug-2014 Clément Vasseur <clement.vasseur@gmail.com>

make clearenv available with _BSD_SOURCE

glibc declares clearenv under _BSD_SOURCE, some applications might
depend on it being available this way.


# aa6ce3d4 11-Feb-2014 Szabolcs Nagy <nsz@port70.net>

fix signed and unsigned comparision in macros in public headers

gcc -Wsign-compare warns about expanded macros that were defined in
standard headers (before gcc 4.8) which can make builds fail that
use -Werror. changed macros: WIFSIGNALED, __CPU_op_S


# c8a9c221 24-Nov-2013 Rich Felker <dalias@aerifal.cx>

restore type of NULL to void * except when used in C++ programs

unfortunately this eliminates the ability of the compiler to diagnose
some dangerous/incorrect usage, but POSIX requires (as an extension to
the C language, i.e. CX shaded) that NULL have type void *. plain C
allows it to be defined as any null pointer constant.

the definition 0L is preserved for C++ rather than reverting to plain
0 to avoid dangerous behavior in non-conforming programs which use
NULL as a variadic sentinel. (it's impossible to use (void *)0 for C++
since C++ lacks the proper implicit pointer conversions, and other
popular alternatives like the GCC __null extension seem non-conforming
to the standard's requirements.)


# a516077f 20-Nov-2013 Szabolcs Nagy <nsz@port70.net>

add legacy getloadavg api


# 35eb1a1a 13-Aug-2013 Rich Felker <dalias@aerifal.cx>

provide declarations for strtod_l and family

these aliases were originally intended to be for ABI compatibility
only, but their presence caused regressions in broken gnulib-based
software whose configure scripts detect the existing of these
functions then use them without declarations, resulting in bogus
return values.


# 41c63282 10-Aug-2013 Rich Felker <dalias@aerifal.cx>

fix definitions of WIFSTOPPED and WIFSIGNALED to support up to signal 127

mips has signal numbers up to 127 (formerly, up to 128, but the last
one never worked right and caused kernel panic when used), so 127 in
the "signal number" field of the wait status is insufficient for
determining that the process was stopped. in addition, a nonzero value
in the upper bits must be present, indicating the signal number which
caused the process to be stopped.

details on this issue can be seen in the email with message id
CAAG0J9-d4BfEhbQovFqUAJ3QoOuXScrpsY1y95PrEPxA5DWedQ@mail.gmail.com on
the linux-mips mailing list, archived at:
http://www.linux-mips.org/archives/linux-mips/2013-06/msg00552.html
and in the associated thread about fixing the mips kernel bug.

commit 4a96b948687166da26a6c327e6c6733ad2336c5c fixed the
corresponding issue in uClibc, but introduced a multiple-evaluation
issue for the WIFSTOPPED macro.

for the most part, none of these issues affected pure musl systems,
since musl has up until now (incorrectly) defined SIGRTMAX as 64 on
all archs, even mips. however, interpreting status of non-musl
programs on mips may have caused problems. with this change, the full
range of signal numbers can be made available on mips.


# 2cc63358 20-Feb-2013 Rich Felker <dalias@aerifal.cx>

add mkostemp, mkstemps, and mkostemps functions and reorganize temp internals

based on patch contributed by Anthony G. Basile (blueness)

some issues remain with the filename generation algorithm and other
small bugs, but this patch has been sitting around long enough that I
feel it's best to get it committed and then work out any remaining
issues.


# 41d7c77d 18-Jan-2013 Rich Felker <dalias@aerifal.cx>

use a common definition of NULL as 0L for C and C++

the historical mess of having different definitions for C and C++
comes from the historical C definition as (void *)0 and the fact that
(void *)0 can't be used in C++ because it does not convert to other
pointer types implicitly. however, using plain 0 in C++ exposed bugs
in C++ programs that call variadic functions with NULL as an argument
and (wrongly; this is UB) expect it to arrive as a null pointer. on
64-bit machines, the high bits end up containing junk. glibc dodges
the issue by using a GCC extension __null to define NULL; this is
observably non-conforming because a conforming application could
observe the definition of NULL via stringizing and see that it is
neither an integer constant expression with value zero nor such an
expression cast to void.

switching to 0L eliminates the issue and provides compatibility with
broken applications, since on all musl targets, long and pointers have
the same size, representation, and argument-passing convention. we
could maintain separate C and C++ definitions of NULL (i.e. just use
0L on C++ and use (void *)0 on C) but after careful analysis, it seems
extremely difficult for a C program to even determine whether NULL has
integer or pointer type, much less depend in subtle, unintentional
ways, on whether it does. C89 seems to have no way to make the
distinction. on C99, the fact that (int)(void *)0 is not an integer
constant expression, along with subtle VLA/sizeof semantics, can be
used to make the distinction, but many compilers are non-conforming
and give the wrong result to this test anyway. on C11, _Generic can
trivially make the distinction, but it seems unlikely that code
targetting C11 would be so backwards in caring which definition of
NULL an implementation uses.

as such, the simplest path of using the same definition for NULL in
both C and C++ was chosen. the #undef directive was also removed so
that the compiler can catch and give a warning or error on
redefinition if buggy programs have defined their own versions of
NULL prior to inclusion of standard headers.


# 4eb4844b 21-Oct-2012 Rich Felker <dalias@aerifal.cx>

fix issues with wait constants in stdlib.h

the W* namespace is not reserved, so the nonstandard ones must be
moved under extension features. also WNOHANG and WUNTRACED were
missing.


# c1a9658b 07-Sep-2012 Rich Felker <dalias@aerifal.cx>

default features: make musl usable without feature test macros

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.


# c8ea9857 06-Sep-2012 Rich Felker <dalias@aerifal.cx>

add _Noreturn function attribute, with fallback for pre-C11 GNUC


# 400c5e5c 06-Sep-2012 Rich Felker <dalias@aerifal.cx>

use restrict everywhere it's required by c99 and/or posix 2008

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.


# 9bff7c13 25-Aug-2012 Rich Felker <dalias@aerifal.cx>

implement "low hanging fruit" from C11

based on Gregor's patch sent to the list. includes:
- stdalign.h
- removing gets in C11 mode
- adding aligned_alloc and adjusting other functions to use it
- adding 'x' flag to fopen for exclusive mode


# b5289fd7 25-Aug-2012 Rich Felker <dalias@aerifal.cx>

add c11 quick_exit and at_quick_exit functions


# 3b94daba 04-Jun-2012 Rich Felker <dalias@aerifal.cx>

_GNU_SOURCE is supposed to imply _LARGEFILE64_SOURCE

this is ugly and stupid, but now that the *64 symbol names exist, a
lot of broken GNU software detects them in configure, then either
breaks during build due to missing off64_t definition, or attempts to
compile without function declarations/prototypes. "fixing" it here is
easier than telling everyone to add yet another feature test macro to
their builds.


# 419ae6d5 22-May-2012 Rich Felker <dalias@aerifal.cx>

support _BSD_SOURCE feature test macro

patch by Isaac Dunham. matched closely (maybe not exact) to glibc's
idea of what _BSD_SOURCE should make visible.


# 2dd8d5e1 03-May-2012 Rich Felker <dalias@aerifal.cx>

add support for ugly *64 functions with _LARGEFILE64_SOURCE

musl does not support legacy 32-bit-off_t whatsoever. off_t is always
64 bit, and correct programs that use off_t and the standard functions
will just work out of the box. (on glibc, they would require
-D_FILE_OFFSET_BITS=64 to work.) however, some programs instead define
_LARGEFILE64_SOURCE and use alternate versions of all the standard
types and functions with "64" appended to their names.

we do not want code to actually get linked against these functions
(it's ugly and inconsistent), so macros are used instead of prototypes
with weak aliases in the library itself. eventually the weak aliases
may be added at the library level for the sake of using code that was
originally built against glibc, but the macros will still be the
desired solution in the headers.


# 3be616c1 09-Apr-2012 Rich Felker <dalias@aerifal.cx>

fix alloca issue in stdlib.h too

I forgot _GNU_SOURCE also has it declared here...


# f4ad36c4 05-Feb-2012 Rich Felker <dalias@aerifal.cx>

add deprecated (removed from posix) [efg]cvt() functions

these have not been heavily tested, but they should work as described
in the old standards. probably broken for non-finite values...


# d4045a16 11-Sep-2011 Rich Felker <dalias@aerifal.cx>

declare alloca in stdlib.h when _GNU_SOURCE is defined


# 4b5f0540 21-Apr-2011 Rich Felker <dalias@aerifal.cx>

move wait.h macros out of bits. they do not vary.


# 750b738e 13-Apr-2011 Rich Felker <dalias@aerifal.cx>

add ptsname_r (nonstandard) and split ptsname (standard) to separate file

this eliminates the ugly static buffer in programs that use ptsname_r.


# a5323c57 30-Mar-2011 Rich Felker <dalias@aerifal.cx>

add some missing prototypes for nonstandard functions (strsep, clearenv)


# f4514620 15-Feb-2011 Rich Felker <dalias@aerifal.cx>

fix the types of some integer constant limits in headers


# 6d36c209 15-Feb-2011 Rich Felker <dalias@aerifal.cx>

fix missing EXIT_* in stdlib.h after header cleanup


# 80695b1d 14-Feb-2011 Rich Felker <dalias@aerifal.cx>

begin namespace-cleanup of standard C headers


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0