| Commit message (Expand) | Author | Age | Files | Lines |
| * | add new masked cancellation mode•••this is a new extension which is presently intended only for
experimental and internal libc use. interface and behavior details may
change subject to feedback and experience from using it internally.
the basic concept for the new PTHREAD_CANCEL_MASKED state is that the
first cancellation point to observe the cancellation request fails
with an errno value of ECANCELED rather than acting on cancellation,
allowing the caller to process the status and choose whether/how to
act upon it.
| Rich Felker | 2015-02-21 | 1 | -0/+1 |
| * | add new socket options SO_INCOMING_CPU, SO_ATTACH_BPF, SO_DETACH_BPF•••these socket options are new in linux v3.19, introduced in commit
2c8c56e15df3d4c2af3d656e44feb18789f75837 and commit
89aa075832b0da4402acebd698d0411dcc82d03e
with SO_INCOMING_CPU the cpu can be queried on which a socket is
managed inside the kernel and optimize polling of large number of
sockets accordingly.
SO_ATTACH_BPF lets eBPF programs (created by the bpf syscall) to
be attached to sockets.
| Szabolcs Nagy | 2015-02-09 | 1 | -0/+4 |
| * | move MREMAP_MAYMOVE and MREMAP_FIXED out of bits•••the definitions are generic for all kernel archs. exposure of these
macros now only occurs on the same feature test as for the function
accepting them, which is believed to be more correct.
| Trutz Behn | 2015-01-30 | 1 | -0/+2 |
| * | add new prctl command PR_SET_MM_MAP to sys/prctl.h•••PR_SET_MM_MAP was introduced as a subcommand for PR_SET_MM in
linux v3.18 commit f606b77f1a9e362451aca8f81d8f36a3a112139e
the associated struct type is replicated in sys/prctl.h using
libc types.
example usage:
struct prctl_mm_map *p;
...
prctl(PR_SET_MM, PR_SET_MM_MAP, p, sizeof *p);
the kernel side supported struct size may be queried with
the PR_SET_MM_MAP_SIZE subcommand.
| Szabolcs Nagy | 2014-12-23 | 1 | -0/+21 |
| * | move wint_t definition to the shared part of alltypes.h.in | Rich Felker | 2014-12-21 | 1 | -0/+1 |
| * | fix signedness of UINT32_MAX and UINT64_MAX at the preprocessor level•••per the rules for hexadecimal integer constants, the previous
definitions were correctly treated as having unsigned type except
possibly when used in preprocessor conditionals, where all artithmetic
takes place as intmax_t or uintmax_t. the explicit 'u' suffix ensures
that they are treated as unsigned in all contexts.
| Rich Felker | 2014-12-21 | 1 | -2/+2 |
| * | add login_tty function | Felix Janda | 2014-12-20 | 1 | -0/+2 |
| * | fix signedness of WINT_MIN expression•••since wint_t is unsigned, WINT_MIN needs to expand to an unsigned zero.
| Rich Felker | 2014-12-17 | 1 | -1/+1 |
| * | make the definition of _Complex_I explicitly complex•••it's unclear whether compilers which provide pure imaginary types
might produce a pure imaginary expression for 1.0fi. using 0.0f+1.0fi
ensures that the result is explicitly complex and makes this obvious
to human readers too.
| Rich Felker | 2014-12-17 | 1 | -2/+2 |
| * | make the result of the cimag macro a non-lvalue•••this change is not necessary but helps diagnose invalid code. based on
patch by Jens Gustedt.
| Rich Felker | 2014-12-17 | 1 | -1/+1 |
| * | fix definition of CMPLX macros in complex.h to work in constant expressions•••based on patches by Jens Gustedt. these macros need to be usable in
static initializers, and the old definitions were not.
there is no portable way to provide correct definitions for these
macros unless the compiler supports pure imaginary types. a portable
definition is provided for this case even though there are presently
no compilers that can use it. gcc and compatible compilers provide a
builtin function that can be used, but clang fails to support this and
instead requires a construct which is a constraint violation and which
is only a constant expression as a clang-specific extension.
since these macros are a namespace violation in pre-C11 profiles, and
since no known pre-C11 compilers provide any way to define them
correctly anyway, the definitions have been made conditional on C11.
| Rich Felker | 2014-12-17 | 1 | -3/+9 |
| * | add basic dns record parsing functions•••based on patch by Timo Teräs, with some corrections to bounds checking
code and other minor changes.
while they are borderline scope creep, the functions added are fairly
small and are roughly the minimum code needed to use the results of
the res_query API without re-implementing error-prone DNS packet
parsing, and they are used in practice by some kerberos related
software and possibly other things. at this time there is no intent to
implement further nameser.h API functions.
| Rich Felker | 2014-12-17 | 1 | -35/+23 |
| * | don't shadow functions with macros in C++•••C++ programmers typically expect something like "::function(x,y)" to work
and may be surprised to find that "(::function)(x,y)" is actually required
due to the headers declaring a macro version of some standard functions.
We already omit function-like macros for C++ in most cases where there is
a real function available. This commit extends this to the remaining
function-like macros which have a real function version.
| Bobby Bingham | 2014-12-09 | 3 | -0/+6 |
| * | suppress macro definitions of ctype functions under C++•••based on patch by Sergey Dmitrouk.
| Rich Felker | 2014-10-14 | 3 | -0/+7 |
| * | implement uchar.h (C11 UTF-16/32 conversion) interfaces | Rich Felker | 2014-10-13 | 3 | -5/+30 |
| * | add new linux file sealing api to fcntl.h•••new in linux v3.17 commit 40e041a2c858b3caefc757e26cb85bfceae5062b
sealing allows some operations to be blocked on a file which makes
file access safer when fds are shared between processes (only
supported for shared mem fds currently)
flags:
F_SEAL_SEAL prevents further sealing
F_SEAL_SHRINK prevents file from shrinking
F_SEAL_GROW prevents file from growing
F_SEAL_WRITE prevents writes
fcntl commands:
F_GET_SEALS get the current seal flags
F_ADD_SEALS add new seal flags
| Szabolcs Nagy | 2014-10-08 | 1 | -0/+7 |
| * | add new IPV6_AUTOFLOWLABEL socket option in netinet/in.h•••added in linux v3.17 commit 753a2ad54ef45e3417a9d49537c2b42b04a2e1be
enables automatic flow label generation on transmit
| Szabolcs Nagy | 2014-10-08 | 1 | -0/+1 |
| * | add _DEFAULT_SOURCE feature profile as an alias for _BSD_SOURCE•••as a result of commit ab8f6a6e42ff893041f7545a23e6d6a0edde07fb, this
definition is now equivalent to the actual "default profile" which
appears immediately below in features.h, and which defines both
_BSD_SOURCE and _XOPEN_SOURCE.
the intent of providing a _DEFAULT_SOURCE, which glibc also now
provides, is to give applications a way to "get back" the default
feature profile when it was lost either by compiler flags that inhibit
it (such as -std=c99) or by library-provided predefined macros (such
as -D_POSIX_C_SOURCE=200809L) which may inhibit exposure of features
that were otherwise visible by default and which the application may
need. without _DEFAULT_SOURCE, the application had encode knowledge of
a particular libc's defaults, and such knowledge was fragile and
subject to bitrot.
eventually the names _GNU_SOURCE and _BSD_SOURCE should be phased out
in favor of the more-descriptive and more-accurate _ALL_SOURCE and
_DEFAULT_SOURCE, leaving the old names as aliases but using the new
ones internally. however this is a more invasive change that would
require extensive regression testing, so it is deferred.
| Rich Felker | 2014-09-10 | 1 | -0/+4 |
| * | fix _ALL_SOURCE logic to avoid possible redefinition of _GNU_SOURCE•••this could be an error if _GNU_SOURCE was already defined differently
by the application.
| Rich Felker | 2014-09-10 | 1 | -1/+1 |
| * | 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.
| Rich Felker | 2014-09-10 | 4 | -8/+2 |
| * | add new F_OFD_* macros to fcntl.h (open file description locks)•••open file description locks are inherited across fork and only auto
dropped after the last fd of the file description is closed, they can be
used to synchronize between threads that open separate file descriptions
for the same file.
new in linux 3.15 commit 0d3f7a2dd2f5cf9642982515e020c1aee2cf7af6
| Szabolcs Nagy | 2014-09-08 | 1 | -0/+4 |
| * | add threads.h and needed per-arch types for mtx_t and cnd_t•••based on patch by Jens Gustedt.
mtx_t and cnd_t are defined in such a way that they are formally
"compatible types" with pthread_mutex_t and pthread_cond_t,
respectively, when accessed from a different translation unit. this
makes it possible to implement the C11 functions using the pthread
functions (which will dereference them with the pthread types) without
having to use the same types, which would necessitate either namespace
violations (exposing pthread type names in threads.h) or incompatible
changes to the C++ name mangling ABI for the pthread types.
for the rest of the types, things are much simpler; using identical
types is possible without any namespace considerations.
| Rich Felker | 2014-09-06 | 1 | -0/+85 |
| * | add C11 timespec_get function, with associated time.h changes for C11•••based on patch by Jens Gustedt for inclusion with C11 threads
implementation, but committed separately since it's independent of
threads.
| Rich Felker | 2014-09-06 | 1 | -1/+3 |
| * | fix macros for LFS *64_t types in sys/stat.h, sys/types.h, glob.h•••there is no blksize64_t (blksize_t is always long) but there are
fsblkcnt64_t and fsfilcnt64_t types in sys/stat.h and sys/types.h.
and glob.h missed glob64_t.
| Szabolcs Nagy | 2014-09-05 | 3 | -2/+3 |
| * | add static_assert and hide noreturn, alignas, alignof from C++•••add static_assert and protect the other new C11 keyword macros
with #ifndef __cplusplus so they don't conflict with C++ keywords.
| Szabolcs Nagy | 2014-08-27 | 3 | -0/+11 |
| * | add C11 floating-point characteristic macros to float.h•••C11 introduced *_DECIMAL_DIG and *_HAS_SUBNORM macros.
| Szabolcs Nagy | 2014-08-27 | 1 | -0/+7 |
| * | add malloc_usable_size function and non-stub malloc.h•••this function is needed for some important practical applications of
ABI compatibility, and may be useful for supporting some non-portable
software at the source level too.
I was hesitant to add a function which imposes any constraints on
malloc internals; however, it turns out that any malloc implementation
which has realloc must already have an efficient way to determine the
size of existing allocations, so no additional constraint is imposed.
for now, some internal malloc definitions are duplicated in the new
source file. if/when malloc is refactored to put them in a shared
internal header file, these could be removed.
since malloc_usable_size is conventionally declared in malloc.h, the
empty stub version of this file was no longer suitable. it's updated
to provide the standard allocator functions, nonstandard ones (even if
stdlib.h would not expose them based on the feature test macros in
effect), and any malloc-extension functions provided (currently, only
malloc_usable_size).
| Rich Felker | 2014-08-25 | 1 | -0/+25 |
| * | add max_align_t definition for C11 and C++11•••unfortunately this needs to be able to vary by arch, because of a huge
mess GCC made: the GCC definition, which became the ABI, depends on
quirks in GCC's definition of __alignof__, which does not match the
formal alignment of the type.
GCC's __alignof__ unexpectedly exposes the an implementation detail,
its "preferred alignment" for the type, rather than the formal/ABI
alignment of the type, which it only actually uses in structures. on
most archs the two values are the same, but on some (at least i386)
the preferred alignment is greater than the ABI alignment.
I considered using _Alignas(8) unconditionally, but on at least one
arch (or1k), the alignment of max_align_t with GCC's definition is
only 4 (even the "preferred alignment" for these types is only 4).
| Rich Felker | 2014-08-20 | 1 | -0/+3 |
| * | fix CPU_EQUAL macro in sched.h | Szabolcs Nagy | 2014-08-13 | 1 | -1/+1 |
| * | add inline isspace in ctype.h as an optimization•••isspace can be a bottleneck in a simple parser, inlining it
gives slightly smaller and faster code
src/locale/pleval.o already had this optimization, the size
change for other libc functions for i386 is
src/internal/intscan.o 2134 2118 -16
src/locale/dcngettext.o 1562 1552 -10
src/network/res_msend.o 1961 1940 -21
src/network/lookup_name.o 2627 2608 -19
src/network/getnameinfo.o 1814 1811 -3
src/network/lookup_serv.o 643 624 -19
src/stdio/vfscanf.o 2675 2663 -12
src/stdlib/atoll.o 117 107 -10
src/stdlib/atoi.o 95 91 -4
src/stdlib/atol.o 95 91 -4
src/time/strptime.o 1515 1503 -12
(TOTALS) 432451 432321 -130
| Szabolcs Nagy | 2014-08-13 | 1 | -1/+6 |
| * | make clearenv available with _BSD_SOURCE•••glibc declares clearenv under _BSD_SOURCE, some applications might
depend on it being available this way.
| Clément Vasseur | 2014-08-08 | 1 | -1/+1 |
| * | implement ffsl and ffsll functions•••per the resolution of Austin Group issue #617, these are accepted for
XSI option in POSIX future and thus I'm treating them as standard
functions.
| Rich Felker | 2014-07-31 | 1 | -0/+2 |
| * | limit visibility of ffs function declaration to _XOPEN_SOURCE•••per the standard, ffs is XSI shaded, whereas the other functions in
this header are in the base.
| Rich Felker | 2014-07-31 | 1 | -0/+2 |
| * | add new PR_SET_THP_DISABLE and PR_GET_THP_DISABLE prctl flags•••they can be used to set or query if transparent huge pages are disabled.
introduced in linux 3.15 commit a0715cc22601e8830ace98366c0c2bd8da52af52
| Szabolcs Nagy | 2014-07-20 | 1 | -0/+3 |
| * | add pacing rate information to the tcp_info struct in tcp.h•••used by monitoring applications such as ss from iproute2
introduced in linux 3.15 commit 977cb0ecf82eb6d15562573c31edebf90db35163
| Szabolcs Nagy | 2014-07-20 | 1 | -0/+2 |
| * | add new ethernet packet types ETH_P_80221, ETH_P_LOOPBACK•••ETH_P_80221 is ethertype for IEEE Std 802.21 - Media Independent Handover Protocol
introduced in linux 3.15 commit b62faf3cdc875a1ac5a10696cf6ea0b12bab1596
ETH_P_LOOPBACK is the correct packet type for loopback in IEEE 802.3*
introduced in linux 3.15 commit 61ccbb684421d374fdcd7cf5d6b024b06f03ce4e
some defines were shuffled to be in ascending order and match the kernel header
| Szabolcs Nagy | 2014-07-20 | 1 | -2/+4 |
| * | add issetugid function to check for elevated privilege•••this function provides a way for third-party library code to use the
same logic that's used internally in libc for suppressing untrusted
input/state (e.g. the environment) when the application is running
with privleges elevated by the setuid or setgid bit or some other
mechanism. its semantics are intended to match the openbsd function by
the same name.
there was some question as to whether this function is necessary:
getauxval(AT_SECURE) was proposed as an alternative. however, this has
several drawbacks. the most obvious is that it asks programmers to be
aware of an implementation detail of ELF-based systems (the aux
vector) rather than simply the semantic predicate to be checked. and
trying to write a safe, reliable version of issetugid in terms of
getauxval is difficult. for example, early versions of the glibc
getauxval did not report ENOENT, which could lead to false negatives
if AT_SECURE was not present in the aux vector (this could probably
only happen when running on non-linux kernels under linux emulation,
since glibc does not support linux versions old enough to lack
AT_SECURE). as for musl, getauxval has always properly reported
errors, but prior to commit 7bece9c2095ee81f14b1088f6b0ba2f37fecb283,
the musl implementation did not emulate AT_SECURE if missing, which
would result in a false positive. since musl actually does partially
support kernels that lack AT_SECURE, this was problematic.
the intent is that library authors will use issetugid if its
availability is detected at build time, and only fall back to the
unreliable alternatives on systems that lack it.
patch by Brent Cook. commit message/rationale by Rich Felker.
| Brent Cook | 2014-07-19 | 1 | -0/+1 |
| * | add or1k (OpenRISC 1000) architecture port•••With the exception of a fenv implementation, the port is fully featured.
The port has been tested in or1ksim, the golden reference functional
simulator for OpenRISC 1000.
It passes all libc-test tests (except the math tests that
requires a fenv implementation).
The port assumes an or1k implementation that has support for
atomic instructions (l.lwa/l.swa).
Although it passes all the libc-test tests, the port is still
in an experimental state, and has yet experienced very little
'real-world' use.
| Stefan Kristiansson | 2014-07-18 | 1 | -1/+37 |
| * | implement fmtmsg function•••contributed by Isaac Dunham. this seems to be the last interface that
was missing for complete POSIX 2008 base + XSI coverage.
| Rich Felker | 2014-06-21 | 1 | -0/+47 |
| * | remove hack in syslog.h that resulted in aliasing violations•••this issue affected the prioritynames and facilitynames arrays which
are only provided when requested (usually by syslogd implementations)
and which are presently defined as compound literals. the aliasing
violation seems to have been introduced as a workaround for bad
behavior by gcc's -Wwrite-strings option, but it caused compilers to
completely optimize out the contents of prioritynames and
facilitynames since, under many usage cases, the aliasing rules prove
that the contents are never accessed.
| Rich Felker | 2014-06-21 | 1 | -6/+2 |
| * | implement sendmmsg and recvmmsg•••these are not pure syscall wrappers because they have to work around
kernel API bugs on 64-bit archs. the workarounds could probably be
made somewhat more efficient, but at the cost of more complexity. this
may be revisited later.
| Rich Felker | 2014-06-19 | 1 | -0/+11 |
| * | add support for ipv6 scope_id to getaddrinfo and getnameinfo•••for all address types, a scope_id specified as a decimal value is
accepted. for addresses with link-local scope, a string containing the
interface name is also accepted.
some changes are made to error handling to avoid unwanted fallbacks in
the case where the scope_id is invalid: if an earlier name lookup
backend fails with an error rather than simply "0 results", this
failure now suppresses any later attempts with other backends.
in getnameinfo, a light "itoa" type function is added for generating
decimal scope_id results, and decimal port strings for services are
also generated using this function now so as not to pull in the
dependency on snprintf.
in netdb.h, a definition for the NI_NUMERICSCOPE flag is added. this
is required by POSIX (it was previously missing) and needed to allow
callers to suppress interface-name lookups.
| Rich Felker | 2014-06-04 | 1 | -1/+1 |
| * | fix POSIX namespace pollution in sys/types.h•••int8_t, u_int8_t, etc types are moved under _BSD_SOURCE
| Szabolcs Nagy | 2014-05-30 | 1 | -10/+6 |
| * | update netinet/in.h to match the current kernel uapi•••from linux/in.h and linux/in6.h uapi headers the following
missing socket options were added:
IP_NODEFRAG - used with customized ipv4 headers
IPV6_RECVPATHMTU - for ipv6 path mtu
IPV6_PATHMTU - for ipv6 path mtu
IPV6_DONTFRAG - for ipv6 path mtu
IPV6_ADDR_PREFERENCES - RFC5014 Source Address Selection
IPV6_MINHOPCOUNT - RFC5082 Generalized TTL Security Mechanism
IPV6_ORIGDSTADDR - used by tproxy
IPV6_RECVORIGDSTADDR - used by tproxy
IPV6_TRANSPARENT - used by tproxy
IPV6_UNICAST_IF - ipv6 version of IP_UNICAST_IF
and socket option values:
IP_PMTUDISC_OMIT - value for IP_MTU_DISCOVER option, new in linux 3.14
IPV6_PMTUDISC_OMIT - same for IPV6_MTU_DISCOVER
IPV6_PMTUDISC_INTERFACE - ipv6 version of IP_PMTUDISC_INTERFACE
IPV6_PREFER_* - flags for IPV6_ADDR_PREFERENCES
not added: ipv6 flow info and flow label related definitions.
(it's unclear if libc should define these and namespace polluting
type name is involved so they are not provided for now)
| Szabolcs Nagy | 2014-05-30 | 1 | -1/+21 |
| * | add SO_BPF_EXTENSIONS socket option•••this was introduced to query BPF extension support with getsockopt
in linux 3.14, commit ea02f9411d9faa3553ed09ce0ec9f00ceae9885e
| Szabolcs Nagy | 2014-05-30 | 1 | -0/+1 |
| * | add sched_{get,set}attr syscall numbers and SCHED_DEADLINE macro•••linux 3.14 introduced sched_getattr and sched_setattr syscalls in
commit d50dde5a10f305253cbc3855307f608f8a3c5f73
and the related SCHED_DEADLINE scheduling policy in
commit aab03e05e8f7e26f51dee792beddcb5cca9215a5
but struct sched_attr "extended scheduling parameters data structure"
is not yet exported to userspace (necessary for using the syscalls)
so related uapi definitions are not added yet.
| Szabolcs Nagy | 2014-05-30 | 1 | -0/+1 |
| * | overhaul siginfo_t definition in signal.h•••the main motivation for this change is that, with the previous
definition, it was arguably illegal, in standard C, to initialize both
si_value and si_pid/si_uid with designated initializers, due to the
rule that only one member of a union can have an initializer. whether
or not this affected real-world application code, it affected some
internal code, and clang was producing warnings (and possibly
generating incorrect code).
the new definition uses a more complex hierarchy of structs and unions
to avoid the need to initialize more than one member of a single union
in usage cases that make sense. further work would be needed to
eliminate even the ones with no practical applications.
at the same time, some fixes are made to the exposed names for
nonstandard fields, to match what software using them expects.
| Rich Felker | 2014-05-24 | 1 | -23/+28 |
| * | remove unsupported nonstandard sysconf macros and their table entries•••some of these may have been from ancient (pre-SUSv2) POSIX versions;
more likely, they were from POSIX drafts or glibc interpretations of
what ancient versions of POSIX should have added (instead they made
they described functionality mandatory and/or dropped it completely).
others are purely glibc-isms, many of them ill-thought-out, like
providing ways to lookup the min/max values of types at runtime
(despite the impossibility of them changing at runtime and the
impossibility of representing ULONG_MAX in a return value of type
long).
since our sysconf implementation does not support or return meaningful
values for any of these, it's harmful to have the macros around;
applications' build scripts may detect and attempt to use them, only
to get -1/EINVAL as a result.
if removing them does break some applications, and it's determined
that the usage was reasonable, some of these could be added back on an
as-needed basis, but they should return actual meaningful values, not
junk like they were returning before.
| Rich Felker | 2014-05-19 | 1 | -60/+0 |
| * | expose public execvpe interface | M Farkas-Dyck | 2014-04-20 | 1 | -0/+1 |
| * | fix RLIMIT_ constants for mips•••The mips arch is special in that it uses different RLIMIT_
numbers than other archs, so allow bits/resource.h to override
the default RLIMIT_ numbers (empty on all archs except mips).
Reported by orc.
| Szabolcs Nagy | 2014-04-15 | 1 | -2/+5 |