summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2024-10-22loongarch64: add TLSDESC supportXing Li-0/+1
2024-10-12sys/stat.h: fix typo in statx member name stx_dio_offset_alignKhem Raj-1/+1
This was added in 23ab04a8630225371455d5f4538fd078665bb646
2024-09-13statx: add new struct statx fields and corresponding mask macrosRich Felker-1/+8
2024-07-05syslog: revert LOG_FAC/LOG_FACMASK changesRich Felker-2/+2
commit 895736d49bd2bb318c69de99a05ea70c035c2da9 made these changes along with fixing a real bug in LOG_MAKEPRI. based on further information, they do not seem to be well-motivated or in line with policy. the result of LOG_FAC is not a meaningful facility value if we shift it down like before, but apparently the way it is used by applications is as an index into an array of facility names. moreover, all historical systems which define it do so with the shift. as it is a nonstandard interface, there is no justification for providing a macro by the same name that is incompatible with historical practice. the value of LOG_FACMASK likewise is 0x3f8 on all historical systems checked. while only 5 bits are used for existing facility codes, the convention seems to be that all 7 bits belong to the facility field and theoretically could be used to expand to having more facilities. that seems unlikely to happen, but there is no reason to make a gratuitously incompatible change here.
2024-06-22sys/epoll.h: add epoll ioctlsJoe Damato-0/+12
add two ioctls to get and set struct epoll_params to allow users to control epoll based busy polling of network sockets. added to uapi in commit 18e2bf0edf4dd88d9656ec92395aa47392e85b61 (Linux kernel 6.9 and newer).
2024-06-13syslog: fix incorrect LOG_MAKEPRI and LOG_FAC[MASK] macrosRich Felker-3/+3
these are nonstandard and unnecessary for using the associated functionality, but resulted in applications that used them malfunctioning. patch based on proposed fix by erny hombre.
2024-05-23add renameat2 linux syscall wrapperTony Ambardar-0/+7
This syscall is available since Linux 3.15 and also implemented in glibc from version 2.28. It is commonly used in filesystem or security contexts. Constants RENAME_NOREPLACE, RENAME_EXCHANGE, RENAME_WHITEOUT are guarded by _GNU_SOURCE as with glibc.
2024-05-11fix typo that broke sys/reg.h and sys/user.hGonzalo Alvarez-2/+2
commit 7019fbe103165b9b26a9391d5ecd4c7fcb6f3ec9 and commit e709a6f07ade208ba513f9225222336f30c304b0 misspelled bits/alltypes.h.
2024-05-08implement posix_getdents adopted for next issue of POSIXRich Felker-3/+15
this interface was added as the outcome of Austin Group tracker issue 697. no error is specified for unsupported flags, which is probably an oversight. for now, EOPNOTSUPP is used so as not to overload EINVAL.
2024-05-07sys/user.h: derive __WORDSIZE from __LONG_MAXRich Felker-0/+9
previously, only a few archs defined it here. this change makes the presence consistent across all archs, and reduces the amount of header duplication (and potential for future inconsistency) between archs.
2024-05-07sys/reg.h: derive __WORDSIZE from __LONG_MAXRich Felker-0/+9
this removes an otherwise-unnecessary bits header from most archs, replacing it with an empty generic version.
2024-05-07unistd.h: derive ILP32/LP64 macros from __LONG_MAX instead of arch bitsRich Felker-1/+7
2024-04-24add missing STATX_ATTR_* macros omitted when statx was addedRich Felker-0/+10
commit b817541f1cfd38e4b81257b3215e276ea9d0fc61 added statx and the mask constant macros, but not the stx_attributes[_mask] ones.
2024-03-13uio.h: add RWF_NOAPPEND flag for pwritev2Rich Felker-0/+1
added in linux kernel commit 73fa7547c70b32cc69685f79be31135797734eb6. this is added now as a prerequisite for fixing pwrite/pwritev behavior for O_APPEND files.
2024-02-26switch __STDC_UTF_{16,32}__ macro definitions from #undef to #ifndefRich Felker-2/+4
originally, compilers did not provide these macros and we had to provide them ourselves. this meant we were redefining them, which was technically invalid unless the token sequence of the original definition matched exactly. the original patch proposed by Jules Maselbas to fix this made the definitions conditional on them not already being defined; however I suggested using #undef to avoid any possibly-wrong definitions already in place and ensure that the definitions are 1. the version adopted as commit 8b7048680731707d135ea231f81eb3eaf52378ee made this change. unfortunately, gcc is loud about not liking #undef of any __STDC_* macro name, and while warnings are suppressed in the system include path, there is apparently no way to suppress this warning if the system include dir has also been provided via -I. while normally we don't go out of our way to satisfy warnings over style in the public headers, in this case, it seems to be a matter of disagreement over contract of which part of "the implementation" is entitled to define or undefine macros belonging to the implementation, and it's quite reasonable to conclude that the compiler may reject attempts to undefine them. this commit reverts to the originally-submitted version of the patch making the definitions conditional.
2024-02-24add statx interface using syscall, fallback to fstatatDuncan Bellamy-0/+55
2024-02-16add loongarch64 portHongliang Wang-1/+103
Author: Xiaojuan Zhai <zhaixiaojuan@loongson.cn> Author: Meidan Li <limeidan@loongson.cn> Author: Guoqi Chen <chenguoqi@loongson.cn> Author: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Author: Fan peng <fanpeng@loongson.cn> Author: Jiantao Shan <shanjiantao@loongson.cn> Author: Xuhui Qiang <qiangxuhui@loongson.cn> Author: Jingyun Hua <huajingyun@loongson.cn> Author: Liu xue <liuxue@loongson.cn> Author: Hongliang Wang <wanghongliang@loongson.cn>
2024-02-08fix erroneous feature test macro check for ppollRich Felker-2/+2
commit f247462b0831cbf163e976ee9a909748c674b88b incorrectly hid ppoll in the presence of _GNU_SOURCE due to an oversight that defining _BSD_SOURCE does not implicitly define _GNU_SOURCE. at present, headers still have to explicitly check for each feature profile level; this may be changed at some point in the future via features.h, but has not been changed yet.
2024-02-03stdc-predef.h: prevent redefining __STDC_UTF_{16,32}__ macrosJules Maselbas-0/+3
Undefine any previous __STDC_UTF_{16,32}__ macros before defining them to prenvent any warnings of redefining macros. This happens as a result of some compiler versions defining the macros themselves.
2024-02-03elf.h: add NT_RISCV_CSR and NT_RISCV_VECTOR constantsElliott Hughes-0/+2
See Linux commit 9300f00439743c4a34d735e1a27118eb68a1504e ("RISC-V: Add ptrace support for vectors").
2024-02-03elf.h: update RISC-V relocation typesFangrui Song-6/+10
Note: Some relocation types were only used by binutils and accidentally exposed to previous versions of psABI. One of the values has been reused by GOT32_PCREL.
2024-01-25add preadv2 and pwritev2 syscall wrappers, flag value macrosRich Felker-0/+7
2024-01-21expose ppoll in default feature profileRich Felker-2/+2
the ppoll function has been accepted as a future part of the standard as the outcome of Austin Group tracker issue 1263. at some point it should be exposed unconditionally, but for now, expose it in the default feature profile.
2023-11-06remove non-prototype declaration of basename from string.hRich Felker-3/+0
commit 37bb3cce4598c19288628e675eaf1cda6e96958f suppressed the declaration for C++, where it is wrongly interpreted as declaring the function as taking no arguments. with C23 removing non-prototype declarations, that problem is now also relevant to C. the non-prototype declaration for basename originates with commit 06aec8d7152dfb8360cb7ed9b3d7215ca0b0b500, where it was designed to avoid conflicts with programs which declare basename with the GNU signature taking const char *. that change was probably misguided, as it represents not only misaligned expectations with the caller, but also undefined behavior (calling a function that's been declared with the wrong type). we could opt to fix the declaration, but since glibc, with the gratuitously incompatible GNU-basename function, seems to be the only implementation that declares it in string.h, it seems better to just remove the declaration. this provides some warning if applications are being built expecting the GNU behavior but not getting it. if we declared it here, it would only produce a warning if the caller also declares it themselves (rare) or if the caller attempts to pass a const-qualified pointer.
2023-11-06elf.h: add typedefs for Elf64_Relr and Elf32_RelrViolet Purcell-0/+5
These were overlooked when DT_RELR was added in commit d32dadd60efb9d3b255351a3b532f8e4c3dd0db1, potentially breaking software that treats presence of the DT_RELR macro as implying they exist.
2023-08-19statvfs: allocate spare for f_typeнаб-1/+2
This is the only missing part in struct statvfs. The LSB calls [f]statfs() deprecated, and its weird types are definitely off-putting. However, its use is required to get f_type. Instead, allocate one of the six spares to f_type, copied directly from struct statfs. This then becomes a small extension to the standard interface on Linux, instead of two different interfaces, one of which is quite odd due to being an ABI type, and there no longer is any reason to use statfs(). The underlying kernel type is a mess, but all architectures agree on u32 (or more) for the ABI, and all filesystem magicks are 32-bit integers. Since commit 6567db65f495cf7c11f5c1e60a3e54543d5a69bc (prior to 1.0.0), the spare slots have been zero-filled, so on all versions that may be reasonably be encountered in the wild, applications can rely on a nonzero f_type as indication that the new field has been filled in.
2023-05-02move fallocate64 declaration under _LARGEFILE64_SOURCE feature testRich Felker-1/+3
overlooked in commit 25e6fee27f4a293728dd15b659170e7b9c7db9bc, probably because the fallocate function itself is nonstandard and already under _GNU_SOURCE.
2023-02-23fix incorrect unit for CPU_SETSIZE macroRich Felker-1/+1
this macro is supposed to reflect the number of members (bits) in cpu_set_t, not the storage size (bytes).
2023-02-08fix integer overflow in WIFSTOPPED macroRich Felker-2/+2
the result of the 0xffff mask with the exit status could have bit 15 set, in which case multiplying by 0x10001 overflows 32-bit signed int. making the multiply unsigned avoids the overflow. it also changes the sign extension behavior of the subsequent >> operation, but the affected bits are all unwanted anyway and all discarded by the cast to short.
2023-01-06expose memmem under baseline POSIX feature profileRich Felker-1/+1
memmem has been adopted for the next issue of POSIX (outcome of tracker item 1061). since mem* is in the reserved namespace for string.h it's already fully conforming to expose it by default, so just do so.
2022-12-14elf.h: add ELFCOMPRESS_ZSTDFangrui Song-0/+1
2022-10-19remove LFS64 programming interfaces (macro-only) from _GNU_SOURCERich Felker-16/+16
these badly pollute the namespace with macros whenever _GNU_SOURCE is defined, which is always the case with g++, and especially tends to interfere with C++ constructs. as our implementation of these was macro-only, their removal cannot affect any existing binaries. at the source level, portable software should be prepared for them not to exist. for now, they are left in place with explicit _LARGEFILE64_SOURCE. this provides an easy temporary path for integrators/distributions to get packages building again right away if they break while working on a proper, upstreamable fix. the intent is that this be a very short-term measure and that the macros be removed entirely in the next release cycle.
2022-09-22arpa/nameser.h: update RR types listRich Felker-0/+71
our RR type list in arpa/nameser.h was badly outdated, and missing important types for DNSSEC and DANE use, among other things.
2022-09-20getaddrinfo: add EAI_NODATA error code to distinguish NODATA vs NxDomainRich Felker-0/+1
this was apparently omitted long ago out of a lack of understanding of its importance and the fact that POSIX doesn't specify it. despite not being officially standardized, however, it turns out that at least AIX, glibc, NetBSD, OpenBSD, QNX, and Solaris document and support it. in certain usage cases, such as implementing a DNS gateway on top of the stub resolver interfaces, it's necessary to distinguish the case where a name does not exit (NxDomain) from one where it exists but has no addresses (or other records) of the requested type (NODATA). in fact, even the legacy gethostbyname API had this distinction, which we were previously unable to support correctly because the backend lacked it. apart from fixing an important functionality gap, adding this distinction helps clarify to users how search domain fallback works (falling back in cases corresponding to EAI_NONAME, not in ones corresponding to EAI_NODATA), a topic that has been a source of ongoing confusion and frustration. as a result of this change, EAI_NONAME is no longer a valid universal error code for getaddrinfo in the case where AI_ADDRCONFIG has suppressed use of all address families. in order to return an accurate result in this case, getaddrinfo is modified to still perform at least one lookup. this will almost surely fail (with a network error, since there is no v4 or v6 network to query DNS over) unless a result comes from the hosts file or from ip literal parsing, but in case it does succeed, the result is replaced by EAI_NODATA. glibc has a related error code, EAI_ADDRFAMILY, that could be used for the AI_ADDRCONFIG case and certain NODATA cases, but distinguishing them properly in full generality seems to require additional DNS queries that are otherwise not useful. on glibc, it is only used for ip literals with mismatching family, not for DNS or hosts file results where the name has addresses only in the opposite family. since this seems misleading and inconsistent, and since EAI_NODATA already covers the semantic case where the "name" exists but doesn't have any addresses in the requested family, we do not adopt EAI_ADDRFAMILY at this time. this could be changed at some point if desired, but the logic for getting all the corner cases with AI_ADDRCONFIG right is slightly nontrivial.
2022-08-26add sysconf keys/values for signal stack sizeRich Felker-0/+2
as a result of ISA extensions exploding register file sizes on some archs, using a constant for minimum signal stack size no longer seems viably future-proof. add sysconf keys allowing the kernel to provide a machine-dependent minimum applications can query to ensure they allocate sufficient space for stacks. the key names and indices align with the same functionality in glibc. see commit d5a5045382315e36588ca225889baa36ed0ed38f for previous action on this subject. ultimately, the macros MINSIGSTKSZ and SIGSTKSZ probably need to be deprecated, but that is standards-amendment work outside the scope of a single implementation.
2022-08-02ldso: support DT_RELR relative relocation formatFangrui Song-2/+6
this resolves DT_RELR relocations in non-ldso, dynamic-linked objects.
2022-08-01fix strings.h feature test macro usage due to missing features.hMichael Pratt-0/+1
2022-04-20add missing POSIX confstr keys for pthread CFLAGS/LDFLAGSRich Felker-0/+2
_CS_POSIX_V7_THREADS_CFLAGS and _CS_POSIX_V7_THREADS_LDFLAGS have been missing for a long time, which is a conformance defect. we were waiting on glibc to add them or at least agree on the numeric values they will have so as to keep the numbering aligned. it looks like they will be added to glibc with these numbers, and in any case, this list does not have any significant churn that would result in the numbers getting taken.
2022-03-08sys/ptrace.h: add PTRACE_GET_RSEQ_CONFIGURATION from linux v5.13Szabolcs Nagy-0/+9
see linux commit 90f093fa8ea48e5d991332cee160b761423d55c1 rseq, ptrace: Add PTRACE_GET_RSEQ_CONFIGURATION request the struct type got __ prefix to follow existing practice.
2022-03-08sys/prctl.h: add PR_PAC_{SET,GET}_ENABLED_KEYS from linux v5.13Szabolcs Nagy-0/+3
see linux commit 201698626fbca1cf1a3b686ba14cf2a056500716 arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)
2022-03-08elf.h: add NT_ARM_PAC_ENABLED_KEYS from linux v5.13Szabolcs Nagy-0/+1
see linux commit 201698626fbca1cf1a3b686ba14cf2a056500716 arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)
2022-03-08netinet/in.h: add INADDR_DUMMY from linux v5.13Szabolcs Nagy-0/+1
see linux commit 321827477360934dc040e9d3c626bf1de6c3ab3c icmp: don't send out ICMP messages with a source address of 0.0.0.0 "RFC7600 reserves a dummy address to be used as a source for ICMP messages (192.0.0.8/32), so let's teach the kernel to substitute that address as a last resort if the regular source address selection procedure fails."
2022-03-08netinet/tcp.h: add tcp_zerocopy_receive fields from linux v5.12Szabolcs Nagy-0/+4
see linux commit 7eeba1706eba6def15f6cb2fc7b3c3b9a2651edc tcp: Add receive timestamp support for receive zerocopy. linux commit 3c5a2fd042d0bfac71a2dfb99515723d318df47b tcp: Sanitize CMSG flags and reserved args in tcp_zerocopy_receive.
2022-03-08netinet/tcp.h: add TCP_NLA_* values up to linux v5.12Szabolcs Nagy-0/+2
TCP_NLA_EDT was new in v5.9, see linux commit 48040793fa6003d211f021c6ad273477bcd90d91 tcp: add earliest departure time to SCM_TIMESTAMPING_OPT_STATS TCP_NLA_TTL is new in v5.12, see linux commit e7ed11ee945438b737e2ae2370e35591e16ec371 tcp: add TTL to SCM_TIMESTAMPING_OPT_STATS
2022-03-08signal.h: add new sa_flags from linux v5.11Szabolcs Nagy-0/+3
see linux commit a54f0dfda754c5cecc89a14dab68a3edc1e497b5 signal: define the SA_UNSUPPORTED bit in sa_flags linux commit 6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa signal: define the SA_EXPOSE_TAGBITS bit in sa_flags Note: SA_ is in the posix reserved namespace so these linux specific flags can be exposed when compiling for posix.
2022-03-08signal.h: add SYS_USER_DISPATCH si_code value from linux v5.11Szabolcs Nagy-0/+1
see linux commit 1d7637d89cfce54a4f4a41c2325288c2f47470e8 signal: Expose SYS_USER_DISPATCH si_code type
2022-03-08signal.h: add si_code values for SIGSYSSzabolcs Nagy-0/+2
unlike other si_code defines, SYS_ is not in the posix reserved namespace which is likely the reason why SYS_SECCOMP was previously missing (was new in linux v3.5).
2022-03-08netinet/tcp.h: add tcp zerocopy related changes from linux v5.11Szabolcs Nagy-0/+5
see linux commit 18fb76ed53865c1b5d5f0157b1b825704590beb5 net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy. linux commit 94ab9eb9b234ddf23af04a4bc7e8db68e67b8778 net-zerocopy: Defer vm zap unless actually needed.
2022-03-08netinet/if_ether.h: add ETH_P_CFM from linux v5.11Szabolcs Nagy-0/+1
see linux commit fbaedb4129838252570410c65abb2036b5505cbd bridge: uapi: cfm: Added EtherType used by the CFM protocol.
2022-03-08sys/socket.h: add new SO_ socket options from linux v5.11Szabolcs Nagy-0/+2
see linux commit 7fd3253a7de6a317a0683f83739479fb880bffc8 net: Introduce preferred busy-polling linux commit 7c951cafc0cb2e575f1d58677b95ac387ac0a5bd net: Add SO_BUSY_POLL_BUDGET socket option