summaryrefslogtreecommitdiff
path: root/src/linux/prlimit.c
AgeCommit message (Collapse)AuthorLines
2014-05-30fix for broken kernel side RLIM_INFINITY on mipsSzabolcs Nagy-1/+16
On 32 bit mips the kernel uses -1UL/2 to mark RLIM_INFINITY (and this is the definition in the userspace api), but since it is in the middle of the valid range of limits and limits are often compared with relational operators, various kernel side logic is broken if larger than -1UL/2 limits are used. So we truncate the limits to -1UL/2 in get/setrlimit and prlimit. Even if the kernel side logic consistently treated -1UL/2 as greater than any other limit value, there wouldn't be any clean workaround that allowed using large limits: * using -1UL/2 as RLIM_INFINITY in userspace would mean different infinity value for get/setrlimt and prlimit (where infinity is always -1ULL) and userspace logic could break easily (just like the kernel is broken now) and more special case code would be needed for mips. * translating -1UL/2 kernel side value to -1ULL in userspace would mean that -1UL/2 limit cannot be set (eg. -1UL/2+1 had to be passed to the kernel instead).
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy-1/+2
2012-09-21LFS64 alias for prlimitRich Felker-0/+3
issue reported/requested by Justin Cormack
2012-09-07cleanup src/linux and src/misc trees, etc.Rich Felker-0/+8
previously, it was pretty much random which one of these trees a given function appeared in. they have now been organized into: src/linux: non-POSIX linux syscalls (possibly shard with other nixen) src/legacy: various obsolete/legacy functions, mostly wrappers src/misc: still mostly uncategorized; some misc POSIX, some nonstd src/crypt: crypt hash functions further cleanup will be done later.