Commit Graph

210 Commits

Author SHA1 Message Date
Rich Felker db86ec100d remove useless mips syscall asm constraint, align style with mips64/n32
commit 4221f154ff added the r7
constraint apparently out of a misunderstanding of the breakage it was
addressing, and did so because the asm was in a shared macro used by
all the __syscallN inline functions. now "+r" is used in the output
section for the forms 4-argument and up, so having it in input is
redundant, and the forms with 0-3 arguments don't need it as an input
at all.

the r2 constraint is kept because without it most gcc versions (seems
to be all prior to 9.x) fail to honor the output register binding for
r2. this seems to be a variant of gcc bug #87733.

both the r7 and r2 input constraints look useless, but the r2 one was
a quiet workaround for gcc bug 87733, which affects all modern
versions prior to 9.x, so it's kept and documented.
2020-03-14 21:23:37 -04:00
Rich Felker 972b5fde9a revert mips (32-bit, o32) syscall asm clean-up due to regressions
exactly revert commit 604f8d3d8b which
was wrong; it caused a major regression on Linux versions prior to
2.6.36. old kernels did not properly preserve r2 across syscall
restart, and instead restarted with the instruction right before
syscall, imposing a contract that the previous instruction must load
r2 from an immediate or a register (or memory) not clobbered by the
syscall.
2020-03-14 21:22:50 -04:00
Rich Felker b4712ba445 remove legacy time32 timer[fd] syscalls from public syscall.h
this extends commit 5a105f19b5, removing
timer[fd]_settime and timer[fd]_gettime. the timerfd ones are likely
to have been used in software that started using them before it could
rely on libc exposing functions.
2020-02-05 09:57:41 -05:00
Rich Felker 2cae9f59da remove further legacy time32 clock syscalls from public syscall.h
this extends commit 5a105f19b5, removing
clock_settime, clock_getres, clock_nanosleep, and settimeofday.
2020-02-05 09:51:09 -05:00
Rich Felker 5a105f19b5 remove legacy clock_gettime and gettimeofday from public syscall.h
some nontrivial number of applications have historically performed
direct syscalls for these operations rather than using the public
functions. such usage is invalid now that time_t is 64-bit and these
syscalls no longer match the types they are used with, and it was
already harmful before (by suppressing use of vdso).

since syscall() has no type safety, incorrect usage of these syscalls
can't be caught at compile-time. so, without manually inspecting or
running additional tools to check sources, the risk of such errors
slipping through is high.

this patch renames the syscalls on 32-bit archs to clock_gettime32 and
gettimeofday_time32, so that applications using the original names
will fail to build without being fixed.

note that there are a number of other syscalls that may also be unsafe
to use directly after the time64 switchover, but (1) these are the
main two that seem to be in widespread use, and (2) most of the others
continue to have valid usage with a null timeval/timespec argument, as
the argument is an optional timeout or similar.
2020-01-30 11:25:07 -05:00
Szabolcs Nagy 2fc29fcfc2 mips: add clone3 syscall numbers from linux v5.4
the syscall numbers were reserved in v5.3 but not wired up on mips, see

  linux commit 0671c5b84e9e0a6d42d22da9b5d093787ac1c5f3
  MIPS: Wire up clone3 syscall
2019-12-30 18:14:08 -05:00
Szabolcs Nagy a7df9c75f7 mips: add hwcap bits from linux v5.4
mips application specific isa extensions were previously not exported
in hwcaps so userspace could not apply optimized code at runtime.

  linux commit 38dffe1e4dde1d3174fdce09d67370412843ebb5
  MIPS: elf_hwcap: Export userspace ASEs
2019-12-30 18:14:08 -05:00
Szabolcs Nagy a45289112c add pidfd_open syscall number from linux v5.3
see

  linux commit 7615d9e1780e26e0178c93c55b73309a5dc093d7
  arch: wire-up pidfd_open()

  linux commit 32fcb426ec001cb6d5a4a195091a8486ea77e2df
  pid: add pidfd_open()
