summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/getrlimit64.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>
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-06-15*64.[cS]: use _lfs_64.h instead of features.h and remove LFS guardPeter S. Mazinger
_lfs_64.h makes the compile fail, if LFS is not enabled, no need for the guard. Reorganize to include only the minimal necessary headers. 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)
2006-02-26Move _lfs_64.h to include and adapt filesPeter S. Mazinger
2006-02-23Move common parts into internal header, should it be used for all *64.c?Peter S. Mazinger
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-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
2002-10-31Ok, this commit is _huge_ and its gonna change the world. I'veEric Andersen
been working on a new config system on and off for about 6 months now, but I've never been fully satisfied. Well, I'm finally am happy with the new config system, so here it is. This completely removes the old uClibc configuration system, and replaces it with an entirely new system based on LinuxKernelConf, from http://www.xs4all.nl/~zippel/lc/ As it turns out, Linus has just merged LinuxKernelConf into Linux 2.5.45, so it looks like I made the right choice. I have thus far updated only x86. I'll be updating the other architectures shortly. -Erik
2002-04-09Avoid defining __USE_FILE_OFFSET64, since we do _NOT_ wantEric Andersen
interfaces silently renamed under us or very bad things may happen... -Erik
2002-03-31Add support for getrlimit64 and setrlimit64. Fix some problemsEric Andersen
with the getrlimit and setrlimit syscalls. -Erik