mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 23:32:15 +00:00
in sysconf, use getrlimit function rather than raw syscall for rlimits
the syscall is deprecated (replaced by prlimit64) and does not work correctly on x32. this change mildly increases size, but is likely needed anyway for newer archs that might omit deprecated syscalls.
This commit is contained in:
parent
233767b48a
commit
6cf7d17f53
@ -228,9 +228,9 @@ long sysconf(int name)
|
|||||||
} else if (values[name] >= -1) {
|
} else if (values[name] >= -1) {
|
||||||
return values[name];
|
return values[name];
|
||||||
} else if (values[name] < -256) {
|
} else if (values[name] < -256) {
|
||||||
long lim[2];
|
struct rlimit lim;
|
||||||
__syscall(SYS_getrlimit, values[name]&16383, lim);
|
getrlimit(values[name]&16383, &lim);
|
||||||
return lim[0] < 0 ? LONG_MAX : lim[0];
|
return lim.rlim_cur > LONG_MAX ? LONG_MAX : lim.rlim_cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ((unsigned char)values[name]) {
|
switch ((unsigned char)values[name]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user