summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips/bits
AgeCommit message (Collapse)Author
2024-02-27Fix *stat() and *stat64() when the time is beyond year 2038.Dmitry Chestnykh
To obtain correct `st_atim`, `st_mtim` and `st_ctim` fields we need to use statx() syscall and then convert the data from the kernel to the regular stat structure. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-26Add time64 support for MIPS32.Dmitry Chestnykh
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2023-11-17rlimit: fix 64-bit RLIM64_INFINITY macroPavel Kozlov
Linux kernel returns -1ULL as RLIM64_INFINITY for all cpus. Fix RLIM64_INFINTIY and 64-bit variant of RLIM_INFINITY macro for sparc, mips, alpha, as for these CPUs the library uses different value than what the kernel sets and it can cause incorrect RLIM64_INFINTY check. Because alpha is a 64-bit arch, fix the RLIM_INFINITY macro twice (the value should be the same with and without __USE_FILE_OFFSET64 definition) to match the prlimit64 syscall in the kernel. Previous implementation of setrlimit/getrlimit functions didn't use prlimit64 syscall and didn't receive RLIM64_INFINTIY from the kernel, RLIM64_INFINTY macro was used by the library itself to mimic the 64-bit rlimit in the getrlimit64/setrlimit64 functions, that allowed to have RLIM64_INFINTIY different from what the kernel sets. New implementation of setrlimit/getrlimit uses prlimit64 and checks for RLIM64_INFINITY value and must have equal RLIM64_INFINITY definition with what the kernel uses. This issue is indicated by the tst-rlim/tst-rlim64 tests on sparc/mips32/alpha, tests return 23 (UNSUPPORTED) because of incorrect RLIM_INFINTY check for available rlimit type. This patch will require rebuild of sparc/mips32/alpha binaries that explicitly use RLIM64_INFINTY or 64-bit variant of RLIM_INFINITY (if binary for 32-bit CPU was built with _FILE_OFFSET_BITS=64) to update the macro value. Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
2022-08-08resource.h: add missing RUSAGE_THREADWaldemar Brodkorb
There is a real-world usage of RUSAGE_THREAD by the pistache project, https://github.com/oktal/pistache. Reported-By: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-05-20define RLIMIT_RTTIME, bump RLIMIT_NLIMITSRomain Naour
This macro exists since Linux 2.6.25 [1] and is defined in glibc since 2.14 [2] for sparc and most supported architectures. RLIMIT_RTTIME has been added later for mips [3] and alpha [4]. For example, RLIMIT_RTTIME is needed to build qemu 7.0.0 with Linux user-land emulation support [5]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=78f2c7db6068fd6ef75b8c120f04a388848eacb5 [2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=67f86a251e0d36107fe28999281d46e76941c7b9 [3] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=8969f4df1a526aa60dd0bc1c4736cf02104d4a05 [4] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=53c2cb7641bd866398156625ef672bbd2d78a0d8 [5] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=244fd08323088db73590ff2317dfe86f810b51d7 Signed-off-by: Romain Naour <romain.naour@gmail.com>
2021-04-09open: Add support for O_TMPFILENicolas Cavallari
Since Linux 3.11, O_TMPFILE allows to create unnamed files that can be linked later on. It is internally defined as (O_TMPFILE | O_DIRECTORY) to make it fail on old kernels. Copying definitions from glibc for O_TMPFILE is not enough to support O_TMPFILE; The open() wrapper also need to pass the mode when the flag contains O_TMPFILE, otherwise, it will pass mode 000 which will succeed but yield unexpected results. openat() is curiously not affected since it passes the mode unconditionally.. Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
2021-02-19fcntl.h: Make F_DUPFD_CLOEXEC if _USE_XOPEN2K8Paul Cercueil
The F_DUPFD_CLOEXEC flag was added in POSIX 2008.09. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2020-07-02Rename __unused struct members to include a namespaceEd Wildgoose
Rename various spare fields in structs to include a namespace This should avoid accidental clashes with uses of the __unused symbol in upstream projects. eg currently it causes a compile error in dhcpcd 8.x due to their re-use of the __unused symbol as a macro This follows the style of glibc which does something equivalent
2020-05-17mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6Romain Naour
From [1] "GCC 10 (PR 91233) won't silently allow registers that are not architecturally available to be present in the clobber list anymore, resulting in build failure for mips*r6 targets in form of: ... .../sysdep.h:146:2: error: the register ‘lo’ cannot be clobbered in ‘asm’ for the current target 146 | __asm__ volatile ( \ | ^~~~~~~ This is because base R6 ISA doesn't define hi and lo registers w/o DSP extension. This patch provides the alternative definitions of __SYSCALL_CLOBBERS for r6 targets that won't include those registers." [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=020b2a97bb15f807c0482f0faee2184ed05bcad8 Signed-off-by: Romain Naour <romain.naour@gmail.com> Cc: Waldemar Brodkorb <wbx@openadk.org>
2020-02-03csky: add statx conditionalsWaldemar Brodkorb
Similar to glibc commit https://sourceware.org/git/?p=glibc.git;a=commit;h=6bbfc5c09fc5b5e3d4a0cddbbd4e2e457767dae7 we need to handle Linux kernel change, which removed stat64 family from default syscall set. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Waldemar Brodkorb <wbrodkorb@conet.de>
2018-11-23Defined INLINE_SYSCALL_NOERR_NCS in mips/bits/syscalls.hVolodymyr Boyko
On Linux/MIPS (O32 ABI) for system call we have two result registers - v0 and a3. v0 contains actual syscall result on success or error number on fail, a3 set to 0/1 for indicating syscall success/fail. (if a3 == 1, v0 contains errno). Now as we can see from definition of handle_sys (arch/mips/kernel/scall32-o32.S), handler treats returned by syscall function (let's call "original") values in range [-EMAXERRNO; 0[ as -errno, a3 is set to 1 and final returned (to userspace) value is (-original). INLINE_SYSCALL_NOERR_NCS defined in mips/bits/syscalls.h will handle this behaviour. Signed-off-by: Volodymyr Boyko <boyko.cxx@gmail.com>
2018-02-03bits/mman.h: consolidate header fileWaldemar Brodkorb
Sync with GNU C library and consolidate duplicate non architecture specific defines. MAP_UNINITIALIZED is only defined to 0x4000000 and used by the Linux kernel when CONFIG_MMAP_ALLOW_UNINITIALIZED is enabled. CONFIG_MMAP_ALLOW_UNINITIALIZED is only available for nommu. See Documentation/nommu-mmap.txt.
2017-11-25statfs.h: add f_flagsWaldemar Brodkorb
Add missing member in struct statfs. It is used by xfsprogs (f.e. 4.13.1). Reported-by: Joshua Kinard <kumba@gentoo.org>
2017-11-22remove misleading comment about f_frsize fieldEugene Rudoy
It is supported both in the sense of being contained in mips version of statfs/statfs64 structs and also in the sense that it's filled by the corresponding kernel syscalls. It is UNsupported in that sense that it's value is the same as that of f_bsize (at least on older kernel versions, the oldest version tested is 2.6.13), s. [1] and [2] for details ([1] is the latest kernel version as of now, [2] is the oldest kernel version git history is available for). [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/statfs.c?h=v4.14-rc7#n64 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/open.c?h=v2.6.12-rc2#n41 Follow-up of 68de9946e914d8c30dcc6667a059ea59e5b74cac Signed-off-by: Eugene Rudoy <gene.devel@gmail.com> Signed-off-by: Ralf Friedl <Ralf.Friedl@online.de>
2017-11-03Define _STATFS_F_FRSIZE for MIPSWaldemar Brodkorb
After discussion on the busybox mailinglist. Reported-by: Ralf Friedl <Ralf.Friedl@online.de> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-06-08fcntl.h: fixup namespace for O_DIRECTORY/O_NOFOLLOW/O_CLOEXECWaldemar Brodkorb
Sync with GNU C library. Found while trying to compile linux-rdma to uClibc-ng. Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
2017-04-16libm: allow long double wrappers for all architecturesWaldemar Brodkorb
If you enable these wrappers, be sure you don't need long double precision on your embedded device, as these only enables long double warpper functions to the existing double math functions. Required to build some software as lvm2. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-02-18remove dead code in dlfcn.hWaldemar Brodkorb
2016-12-26mips: use the common dirent.hWaldemar Brodkorb
2016-11-27mips: fix SIGILL problem with mips ISA r6Waldemar Brodkorb
2016-01-31mips: fix clashing symbolsWaldemar Brodkorb
ISC bind9 uses ptrsize, better use something else. Reported-By: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2015-12-07add definitions for O_PATHWaldemar Brodkorb
Only alpha, hppa and sparc need non-default value.
2015-12-05remove __UCLIBC_ASM_GLOBAL_DIRECTIVE__Waldemar Brodkorb
.globl can be used for every architecture so remove the define. Sync with GNU C library.
2015-12-05remove __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__Waldemar Brodkorb
It's even no longer required for non-ported ppc64 architecture. Sync with GNU C library. This simplify the macros in include/libc-symbols.h.
2015-06-10siginfo: add signal info for seccomp related SIGSYSDaniel Golle
uClibc doesn't define signal info for the SIGSYS signal which is issued in case of hitting a syscall prohibited by seccomp. This is sad as it makes debugging seccomp filter policies impossible on some architectures (at least ARM and PowerPC, maybe also others) which do not coincidentally set si_value.sival_int as the syscall number. To fix this, import the definitions and macros needed from glibc. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-29merge uClibc git masterWaldemar Brodkorb
2015-03-24mips: switch float_t to floatBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-24libc: TIME64_COMPAT32 for sparc, mipsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-14Add fix from OpenWrt for MIPS64 N64 ABIWaldemar Brodkorb
https://dev.openwrt.org/browser/trunk/toolchain/uClibc/patches-0.9.33.2/616-mips_fix_stat_time.patch When booting in Qemu you get for example failures from mdev -s otherwise.
2014-12-03mips: rename siginfo _timer membersBernhard Reutner-Fischer
Rename _timer[12] to si_tid and si_overrun to fix compilation of strace-4.9+ Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-25fcntl.h: Define F_SETPIPE_SZ and F_GETPIPE_SZKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-01Fix warnings in MIPS buildSteve Ellcey
This patch fixes the rest of the set-but-not-used warnings in the MIPS code by using attribute_unused and also fixes some conversion warnings by changing __arch_compare_and_exchange_xxx_[8|16]_int. Assigning __cmp (int type) to __prev (pointer type) generates a warning. Assigning zero to each separately avoids this warning without having to add a cast. Signed-off-by: Steve Ellcey <sellcey@mips.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-02-02libc: mips: Fix setjmp/longjmp for MIPS64 N64 ABIWaldemar Brodkorb
When booting a Linux system with qemu-system-mips64 the execution of $(pwd) in the ash shell triggers a segmentation fault. Ash uses setjmp/longjmp for exception handling. After looking at the glibc implementation, I found some differences, with this patch tries to resolve. Now the system boots up fine and no segmentation faults occur. The global pointer should be restored and the types for the register values should be wide enough. See: http://www.cygwin.com/ml/libc-alpha/2003-03/msg00363.html Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-02-02mips: silence 'set but not used' warningsSteve Ellcey
This patch uses 'attribute_unused' to clean up a number of warnings messages that are generated when doing a MIPS build. All of the changes are in MIPS specific files and there are no code changes other then adding the unused attribute where needed. Signed-off-by: Steve Ellcey <sellcey@mips.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-01-24mips: silence _ABI* undef warningsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-01-08siginfo.h: __SIGEV_PAD_SIZE takes __WORDSIZE into accountVicente Olivert Riera
Make __SIGEV_PAD_SIZE to take __WORDSIZE into account for alpha, mips and ia64 arches. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-01-08siginfo.h: add a missing function member on ia64, mips and sparc archesVicente Olivert Riera
Add "__pid_t _tid" member which is used for some packages, like rt-test for instance, which fails with an error like this one: src/cyclictest/cyclictest.c:638:9: error: 'union <anonymous>' has no member named '_tid' Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-06-28MIPS: set _NSIG to 128, not 129. This matches glibc.Denys Vlasenko
Prompted by lkml discussion of a MIPS bug where sending signal 128 was found to be able to crash the machine :/ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-07eventfd.h: Use new "bits/" scheme for arch-specific flagsHiroaki KAWAI
As in timerfd.h, eventfd.h needs arch-specific definition files. alpha, mips and sparc needs separate file, all the other arch will use common definition. This problem is already fixed in glibc. Also sanitize and provide bits for hppa. Make sure not to install the new bits/eventfd unless eventfd support is enabled. Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-04-01mips: only define SYSCALL_ALIGN_64BIT for O32 ABIsMike Frysinger
The 64bit register alignment issue only affects the O32 ABI, so wrap the define accordingly. We don't want this being used for N32 ABIs. This doesn't directly affect the N64 ABI since these files wouldn't even be compiled for those targets (no need for the 32bit/64bit shim). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-04-01libc: rename TRUNCATE64_HAS_4_ARGS to SYSCALL_ALIGN_64BITMike Frysinger
The reason truncate64 takes 4 args on some arches is that their ABI requires 64bit values to be aligned on register pair boundaries. Since this alignment affects more than just truncate64, rename the define to properly document its purpose. This also allows us to expand it to the other impacted syscalls (which will be done in a follow up commit). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-02-05mman: rename MAP_UNINITIALIZE to MAP_UNINITIALIZEDBernhard Reutner-Fischer
The name was changed to include a trailing 'D' when it went into the kernel. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-01-17socket.h: pull socket_type.h from eglibcBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-11-18drop support for pre ISO-C compilersMike Frysinger
This drops __signed, __volatile, and __const. Only the latter was used in the code base, and for uClibc, not consistently. Much of the code used plain "const" which meant "__const" was useless. Really, the point of this is to stay in sync with what glibc did. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-10-02libc/sysdeps: add __kernel_long and __kernel_ulongChris Packham
Linux 3.4 added __kernel_long_t and __kernel_ulong_t and various exported header files were updated to use these new types. Add the definitions for __kernel_long_t and __kernel_ulong_t to the relevant kernel_types.h headers. This change was automated with the following scriptlet git grep --name-only 'typedef.*__kernel_old_dev_t' \ | xargs sed -i '/typedef.*__kernel_old_dev_t/ a\ typedef long\t\t__kernel_long_t;\ typedef unsigned long\t__kernel_ulong_t;' Whitespace in arm, avr32, hppa, sparc was then manually fixed up. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> -- Here's a cleaned up patch which should get the whitespace right. I'm a bit iffy about the sparc changes they make sense to me but it's not a platform I have access to. I can break this up per arch or per maintainer if requested. libc/sysdeps/linux/alpha/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/arm/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/avr32/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/bfin/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/c6x/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/cris/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/e1/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/h8300/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/hppa/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/i386/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/ia64/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/m68k/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/microblaze/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/mips/bits/kernel_types.h | 4 ++++ libc/sysdeps/linux/nios2/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/powerpc/bits/kernel_types.h | 4 ++++ libc/sysdeps/linux/sh/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/sh64/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/sparc/bits/kernel_types.h | 4 ++++ libc/sysdeps/linux/v850/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/x86_64/bits/kernel_types.h | 2 ++ libc/sysdeps/linux/xtensa/bits/kernel_types.h | 2 ++ 22 files changed, 50 insertions(+) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15cleanup bits/setjmp.h of stuff moved to jmpbuf-offsets.h and jmpbuf-unwind.hPeter S. Mazinger
Make sure we use the new jmpbuf-*.h headers While there, adapt the offset on microblaze and the _JMPBUF_UNWINDS macro on bfin, it seems, these were changed in the meantime. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15signal.h: move prototypes for __syscall_[rt_]sigaction to common placePeter S. Mazinger
solve inconsistency between archs NPTL should not use __syscall_rt_sigaction at all, for now it needs to be visible Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-04-28epoll.h: sync with glibcMike Frysinger
Since glibc has split out arch-specific stuff to bits/epoll.h, we can pull that sanity back into our tree and drop the arch ifdefs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-25atomic.h: handle new mips R10K errataBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>