2019-12-30 18:12:53 -05:00
Khem Raj e17814aa5a fix types for mips sigcontext/mcontext_t regset members 2019-12-30 15:27:27 -05:00
Rich Felker d6dcfe4d0c move time_t and suseconds_t definitions to common alltypes.h.in
now that all 32-bit archs have 64-bit time_t (and suseconds_t), the
arch-provided _Int64 macro (long or long long, as appropriate) can be
used to define them, and arch-specific definitions are no longer
needed.
2019-11-02 18:30:56 -04:00
Rich Felker c71dbb24c9 move time64 socket options from arch bits to top-level sys/socket.h
now that all 32-bit archs have 64-bit time types, the values for the
time-related socket option macros can be treated as universal for
32-bit archs. the sys/socket.h mechanism for this predates
arch/generic and is instead in the top-level header.

x32, which does not use the new time64 values of the macros, already
has its own overrides, so this commit does not affect it.
2019-11-02 18:30:56 -04:00
Rich Felker 3814333964 switch all existing 32-bit archs to 64-bit time_t
this commit preserves ABI fully for existing interface boundaries
between libc and libc consumers (applications or libraries), by
retaining existing symbol names for the legacy 32-bit interfaces and
redirecting sources compiled against the new headers to alternate
symbol names. this does not necessarily, however, preserve the
pairwise ABI of libc consumers with one another; where they use
time_t-derived types in their interfaces with one another, it may be
necessary to synchronize updates with each other.

the intent is that ABI resulting from this commit already be stable
and permanent, but it will not be officially so until a release is
made. changes to some header-defined types that do not play any role
in the ABI between libc and its consumers may still be subject to
change.

mechanically, the changes made by this commit for each 32-bit arch are
as follows:

- _REDIR_TIME64 is defined to activate the symbol redirections in
  public headers

- COMPAT_SRC_DIRS is defined in arch.mak to activate build of ABI
  compat shims to serve as definitions for the original symbol names

- time_t and suseconds_t definitions are changed to long long (64-bit)

- IPC_STAT definition is changed to add the IPC_TIME64 bit (0x100),
  triggering conversion of semid_ds, shmid_ds, and msqid_ds split
  low/high time bits into new time_t members

- structs semid_ds, shmid_ds, msqid_ds, and stat are modified to add
  new 64-bit time_t/timespec members at the end, maintaining existing
  layout of other members.

- socket options (SO_*) and ioctl (sockios) command macros are
  redefined to use the kernel's "_NEW" values.

in addition, on archs where vdso clock_gettime is used, the
VDSO_CGT_SYM macro definition in syscall_arch.h is changed to use a
new time64 vdso function if available, and a new VDSO_CGT32_SYM macro
is added for use as fallback on kernels lacking time64.
2019-11-02 18:30:56 -04:00
Rich Felker a0252bc75b move msghdr and cmsghdr out of bits/socket.h
these structures can now be defined generically in terms of endianness
and long size. previously, the 32-bit archs all shared a common
definition from the generic bits header, and each 64-bit arch had to
repeat the 64-bit version, with endian conditionals if the arch had
variants of each endianness.

I would prefer getting rid of the preprocessor conditionals for
padding and instead using unnamed bitfield members, like commit
9b2921bea1 did for struct timespec.
however, at present sendmsg, recvmsg, and recvmmsg need access to the
padding members by name to zero them. this could perhaps be cleaned up
in the future.
2019-11-02 18:30:56 -04:00
Rich Felker 2d3083e746 move pthread types out of per-arch alltypes.h
policy has long been that these definitions are purely a function of
whether long/pointer is 32- or 64-bit, and that they are not allowed
to vary per-arch. move the definition to the shared alltypes.h.in
fragment, using integer constant expressions in terms of sizeof to
vary the array dimensions appropriately. I'm not sure whether this is
more or less ugly than using preprocessor conditionals and two sets of
definitions here, but either way is a lot less ugly than repeating the
same thing for every arch.
2019-10-17 19:35:17 -04:00
Rich Felker 7cc79d10af define LONG_MAX via arch alltypes.h, strip down bits/limits.h
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-17 19:23:39 -04:00
Rich Felker 4d3a162d00 remove use of endian.h from arch reloc.h headers, clean up
building on commit 97d35a552e,
__BYTE_ORDER is now available wherever alltypes.h is included. since
reloc.h is only used from src/internal/dynlink.h, it can be assumed
that __BYTE_ORDER is exposed. reloc.h is not permitted to be included
in other contexts, and generally, like most arch headers, lacks
inclusion guards that would allow such usage. the mips64 version
mistakenly included such guards; they are removed for consistency.
2019-10-17 16:06:12 -04:00
Rich Felker 97d35a552e move __BYTE_ORDER definition to alltypes.h
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-17 15:55:15 -04:00
Rich Felker 00ec11d19e remove per-arch definitions for va_list
now that commit f7f1079796 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-10-17 15:27:00 -04:00
Rich Felker 604f8d3d8b clean up mips (32-bit, o32) syscall asm constraints
analogous to commit ddc7c4f936 for
mips64 and n32, remove the hack to load the syscall number into $2 via
asm, and use a constraint to let the compiler load it instead.

