summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2019-10-17define LONG_MAX via arch alltypes.h, strip down bits/limits.hRich Felker-5/+11
LLONG_MAX is uniform for all archs we support and plenty of header and code level logic assumes it is, so it does not make sense for limits.h bits mechanism to pretend it's variable. LONG_BIT can be defined in terms of LONG_MAX; there's no reason to put it in bits. by moving LONG_MAX definition to __LONG_MAX in alltypes.h and moving LLONG_MAX out of bits, there are now no plain-C limits that are defined in the bits header, so the bits header only needs to be included in the POSIX or extended profiles. this allows the feature test macro logic to be removed from the bits header, facilitating a long-term goal of getting such logic out of bits. having __LONG_MAX in alltypes.h will allow further generalization of headers. archs without a constant PAGESIZE no longer need bits/limits.h at all.
2019-10-17make endian.h expose unprefixed macros, functions in standard profileRich Felker-16/+20
the resolution of Austin Group issue #162 adds endian.h as a standard header for future versions of the standard, making it no longer acceptable for some of the functionality to be hidden behind _BSD_SOURCE or _GNU_SOURCE. the definitions of the [lb]etoh{16,32,64} function-like macros are kept conditional since they are alternate names which the standard did not adopt.
2019-10-17remove indirect use of endian.h from public headersRich Felker-10/+0
building on commit 97d35a552ec5b6ddf7923dd2f9a8eb973526acea, __BYTE_ORDER is now available wherever alltypes.h is included. endian.h should not be used since, in the future, it will expose identifiers that are not in the reserved namespace for the headers which were previously using it.
2019-10-17move __BYTE_ORDER definition to alltypes.hRich Felker-7/+4
this change is motivated by the intersection of several factors. presently, despite being a nonstandard header, endian.h is exposing the unprefixed byte order macros and functions only if _BSD_SOURCE or _GNU_SOURCE is defined. this is to accommodate use of endian.h from other headers, including bits headers, which need to define structure layout in terms of endianness. with time64 switch-over, even more headers will need to do this. at the same time, the resolution of Austin Group issue 162 makes endian.h a standard header for POSIX-future, requiring that it expose the unprefixed macros and the functions even in standards-conforming profiles. changes to meet this new requirement would break existing internal usage of endian.h by causing it to violate namespace where it's used. instead, have the arch's alltypes.h define __BYTE_ORDER, either as a fixed constant or depending on the right arch-specific predefined macros for determining endianness. explicit literals 1234 and 4321 are used instead of __LITTLE_ENDIAN and __BIG_ENDIAN so that there's no danger of getting the wrong result if a macro is undefined and implicitly evaluates to 0 at the preprocessor level. the powerpc (32-bit) bits/endian.h being removed had logic for varying endianness, but our powerpc arch has never supported that and has always been big-endian-only. this logic is not carried over to the new __BYTE_ORDER definition in alltypes.h.
2019-10-17remove per-arch definitions for va_listRich Felker-0/+3
now that commit f7f1079796abc6f97c69521d2334e9c7d3945dd8 removed the legacy i386 conditional definition, va_list is in no way arch-specific, and has no reason to be in the future. move it to the shared part of alltypes.h.in
2019-09-11fcntl.h: add AT_RECURSIVE from linux v5.2Szabolcs Nagy-0/+1
apply open_tree with OPEN_TREE_CLONE call to the entire subtree, see linux commit a07b20004793d8926f78d63eb5980559f7813404 vfs: syscall: Add open_tree(2) to reference or clone a mount
2019-09-11fcntl.h: add AT_STATX_ statx sync flag definitionsSzabolcs Nagy-0/+4
see linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f statx: Add a system call to make enhanced file info available these are linux specific and not reserved names for fcntl.h so they are under _BSD_SOURCE|_GNU_SOURCE.
2019-09-11sched.h: add CLONE_PIDFD from linux v5.2Szabolcs Nagy-0/+1
when set a pidfd is stored in parent_tidptr, see linux commit b3e5838252665ee4cfa76b82bdf1198dca81e5be clone: add CLONE_PIDFD
2019-09-11netinet/if_ether.h: add ETH_P_DSA_8021Q from linux v5.2Szabolcs Nagy-0/+1
ethertype for fake VLAN header for DSA, see linux commit bf5bc3ce8a8f32a0d45b6820ede8f9fc3e9c23df ether: Add dedicated Ethertype for pseudo-802.1Q DSA tagging
2019-08-30add public declaration for optreset under appropriate feature profilesRich Felker-0/+1
commit 030e52639248ac8417a4934298caa78c21a228d1 added optreset, a BSD extension to getopt duplicating the functionality (also an extension) of setting optind to 0, but failed to provide a public declaration for it. according to the BSD documentation and headers, the application is not supposed to need to provide its own declaration.
2019-08-30add posix_spawn [f]chdir file actionsRich Felker-0/+5
these are presently extensions, thus named with _np to match glibc and other implementations that provide them; however they are likely to be standardized in the future without the _np suffix as a result of Austin Group issue 1208. if so, both names will be kept as aliases.
2019-08-23add copy_file_range system call wrapperÁrni Dagur-0/+1
2019-08-14remove sporadic server members from struct sched_paramRich Felker-4/+6
these members are associated with an unsupported option group. with time_t changing size on 32-bit archs, all interfaces taking struct sched_param arguments would need redirection and compat shims in order to be able to continue offering these members, for no benefit. just convert them to reserved space instead.
2019-08-08add secure_getenv functionPetr Vaněk-0/+1
This function is a GNU extension introduced in glibc 2.17.
2019-08-06glob: implement GLOB_TILDE and GLOB_TILDE_CHECKIsmael Luceno-0/+3
2019-08-02move IPC_STAT definition to a new bits/ipcstat.h fileRich Felker-3/+1
otherwise, 32-bit archs that could otherwise share the generic bits/ipc.h would need to duplicate the struct ipc_perm definition, obscuring the fact that it's the same. sysvipc is not widely used and these headers are not commonly included, so there is no performance gain to be had by limiting the number of indirectly included files here. files with the existing time32 definition of IPC_STAT are added to all current 32-bit archs now, so that when it's changed the change will show up as a change rather than addition of a new file where it's less obvious that the value is changing vs the generic one that was used before.
2019-08-02allow archs to define IPC_STAT, propagate time64 bit to other macrosRich Felker-6/+8
to make use of {sem,shm,msg}ctl IPC_STAT functionality to provide 64-bit time_t on 32-bit archs, IPC_STAT and related macros must be defined with bit 8 (0x100) set. allow archs to define IPC_STAT in bits/ipc.h, and define the other macros in terms of it so that they all get the same value of the time64 bit.
2019-07-01elf.h: add NT_ARM_PAC{A,G}_KEYS from linux v5.1Szabolcs Nagy-0/+2
to request or change pointer auth keys for criu via ptrace, new in linux commit d0a060be573bfbf8753a15dca35497db5e968bb0 arm64: add ptrace regsets for ptrauth key management
2019-07-01netinet/in.h: add INADDR_ALLSNOOPERS_GROUP from linux v5.1Szabolcs Nagy-0/+1
RFC 4286: "The IPv4 multicast address for All-Snoopers is 224.0.0.106." from linux commit 4effd28c1245303dce7fd290c501ac2c11052114 bridge: join all-snoopers multicast address
2019-07-01sys/socket.h: add SO_BINDTOIFINDEX from linux v5.1Szabolcs Nagy-0/+1
SO_BINDTOIFINDEX behaves similar to SO_BINDTODEVICE, but takes a network interface index as argument, rather than the network interface name. see linux commit f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c net: introduce SO_BINDTOIFINDEX sockopt
2019-07-01netinet/in.h: add IPV6_ROUTER_ALERT_ISOLATE from linux v5.1Szabolcs Nagy-0/+1
restricts router alert packets received by the socket to the socket's namespace only. see linux commit 9036b2fe092a107856edd1a3bad48b83f2b45000 net: ipv6: add socket option IPV6_ROUTER_ALERT_ISOLATE
2019-07-01sys/prctl.h: add PR_SPEC_DISABLE_NOEXEC from linux v5.1Szabolcs Nagy-0/+1
allows specifying that the speculative store bypass disable bit should be cleared on exec. see linux commit 71368af9027f18fe5d1c6f372cfdff7e4bde8b48 x86/speculation: Add PR_SPEC_DISABLE_NOEXEC
2019-07-01fcntl.h: add F_SEAL_FUTURE_WRITE from linux v5.1Szabolcs Nagy-0/+1
needed for android so it can migrate from its ashmem to memfd. allows making the memfd readonly for future users while keeping a writable mmap of it. see linux commit ab3948f58ff841e51feb845720624665ef5b7ef3 mm/memfd: add an F_SEAL_FUTURE_WRITE seal to memfd
2019-07-01sys/fanotify.h: update for linux v5.1Szabolcs Nagy-1/+33
includes changes from linux v5.1 linux commit 235328d1fa4251c6dcb32351219bb553a58838d2 fanotify: add support for create/attrib/move/delete events linux commit 5e469c830fdb5a1ebaa69b375b87f583326fd296 fanotify: copy event fid info to user linux commit e9e0c8903009477b630e37a8b6364b26a00720da fanotify: encode file identifier for FAN_REPORT_FID as well as earlier changes that were missed. sys/statfs.h is included for fsid_t.
2019-06-21remove implicit include of sys/sysmacros.h from sys/types.hRich Felker-1/+0
this reverts commit f552c792c7ce5a560f214e1104d93ee5b0833967, which exposed the sysmacros.h macros (device major/minor calculations) for BSD and GNU profiles to mimic an unintentional glibc behavior some code depended on. glibc has deprecated and since removed them as the resolution to bug #19239, so it makes no sense for us to keep this behavior. affected code should all have been fixed by now, and if it's not yet fixed it needs to be for use with modern glibc anyway.
2019-06-14add riscv64 architecture supportRich Felker-0/+56
Author: Alex Suykov <alex.suykov@gmail.com> Author: Aric Belsito <lluixhi@gmail.com> Author: Drew DeVault <sir@cmpwn.com> Author: Michael Clark <mjc@sifive.com> Author: Michael Forney <mforney@mforney.org> Author: Stefan O'Rear <sorear2@gmail.com> This port has involved the work of many people over several years. I have tried to ensure that everyone with substantial contributions has been credited above; if any omissions are found they will be noted later in an update to the authors/contributors list in the COPYRIGHT file. The version committed here comes from the riscv/riscv-musl repo's commit 3fe7e2c75df78eef42dcdc352a55757729f451e2, with minor changes by me for issues found during final review: - a_ll/a_sc atomics are removed (according to the ISA spec, lr/sc are not safe to use in separate inline asm fragments) - a_cas[_p] is fixed to be a memory barrier - the call from the _start assembly into the C part of crt1/ldso is changed to allow for the possibility that the linker does not place them nearby each other. - DTP_OFFSET is defined correctly so that local-dynamic TLS works - reloc.h LDSO_ARCH logic is simplified and made explicit. - unused, non-functional crti/n asm files are removed. - an empty .sdata section is added to crt1 so that the __global_pointer reference is resolvable. - indentation style errors in some asm files are fixed.
2019-04-17define FP_FAST_FMA* when fma* can be inlinedSzabolcs Nagy-0/+12
FP_FAST_FMA can be defined if "the fma function generally executes about as fast as, or faster than, a multiply and an add of double operands", which can only be true if the fma call is inlined as an instruction. gcc sets __FP_FAST_FMA if __builtin_fma is inlined as an instruction, but that does not mean an fma call will be inlined (e.g. it is defined with -fno-builtin-fma), other compilers (clang) don't even have such macro, but this is the closest we can get. (even if the libc fma implementation is a single instruction, the extern call overhead is already too big when the macro is used to decide between x*y+z and fma(x,y,z) so it cannot be based on libc only, defining the macro unconditionally on targets which have fma in the base isa is also incorrect: the compiler might not inline fma anyway.) this solution works with gcc unless fma inlining is explicitly turned off.
2019-04-10fcntl.h: define O_TTY_INIT to 0A. Wilcox-2/+3
POSIX: "[If] either O_TTY_INIT is set in oflag or O_TTY_INIT has the value zero, open() shall set any non-standard termios structure terminal parameters to a state that provides conforming behavior." The Linux kernel tty drivers always perform initialisation on their devices to set known good termios values during the open(2) call. This means that setting O_TTY_INIT to zero is conforming.
2019-04-05fix signature of function accepted by makecontextBobby Bingham-1/+1
This parameter was incorrectly declared to be a pointer to a function accepting zero parameters. The intent of makecontext is that it is possible to pass integer parameters to the function, so this should have been a pointer to a function accepting an unspecified set of parameters.
2019-03-13sys/prctl.h: add PR_PAC_RESET_KEYS from linux v5.0Szabolcs Nagy-0/+7
aarch64 pointer authentication code related prctl that allows reinitializing the key for the thread, added in linux commit ba830885656414101b2f8ca88786524d4bb5e8c1
2019-03-13elf.h: add NT_ definitions from linux v5.0Szabolcs Nagy-0/+2
NT_MIPS_MSA for ptrace access to mips simd arch reg set, added in linux commit 3cd640832894b85b5929d5bda74505452c800421 NT_ARM_PAC_MASK for ptrace access to pointer auth code mask, added in commit ec6e822d1a22d0eef1d1fa260dff751dba9a4258
2019-03-13elf.h: update with C-SKY definitionsSzabolcs Nagy-1/+57
C-SKY support was added to binutils 2.32 in commit b8891f8d622a31306062065813fc278d8a94fe21 the elf.h change was added to glibc 2.29 in commit 4975f0c3d0131fdf697be0b1631c265e5fd39088
2019-03-13netinet/tcp.h: add TCP_NLA_SRTT from linux v5.0Szabolcs Nagy-0/+1
smoothed RTT for SCM_TIMESTAMPING_OPT_STATS control messages. added in linux commit e8bd8fca6773ef49390269bd467bf940a0841ccf
2019-03-13netinet/udp.h: add UDP_GRO from linux v5.0Szabolcs Nagy-0/+1
sockopt to enable gro for udp. added in linux commit e20cf8d3f1f763ad28a9cb3b41305b8a8a42653e
2019-03-13sys/prctl.h: add PR_SPEC_INDIRECT_BRANCH from linux v4.20Szabolcs Nagy-0/+1
prctls to allow per task control of indirect branch speculation on x86. added in linux commit 9137bb27e60e554dab694eafa4cca241fa3a694f
2019-03-13netinet/in.h add IPV6_MULTICAST_ALL from linux v4.20Szabolcs Nagy-0/+1
ipv6 analogue of IP_MULTICAST_ALL sockopt. added in linux commit 15033f0457dca569b284bef0c8d3ad55fb37eacb
2019-03-13add PACKET_IGNORE_OUTGOING sockopt from linux v4.20Szabolcs Nagy-0/+1
new in linux commit fa788d986a3aac5069378ed04697bd06f83d3488
2019-03-13sys/mman.h: add new hugetlb mmap flags from linux v4.19Szabolcs Nagy-0/+4
aarch64 supports 32MB and 512MB hugetlb page sizes too. added in linux commit 20916d4636a9b3c1bf562b305f91d126771edaf9
2019-03-13elf.h: add new mips core dump note values from linux v4.19Szabolcs Nagy-0/+2
NT_MIPS_FP_MODE is new in linux commit 1ae22a0e35636efceab83728ba30b013df761592 NT_MIPS_DSP is new in linux commit 44109c60176ae73924a42a6bef64ef151aba9095
2019-03-13netinet/udp.h: add UDP_ENCAP_RXRPC from linux v4.19Szabolcs Nagy-0/+1
used for optimizing the rxrpc protocol added in linux commit 5271953cad31b97dea80f848c16e96ad66401199
2019-03-13netinet/tcp.h: add tcp_info fields from linux v4.19Szabolcs Nagy-0/+8
new fields for RFC 4898 tcp stats in linux tcpi_bytes_sent added in commit ba113c3aa79a7f941ac162d05a3620bdc985c58d tcpi_bytes_retrans added in commit fb31c9b9f6c85b1bad569ecedbde78d9e37cd87b tcpi_dsack_dups added in commit 7e10b6554ff2ce7f86d5d3eec3af5db8db482caa tcpi_reord_seen added in commit 7ec65372ca534217b53fd208500cf7aac223a383 The new fields change the size of a public struct and thus an ABI break, but this is how the getsockopt TCP_INFO api is designed: the tcp_info type must only be used with a length parameter in extern interfaces.
2019-03-13sys/inotify.h: add IN_MASK_CREATE from linux v4.19Szabolcs Nagy-0/+1
inotify_add_watch flag to prevent modifying existing watch descriptors, when used on an already watched inode it fails with EEXIST. added in linux commit 4d97f7d53da7dc830dbf416a3d2a6778d267ae68
2019-03-13sys/socket.h: add SO_TXTIME from linux v4.19Szabolcs Nagy-0/+2
added in linux commit 80b14dee2bea128928537d61c333f24cb8cbb62f
2019-03-13fix POSIX_FADV_DONTNEED/_NOREUSE on s390xJonathan Neuschäfer-0/+2
On s390x, POSIX_FADV_DONTNEED and POSIX_FADV_NOREUSE have different values than on all other architectures that Linux supports. Handle this difference by wrapping their definitions in include/fcntl.h in #ifdef, so that arch/s390x/bits/fcntl.h can override them.
2019-03-13expose TSVTX unconditionally in tar.hRich Felker-4/+0
as noted in Austin Group issue #1236, the XSI shading for TSVTX is misplaced in the html version of the standard; it was only supposed to be on the description text. the intent was that the definition always be visible, which is reflected in the pdf version of the standard. this reverts commits d93c0740d86aaf7043e79b942a6c0b3f576af4c8 and 729fef0a9358e2f6f1cd8c75a1a0f7ee48b08c95.
2019-03-12make FILE a complete type for pre-C11 standard profilesRich Felker-0/+9
C11 removed the requirement that FILE be a complete type, which was deemed erroneous, as part of the changes introduced by N1439 regarding completeness of types (see footnote 6 for specific mention of FILE). however the current version of POSIX is still based on C99 and incorporates the old requirement that FILE be a complete type. expose an arbitrary, useless complete type definition because the actual object used to represent FILE streams cannot be public/ABI. thanks to commit 13d1afa46f8098df290008c681816c9eb89ffbdb, we now have a framework for suppressing the public complete-type definition of FILE when stdio.h is included internally, so that a different internal definition can be provided. this is perfectly well-defined, since the same struct tag can refer to different types in different translation units. it would be a problem if the implementation were accessing the application's FILE objects or vice versa, but either would be undefined behavior.
2019-02-22add membarrier syscall wrapper, refactor dynamic tls install to use itRich Felker-0/+17
the motivation for this change is twofold. first, it gets the fallback logic out of the dynamic linker, improving code readability and organization. second, it provides application code that wants to use the membarrier syscall, which depends on preregistration of intent before the process becomes multithreaded unless unbounded latency is acceptable, with a symbol that, when linked, ensures that this registration happens.
2019-02-07update line discipline constantsBobby Bingham-0/+12
2019-02-07move arch-invariant definitions out of bits/ioctl.hBobby Bingham-0/+98
2018-12-09add NT_VMCOREDD to elf.h from linux v4.18Szabolcs Nagy-0/+1
used for device driver dump in /proc/vmcore new in linux commit 2724273e8fd00b512596a77ee063f49b25f36507