summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2016-06-09avoid padding gaps in struct sockaddr_storageRich Felker1-1/+1
compilers are free not to copy, or in some cases to clobber, padding bytes in a structure. while it's an aliasing violation, and thus undefined behavior, to copy or manipulate other sockaddr types using sockaddr_storage, it seems likely that traditional code attempts to do so, and the original intent of the sockaddr_storage structure was probably to allow such usage. in the interest of avoiding silent and potentially dangerous breakage, ensure that there are no actual padding bytes in sockaddr_storage by moving and adjusting the size of the __ss_padding member so that it fits exactly. this change also removes a silent assumption that the alignment of long is equal to its size.
2016-06-09update sys/socket.h to linux v4.6Szabolcs Nagy1-1/+19
kernel connection multiplexor macros AF_KCM, PF_KCM, SOL_KCM were added in linux commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 MSG_BATCH sendmsg flag for performance optimization was added in linux commit f092276d85b82504e8a07498f4e9e0c51f06745c SOL_* macros are now synced with linux socket.h which is not a uapi header and glibc did not have the macros either, but that has changed http://sourceware.org/ml/libc-alpha/2016-05/msg00322.html
2016-06-09add new tcp_info fields from linux v4.6Szabolcs Nagy1-0/+4
new fields and associated linux commit: tcpi_notsent_bytes, tcpi_min_rtt cd9b266095f422267bddbec88f9098b48ea548fc tcpi_data_segs_in, tcpi_data_segs_out a44d6eacdaf56f74fad699af7f4925a5f5ac0e7f
2016-06-09add CLONE_NEWCGROUP clone flag, new in linux v4.6Szabolcs Nagy1-0/+1
flag for new cgroup namespace, added in linux commit 5e2bec7c2248ae27c5b16cd97215ae05c1d39179
2016-06-09update siginfo struct for linux v4.6Szabolcs Nagy1-6/+11
x86 protection key faults are reported in the si_pkey field, added in linux commit cd0ea35ff5511cde299a61c21a95889b4a71464e
2016-06-09add ETH_P_MACSEC netinet/if_ether.h, new in linux v4.6Szabolcs Nagy1-0/+1
ethertype for macsec added in linux commit dece8d2b78d19df7fe5e4e965f1f0d1a3e188d1b
2016-06-09add SO_CNX_ADVICE to sys/socket.h, new in linux v4.6Szabolcs Nagy1-0/+1
new socket option so application can give advice about routing path quality of connected udp sockets, added in linux commit a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314
2016-05-22fix undefined pointer arithmetic in CMSG_NXTHDR macroRich Felker1-3/+3
previously, the only way the stopping condition could be met with correct lengths in the headers invoked undefined behavior, adding sizeof(struct cmsghdr) beyond the end of the cmsg buffer. instead, compute and compare sizes rather than pointers.
2016-03-19add MADV_FREE madvise command from linux v4.5Szabolcs Nagy1-0/+1
allows the os to free the marked pages lazily on memory pressure. expected to increase malloc performance. new in linux commit 854e9ed09dedf0c19ac8640e91bcc74bc3f9e5c9
2016-03-19add EPOLLEXCLUSIVE epoll flag from linux v4.5Szabolcs Nagy1-0/+1
new flag for exclusive wakeup mode when an event source fd is attached to multiple epoll fds but they should not all receive the events. new in linux commit df0108c5da561c66c333bb46bfe3c1fc65905898
2016-03-19add SO_ATTACH_REUSEPORT_[CE]BPF socket options from linux v4.5Szabolcs Nagy1-1/+2
new socket options for setting classic or extended BPF program for sockets in a SO_REUSEPORT group. added in linux commit 538950a1b7527a0a52ccd9337e3fcd304f027f13
2016-03-19add IPV6_HDRINCL socket option from linux v4.5Szabolcs Nagy1-0/+1
new in linux commit 715f504b118998c41a2079a17e16bf5a8a114885 same as IP_HDRINCL but for SOL_IPV6 sockets.
2016-03-18deduplicate bits/mman.hSzabolcs Nagy1-0/+59
currently five targets use the same mman.h constants and the rest share most constants too, so move them to sys/mman.h before the bits/mman.h include where the differences can be corrected by redefinition of the macros. this fixes two minor bugs: POSIX_MADV_DONTNEED was wrong on most targets (it should be the same as MADV_DONTNEED), and sh defined the x86-only MAP_32BIT mmap flag.
2016-03-02add sched_getcpuNathan Zadoks1-0/+1
This is a GNU extension, but a fairly minor one, for a system call that otherwise has no libc wrapper.
2016-02-12do not define static_assert macro for pre-C11 compilersRich Felker1-1/+1
some software simply uses static_assert if the macro is defined, and this breaks if the compiler does not recognize the _Static_assert keyword used to define it.
2016-02-12add declarations for utmpname/utmpxname to appropriate headersRich Felker2-1/+2
commit 378f8cb5222b63e4f8532c757ce54e4074567e1f added these functions (as stubs) but left them without declarations. this broke some autoconf based software that detected linkability of the symbols but didn't check for a declaration.
2016-01-26fix siginfo_t for mipsSzabolcs Nagy1-0/+4
si_errno and si_code are swapped in mips siginfo_t compared to other archs and some si_code values are different. This fix is required for POSIX timers to work. based on patch by Dmitry Ivanov.
2016-01-26move bits/signal.h include close to the top of signal.hSzabolcs Nagy1-6/+12
only have code above the bits/signal.h include that is necessary. (some types are used for the ucontext struct and mips has to override a few macro definitions) this way mips bits/signal.h will be able to affect siginfo_t.
2016-01-26add new PTRACE_SECCOMP_GET_FILTER ptrace commandSzabolcs Nagy1-0/+1
allows the tracer to dump the bpf seccomp filters of the tracee, new in linux v4.4, commit f8e529ed941ba2bbcbf310b575d968159ce7e895
2016-01-26add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flagsSzabolcs Nagy1-0/+1
they lock faulted pages into memory (useful when a small part of a large mapped file needs efficient access), new in linux v4.4, commit b0f205c2a3082dd9081f9a94e50658c5fa906ff1 MLOCK_* is not in the POSIX reserved namespace for sys/mman.h
2016-01-26add new PTRACE_O_SUSPEND_SECCOMP ptrace optionSzabolcs Nagy1-1/+2
allows a ptracer process to disable/enable seccomp filters of the traced process, useful for checkpoint/restore, new in v4.3 commit 13c4a90119d28cfcb6b5bdd820c233b86c2b0237
2016-01-26add new PR_CAP_AMBIENT and related defines to sys/prctl.hSzabolcs Nagy1-0/+6
ambient capability mask is new in linux v4.3, commit 58319057b7847667f0c9585b9de0e8932b0fdb08
2016-01-26update netpacket/packet.h to linux v4.3Szabolcs Nagy1-0/+17
2016-01-24add new IP_BIND_ADDRESS_NO_PORT and IPPROTO_MPLS to netinet/in.hSzabolcs Nagy1-0/+2
IP_BIND_ADDRESS_NO_PORT is a SOL_IP socket option to delay src port allocation until connect in case src ip is set with bind(port=0). new in linux v4.2, commit 90c337da1524863838658078ec34241f45d8394d IPPROTO_MPLS protocol number for mpls over ip. new in linux v4.2, commit 730fc4371333636a00fed32c587fc1e85c5367e2
2016-01-24update netinet/tcp.h for linux v4.2Szabolcs Nagy1-0/+7
TCP_CC_INFO is a new socket option to get congestion control info without netlink (union tcp_cc_info is in linux/inet_diag.h kernel header). linux commit 6e9250f59ef9efb932c84850cd221f22c2a03c4a TCP_SAVE_SYN, TCP_SAVED_SYN socket options are for saving and getting the SYN headers of passive connections in a server application. linux commit cd8ae85299d54155702a56811b2e035e63064d3d Add new tcpi_* fields to struct tcp_info implementing RFC4898 counters. linux commit 2efd055c53c06b7e89c167c98069bab9afce7e59
2016-01-24add MS_LAZYTIME mount option to sys/mount.hSzabolcs Nagy1-1/+2
new in linux 4.0 commit 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8, used to update atime/mtime/ctime only in memory when possible.
2016-01-24add AF_MPLS (PF_MPLS) address family to socket.hSzabolcs Nagy1-0/+2
new in linux 4.0 commit 0189197f441602acdca3f97750d392a895b778fd.
2016-01-24add MSG_FASTOPEN sendmsg/sendto flag to socket.hSzabolcs Nagy1-0/+1
This was new in linux 3.5 in commit cf60af03ca4e71134206809ea892e49b92a88896, needed for tcp fastopen feature (sending data in TCP SYN packet).
2016-01-17netinet/tcp: Add TCPOPT, TCPOLEN constantsKylie McClain1-0/+13
Programs such as iptables depend on these constants, which can also be found defined in other libcs. Since only TCP_* is reserved as part of tcp.h's namespace, we hide them behind _BSD_SOURCE (and therefore _DEFAULT_SOURCE) to expose them by default, but keep it standard conforming.
2015-11-02fix mismatched parens in CMPLX def for annex-g-conforming compilersRich Felker1-1/+1
this conditional path was never tested because there are no compilers that conform to annex g (none with _Imaginary_I).
2015-09-17remove attribute((const)) from pthread_self and errno location declsRich Felker3-9/+0
this attribute was applied to pthread_self and the functions providing the locations for errno and h_errno as an optimization; however, it is subtly incorrect. as specified, it means the return value will always be the same, which is not true; it varies per-thread. this attribute also implies that the function does not depend on any state, and that calls to it can safely be reordered across any other code. however such reordering is unsafe for these functions: they break when reordered before initialization of the thread pointer. such breakage was actually observed when compiled by libfirm/cparser. to some extent the reordering problem could be solved with strong compiler barriers between the stages of early startup code, but the specified meaning of of attribute((const)) is sufficiently strong that a compiler would theoretically be justified inserting gratuitous calls to attribute((const)) const functions at random locations (e.g. to save the value in static storage for later use). this reverts commit cbf35978a9870fb1f5c73a852c986d4fcca6c2d4.
2015-09-15add format argument attributes to gettext function prototypesKhem Raj1-6/+14
their absence completely breaks format string warnings in programs with gettext message translations: -Wformat gives no results, and -Wformat-nonliteral produces spurious warnings. with gcc, the problem manifests only in standards-conforming profiles; otherwise gcc sets these attributes by default for the gettext family. with clang, the problem always manifests; clang has no such defaults.
2015-09-12add sh relocation types needed for fdpic to elf.hRich Felker1-0/+8
2015-07-21socket.h: fix SO_* for mipsRoman Yeryomin1-3/+3
Signed-off-by: Roman Yeryomin <roman@ubnt.com>
2015-07-09fix incorrect void return type for syncfs functionRich Felker1-1/+1
being nonstandard, the closest thing to a specification for this function is its man page, which documents it as returning int. it can fail with EBADF if the file descriptor passed is invalid.
2015-06-16byte-based C locale, phase 3: make MB_CUR_MAX variable to activate codeRich Felker1-1/+2
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.
2015-06-06add macro version of ctype.h isascii functionRich Felker1-0/+1
presumably internal code (ungetwc and fputwc) was written assuming a macro implementation existed; otherwise use of isascii is just a pessimization.
2015-05-28add missing legacy LFS64 macros in sys/resource.hRich Felker1-0/+3
based on patch by Felix Janda, with RLIM64_SAVED_CUR and RLIM64_SAVED_MAX added for completeness.
2015-05-08fix netinet/ether.h for c++Szabolcs Nagy1-0/+8
2015-05-02improve iswdigit macro to diagnose errorsRich Felker2-2/+2
this is analogous to commit 2ca55a93f2a11185d72dcb69006fd2c30b5c3144 for the macros in ctype.h.
2015-05-01add IPTOS_CLASS_* macros to netinet/ip.hSzabolcs Nagy1-0/+12
These macros were introduced in glibc 2.12 to follow RFC 2474 which deprecates "IP Precedence" in favor of "Class Selector Codepoints".
2015-05-01fix integer overflow in elf.h macro SHF_EXCLUDERich Felker1-1/+1
2015-04-17add PR_*_FP_MODE prctl optionsSzabolcs Nagy1-0/+5
new in linux v4.0, commit 9791554b45a2acc28247f66a5fd5bbc212a6b8c8 used to work around a floating-point abi issue on mips
2015-04-17add PR_MPX_*_MANAGEMENT prctl optionsSzabolcs Nagy1-0/+3
new in linux v3.19, commit fe3d197f84319d3bce379a9c0dc17b1f48ad358c used for on-demand kernel allocation of bounds tables for mpx on x86
2015-04-17add IP_CHECKSUM socket option to netinet/in.hSzabolcs Nagy1-0/+1
new in linux v4.0, commit ad6f939ab193750cc94a265f58e007fb598c97b7
2015-04-17improve ctype.h macros to diagnose errorsRich Felker1-6/+6
the casts of the argument to unsigned int suppressed diagnosis of errors like passing a pointer instead of a character. putting the actual function call in an unreachable branch restores any diagnostics that would be present if the macros didn't exist and functions were used.
2015-04-01remove macro definition of longjmp from setjmp.hRich Felker1-1/+0
the C standard specifies that setjmp is a macro, but longjmp is a normal function. a macro version of it would be permitted (albeit useless) for C (not C++), but would have to be a function-like macro, not an object-like one.
2015-04-01move O_PATH definition back to arch bitsRich Felker1-3/+2
while it's the same for all presently supported archs, it differs at least on sparc, and conceptually it's no less arch-specific than the other O_* macros. O_SEARCH and O_EXEC are still defined in terms of O_PATH in the main fcntl.h.
2015-03-23fix FLT_ROUNDS regression in C++ applicationsRich Felker1-0/+8
commit 559de8f5f06da9022cbba70e22e14a710eb74513 redefined FLT_ROUNDS to use an external function that can report the actual current rounding mode, rather than always reporting round-to-nearest. however, float.h did not include 'extern "C"' wrapping for C++, so C++ programs using FLT_ROUNDS ended up with an unresolved reference to a name-mangled C++ function __flt_rounds.
2015-03-18fix MINSIGSTKSZ values for archs with large signal contextsRich Felker1-2/+0
the previous values (2k min and 8k default) were too small for some archs. aarch64 reserves 4k in the signal context for future extensions and requires about 4.5k total, and powerpc reportedly uses over 2k. the new minimums are chosen to fit the saved context and also allow a minimal signal handler to run. since the default (SIGSTKSZ) has always been 6k larger than the minimum, it is also increased to maintain the 6k usable by the signal handler. this happens to be able to store one pathname buffer and should be sufficient for calling any function in libc that doesn't involve conversion between floating point and decimal representations. x86 (both 32-bit and 64-bit variants) may also need a larger minimum (around 2.5k) in the future to support avx-512, but the values on these archs are left alone for now pending further analysis. the value for PTHREAD_STACK_MIN is not increased to match MINSIGSTKSZ at this time. this is so as not to preclude applications from using extremely small thread stacks when they know they will not be handling signals. unfortunately cancellation and multi-threaded set*id() use signals as an implementation detail and therefore require a stack large enough for a signal context, so applications which use extremely small thread stacks may still need to avoid using these features.