now, only $4, $5, and $6 are potential input-only registers. $2 is
always input and output, and $7 is both when it's an argument,
otherwise output-only. previously, $7 was treated as an input (with a
"1" constraint matching its output position) even when it was not an
input, which was arguably undefined behavior (asm input from
indeterminate value). this is corrected.

as before, $8, $9, and $10 are conditionally input-output registers
for 5-, 6-, and 7-argument syscalls. their role in input is carrying
in the values that will be stored on the stack for arguments 5-7.
their role in output is carrying back whatever the kernel has
clobbered them with, so that the compiler cannot assume they still
contain the input values.
2019-09-27 10:31:37 -04:00
Rich Felker 9f6dd78593 fix mips r6 syscall clobber lists not to include hi/lo registers
mips r6 (an incompatible isa from traditional mips) removes the hi and
lo registers used for mul/div results. older gcc versions accepted
them in the clobber list for asm, but their presence is incorrect and
breaks on later versions.

in the process of fixing this, the clobber list for 32-bit mips
syscalls has been deduplicated via a macro like on mips64 and n32.
2019-09-26 19:14:36 -04:00
Szabolcs Nagy b60763092e add new syscall numbers from linux v5.2
new mount api syscalls were added, same numers on all targets, see

  linux commit a07b20004793d8926f78d63eb5980559f7813404
  vfs: syscall: Add open_tree(2) to reference or clone a mount

  linux commit 2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae
  vfs: syscall: Add move_mount(2) to move mounts around

  linux commit 24dcb3d90a1f67fe08c68a004af37df059d74005
  vfs: syscall: Add fsopen() to prepare for superblock creation

  linux commit ecdab150fddb42fe6a739335257949220033b782
  vfs: syscall: Add fsconfig() for configuring and managing a context

  linux commit 93766fbd2696c2c4453dd8e1070977e9cd4e6b6d
  vfs: syscall: Add fsmount() to create a mount for a superblock

  linux commit cf3cba4a429be43e5527a3f78859b1bfd9ebc5fb
  vfs: syscall: Add fspick() to select a superblock for reconfiguration

  linux commit 9c8ad7a2ff0bfe58f019ec0abc1fb965114dde7d
  uapi, x86: Fix the syscall numbering of the mount API syscalls [ver #2]

  linux commit d8076bdb56af5e5918376cd1573a6b0007fc1a89
  uapi: Wire up the mount API syscalls on non-x86 arches [ver #2]
2019-09-11 10:40:39 -04:00
Rich Felker 006a75a997 move IPC_STAT definition to a new bits/ipcstat.h file
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-02 00:08:23 -04:00
Rich Felker 51fd67fcbf get/setsockopt: add fallback for new time64 SO_RCVTIMEO/SO_SNDTIMEO
without this, the SO_RCVTIMEO and SO_SNDTIMEO socket options would
stop working on pre-5.1 kernels after time_t is switched to 64-bit and
their values are changed to the new time64 versions.

new code is written such that it's statically unreachable on 64-bit
archs, and on existing 32-bit archs until the macro values are changed
to activate 64-bit time_t.
2019-07-31 20:20:57 -04:00
Rich Felker 1afe5f3e5b extricate bits/sem.h from x32 time_t hack
various padding fields in the generic bits/sem.h were defined in terms
of time_t as a cheap hack standing in for "kernel long", to allow x32
to use the generic version of the file. this was a really bad idea, as
it ended up getting copied into lots of arch-specific versions of the
bits file, and is a blocker to changing time_t to 64-bit on 32-bit
archs.

this commit adds an x32-specific version of the header, and changes
padding type back from time_t to long (currently the same type on all
archs but x32) in the generic header and all the others the hack got
copied into.
2019-07-29 18:03:41 -04:00
Rich Felker 7f797b5e25 remove trailing newlines from various versions of bits/shm.h 2019-07-29 15:54:38 -04:00
Rich Felker fa7d4218c7 remove mips/n32/64 stat struct hacks from syscall machinery
now that we have a kstat structure decoupled from the public struct
stat, we can just use the broken kernel structures directly and let
the code in fstatat do the translation.
2019-07-18 19:38:37 -04:00
Rich Felker 01ae3fc6d4 decouple struct stat from kernel type
presently, all archs/ABIs have struct stat matching the kernel
stat[64] type, except mips/mipsn32/mips64 which do conversion hacks in
syscall_arch.h to work around bugs in the kernel type. this patch
completely decouples them and adds a translation step to the success
path of fstatat. at present, this is just a gratuitous copying, but it
opens up multiple possibilities for future support for 64-bit time_t
on 32-bit archs and for cleaned-up/unified ABIs.

for clarity, the mips hacks are not yet removed in this commit, so the
mips kstat structs still correspond to the output of the hacks in
their syscall_arch.h files, not the raw kernel type. a subsequent
commit will fix this.
2019-07-18 19:38:12 -04:00
Samuel Holland 05eb8ea060 fix conflicting mips and powerpc definitions for TIOCSER_TEMT macro
Commit 3517d74a5e changed the token in
sys/ioctl.h from 0x01 to 1, so bits/termios.h no longer matches. Revert
the bits/termios.h change to keep the headers in sync.

This reverts commit 9eda4dc69c.
2019-07-10 17:09:49 -04:00
Szabolcs Nagy f3f96f2daa add new syscall numbers from linux v5.1
syscall numbers are now synced up across targets (starting from 403 the
numbers are the same on all targets other than an arch specific offset)

IPC syscalls sem*, shm*, msg* got added where they were missing (except
for semop: only semtimedop got added), the new semctl, shmctl, msgctl
imply IPC_64, see

  linux commit 0d6040d4681735dfc47565de288525de405a5c99
  arch: add split IPC system calls where needed

new 64bit time_t syscall variants got added on 32bit targets, see

  linux commit 48166e6ea47d23984f0b481ca199250e1ce0730a
  y2038: add 64-bit time_t syscalls to all 32-bit architectures

new async io syscalls got added, see

  linux commit 2b188cc1bb857a9d4701ae59aa7768b5124e262e
  Add io_uring IO interface

  linux commit edafccee56ff31678a091ddb7219aba9b28bc3cb
  io_uring: add support for pre-mapped user IO buffers

a new syscall got added that uses the fd of /proc/<pid> as a stable
handle for processes: allows sending signals without pid reuse issues,
intended to eventually replace rt_sigqueueinfo, kill, tgkill and
rt_tgsigqueueinfo, see

  linux commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
  signal: add pidfd_send_signal() syscall

on some targets (arm, m68k, s390x, sh) some previously missing syscall
numbers got added as well.
2019-07-01 14:20:58 -04:00
Rich Felker d02e72ad51 fix broken posix_fadvise on mips due to missing 7-arg syscall support
commit 788d5e24ca exposed the breakage
at build time by removing support for 7-argument syscalls; however,
the external __syscall function provided for mips before did not pass
a 7th argument from the stack, so the behavior was just silently
broken.
2019-05-05 11:24:57 -04:00
Rich Felker dcb18bea61 implement inline 5- and 6-argument syscalls for mips
the OABI passes these on the stack, using the convention that their
position on the stack is as if the first four arguments (in registers)
also had stack slots. originally this was deemed too awkward to do
inline, falling back to external __syscall, but it's not that bad and
now that external __syscall is being removed, it's necessary.
2019-04-10 19:56:07 -04:00
Bobby Bingham 3517d74a5e move arch-invariant definitions out of bits/ioctl.h 2019-02-07 12:43:19 -05:00
Szabolcs Nagy d149e69c02 add io_pgetevents and rseq syscall numbers from linux v4.18
io_pgetevents is new in linux commit
7a074e96dee62586c935c80cecd931431bfdd0be

rseq is new in linux commit
d7822b1e24f2df5df98c76f0e94a5416349ff759
2018-12-09 22:29:12 -05:00
Rich Felker a4a3e4dbc0 make thread-pointer-loading asm non-volatile
this will allow the compiler to cache and reuse the result, meaning we
no longer have to take care not to load it more than once for the sake
of archs where the load may be expensive.

depends on commit 1c84c99913 for
correctness, since otherwise the compiler could hoist loads during
stage 3 of dynamic linking before the initial thread-pointer setup.
2018-10-16 14:11:46 -04:00
Rich Felker b6e59cd925 apply hidden visibility to sigreturn code fragments
these were overlooked in the declarations overhaul work because they
are not properly declared, and the current framework even allows their
declared types to vary by arch. at some point this should be cleaned
up, but I'm not sure what the right way would be.
2018-09-12 14:34:34 -04:00
Rich Felker 9b95fd0944 define and use internal macros for hidden visibility, weak refs
this cleans up what had become widespread direct inline use of "GNU C"
style attributes directly in the source, and lowers the barrier to
increased use of hidden visibility, which will be useful to recovering
some of the efficiency lost when the protected visibility hack was
dropped in commit dc2f368e56, especially
on archs where the PLT ABI is costly.
2018-09-05 14:05:14 -04:00
Szabolcs Nagy df6d9450ea add support for arch-specific ptrace command macros
sys/ptrace.h is target specific, use bits/ptrace.h to add target
specific macro definitions.

these macros are kept in the generic sys/ptrace.h even though some
targets don't support them:

PTRACE_GETREGS
PTRACE_SETREGS
PTRACE_GETFPREGS
PTRACE_SETFPREGS
PTRACE_GETFPXREGS
PTRACE_SETFPXREGS

so no macro definition got removed in this patch on any target. only
s390x has a numerically conflicting macro definition (PTRACE_SINGLEBLOCK).

the PT_ aliases follow glibc headers, otherwise the definitions come
from linux uapi headers except ones that are skipped in glibc and
there is no real kernel support (s390x PTRACE_*_AREA) or need special
type definitions (mips PTRACE_*_WATCH_*) or only relevant for linux
2.4 compatibility (PTRACE_OLDSETOPTIONS).
2018-07-17 22:25:08 -04:00
Rich Felker 587f5a53bc fix value of SO_PEERSEC on mips archs
adapted from patch by Matthias Schiffer.
2018-06-26 15:55:29 -04:00
Szabolcs Nagy 1177f61d6e mips: add HWCAP_ flags from linux v4.17
new in linux commit 256211f2b0b251e532d1899b115e374feb16fa7a
2018-06-19 13:27:27 -04:00
Szabolcs Nagy 610c5a8524 fix TLS layout of TLS variant I when there is a gap above TP
In TLS variant I the TLS is above TP (or above a fixed offset from TP)
but on some targets there is a reserved gap above TP before TLS starts.

This matters for the local-exec tls access model when the offsets of
TLS variables from the TP are hard coded by the linker into the
executable, so the libc must compute these offsets the same way as the
linker.  The tls offset of the main module has to be

	alignup(GAP_ABOVE_TP, main_tls_align).

If there is no TLS in the main module then the gap can be ignored
since musl does not use it and the tls access models of shared
libraries are not affected.

The previous setup only worked if (tls_align & -GAP_ABOVE_TP) == 0
(i.e. TLS did not require large alignment) because the gap was
treated as a fixed offset from TP.  Now the TP points at the end
of the pthread struct (which is aligned) and there is a gap above
it (which may also need alignment).

The fix required changing TP_ADJ and __pthread_self on affected
targets (aarch64, arm and sh) and in the tlsdesc asm the offset to
access the dtv changed too.
2018-06-02 19:38:44 -04:00
Rich Felker eb5ae94016 fix minor namespace issues in termios.h
the output delay features (NL*, CR*, TAB*, BS*, and VT*) are
XSI-shaded. VT* is in the V* namespace reservation but the rest need
to be suppressed in base POSIX namespace.

unfortunately this change introduces feature test macro checks into
another bits header. at some point these checks should be simplified
by having features.h handle the "FTM X implies Y" relationships.
2018-03-10 18:19:41 -05:00
Szabolcs Nagy 9b57db3f95 add MAP_SYNC and MAP_SHARED_VALIDATE from linux v4.15
for synchronous page faults, new in linux commit
1c9725974074a047f6080eecc62c50a8e840d050 and
b6fb293f2497a9841d94f6b57bd2bb2cd222da43
note that only targets that use asm-generic/mman.h have this new
flag defined, so undef it on other targets (mips*, powerpc*).
2018-02-22 18:48:58 -05:00
Szabolcs Nagy 9eda4dc69c mips,powerpc: fix TIOCSER_TEMT in termios.h
use the same token to define TIOCSER_TEMT as is used in ioctl.h
so when both headers are included there are no redefinition warnings
during musl build.
2018-02-22 18:48:38 -05:00
Szabolcs Nagy 754f66afb7 ioctl TIOCGPTPEER from linux v4.13
added for safe opening of peer end of pty in a mount namespace.
new in linux commit c6325179238f1d4683edbec53d8322575d76d7e2
2017-11-05 18:41:22 -05:00
Szabolcs Nagy 9864f60e92 add statx syscall numbers from linux v4.11
statx was added in linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
(there is no libc wrapper yet and microblaze and sh misses the number).
2017-11-05 18:41:11 -05:00
Szabolcs Nagy 822dddfbf1 make syscall.h consistent with linux
most of the found naming differences don't matter to musl, because
internally it unifies the syscall names that vary across targets,
but for external code the names should match the kernel uapi.

aarch64:
	__NR_fstatat is called __NR_newfstatat in linux.
	__NR_or1k_atomic got mistakenly copied from or1k.
arm:
	__NR_arm_sync_file_range is an alias for __NR_sync_file_range2
	__NR_fadvise64_64 is called __NR_arm_fadvise64_64 in linux,
	the old non-arm name is kept too, it should not cause issues.
	(powerpc has similar nonstandard fadvise and it uses the
	normal name.)
i386:
	__NR_madvise1 was removed from linux in commit
	303395ac3bf3e2cb488435537d416bc840438fcb 2011-11-11
microblaze:
	__NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite
	had different name in linux.
mips:
	__NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite, __NR_select
	had different name in linux.
mipsn32:
	__NR_fstatat is called __NR_newfstatat in linux.
or1k:
	__NR__llseek is called __NR_llseek in linux.
	the old name is kept too because that's the name musl uses
	internally.
powerpc:
	__NR_{get,set}res{gid,uid}32 was never present in powerpc linux.
	__NR_timerfd was briefly defined in linux but then got renamed.
2017-09-06 19:29:25 -04:00
Szabolcs Nagy cc08669380 add SIOCGSTAMPNS socket ioctl macro to ioctl.h
it is defined in linux asm/sockios.h since commit
ae40eb1ef30ab4120bd3c8b7e3da99ee53d27a23 (linux v2.6.22)
but was missing from musl by accident.

in musl the sockios macros are exposed in sys/ioctl.h together
with other ioctl requests instead of in sys/socket.h because of
namespace rules. (glibc has them in sys/socket.h under _GNU_SOURCE.)
2017-08-29 19:48:37 -04:00
Szabolcs Nagy 02b50c9d0a fix mips ioctl macros to match linux asm/sockios.h 2017-08-29 19:48:35 -04:00
Rich Felker 1c497005ee remove long-obsolete clang workarounds from mips* syscall_arch.h files
at one point, clang reportedly failed to support the asm register
constraints needed for inline syscalls. versions of clang that old
have much bigger problems that preclude using them to compile musl
libc.
2017-05-31 21:49:44 -04:00
Szabolcs Nagy 62eaf40bf4 add pkey_{mprotect,alloc,free} syscalls from linux v4.9
see linux commit e8c24d3a23a469f1f40d4de24d872ca7023ced0a
and linux Documentation/x86/protection-keys.txt
2016-12-29 22:10:19 -05:00