summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/getrlimit.c
AgeCommit message (Collapse)Author
2023-10-27setrlimit/getrlimit: fix prlimit64 syscall use for 32-bit CPUsPavel Kozlov
Commit 95e38b37 ("add support for systems without legacy setrlimit/getrlimit syscalls") has added use of the prlimit64 syscall in getrlimit and setrlimit functions. This change causes memory corruption on getrlimit call for 32-bit CPUs like ARC, as ARC doesn't have ugetrlimit syscall and uses prlimit64. Also, setrlimit has been broken by prlimit64 call on 32-bit CPUs like, i386, ARM, ARC. For the prlimit64 syscall the kernel expects an rlimit struct with 64-bit fields, but on 32-bit CPUs without _FILE_OFFSET_BITS=64 the struct rlimit has 32-bit fields. Add safe implementations of getrlimit, setrlimit, prlimit for 32-bit CPUs with a local struct rlimit64 variable for use in the prlimit64 syscall. For 64-bit CPUs and configurations with _FILE_OFFSET_BITS=64 use getrlimit, setrlimit, prlimit as aliases to getrlimit64, setrlimit64 and prlimit64. Add a new function prlimit64. Tested on aarch64, arm, i386, arc. Fixes: 95e38b37 ("add support for systems without legacy setrlimit/getrlimit syscalls") Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
2023-09-14add support for systems without legacy setrlimit/getrlimit syscallsYann Sionneau
Those must have the recent prlimit64 syscall which exists since Linux 3.2. This patch is necessary for non-legacy architectures that wish to remove support for legacy setrlimit/getrlimit syscalls. The non-legacy arch are those who opt-out via non defining __ARCH_WANT_SET_GET_RLIMIT in their arch/xxx/include/uapi/asm/unistd.h setrlimit and getrlimit are then emulated via the new prlimit64 syscall. Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
2017-06-21remove editor hints for viWaldemar Brodkorb
2016-11-27remove UCLIBC_HAS_LFSWaldemar Brodkorb
2012-06-15Reorder includes and include only what is necessaryPeter S. Mazinger
Use param.h instead of MIN. Use stddef.h instead of offsetof. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15__xpg_strerror_r.c, {ge,se}trlimit.c: use strong_alias_untypedPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-09-18trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer
sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2008-11-20Last portion of libc_hidden_proto removal.Denis Vlasenko
Appears to build fine (several .configs tried)
2008-10-24- tidy up inline:Bernhard Reutner-Fischer
ldso and syscalls are __always_inline (the latter would need more cleanup)
2008-10-22- remove superfluous ';'. No objcode changes.Bernhard Reutner-Fischer
2008-06-03- adds several config-options to allow for turning off certain featuresBernhard Reutner-Fischer
like o UCLIBC_HAS_GNU_ERROR o UCLIBC_HAS_BSD_ERR o UCLIBC_HAS_PTY o UCLIBC_HAS_GETPT (1) o UCLIBC_SYSCALL_STUBS o UCLIBC_SYSCALL_STUB_WARNING o UCLIBC_LINUX_SPECIFIC (2) o UCLIBC_BSD_SPECIFIC (3) o UCLIBC_NTP_LEGACY (4) o UCLIBC_SV4_DEPRECATED (5) o UCLIBC_HAVE_REALTIME (6) o UCLIBC_HAVE_ADVANCED_REALTIME (7) o UCLIBC_HAVE_EPOLL (8) o UCLIBC_HAVE_XATTR (9) o UCLIBC_HAVE_PROFILING (10) (1) make non-standard getpt optional and implement standard posix_openpt (2) fstatfs(), inotify_*(), ioperm(), iopl(), madvise(), modify_ldt(), personality() ppoll(), setresuid() (3) mincore(), getdomainname(), setdomainname() (4) ntp_adjtime(), ntp_gettime() aliases (5) ustat() [use statfs(2) in your code instead] (6) All marked as "(REALTIME)" in SUSv3 (7) All marked as "(ADVANCED REALTIME)" in SUSv3 (8) epoll_create(), epoll_ctl(), epoll_wait() (9) all Extended Attributes (10) helpers for gcc's -finstrument-functions - Fixes _dl_exit() - Implements sleep(3) for !UCLIBC_HAVE_REALTIME - Implements usleep(3) for !UCLIBC_HAVE_REALTIME - adds #warning about incorrect posix_fadvise{,64}() - removes unused and unwanted uselib() Net outcome is that an allnoconfig with HAVE_SHARED is now about 88k instead of formerly 130k.
2006-12-08Take Mike Frysinger's comments into account -- make certain that userEric Andersen
applications stop using _syscall#() and use syscall() instead. Cleanup internal handling of syscall includes to use the correct header file.
2006-02-11fix my always_inline typo to fix building on most archesMike Frysinger
2006-02-10only check for rlimit stuff if the target doesnt support the newer function ↵Mike Frysinger
call, and dont bother with 64bit versions on 64bit hosts as the regular one works fine (should fix the setrlimit ltp tests)
2006-01-14make DODEBUG=y happy, update sysdeps/common/* copyrightPeter S. Mazinger
2006-01-14hidden_def/hidden_proto: convert all users (I hope) termios split, add some ↵Peter S. Mazinger
missing headers, other jump relocs removed
2005-12-01Hide mostly used functionsPeter S. Mazinger
2005-11-26100 JUMP relocs less (remaining 431) by hiding internally used onesPeter S. Mazinger
2005-01-05fix eriks e-mail addressMike Frysinger
2004-01-21Split up syscalls.c, since it had grown to be quite large and ugly.Eric Andersen
-Erik