#define __NR_fstatat __NR_fstatat64
#define __NR_pread __NR_pread64
#define __NR_pwrite __NR_pwrite64
+#undef __NR_getrlimit
+#define __NR_getrlimit __NR_ugetrlimit
#define __SC_socket 1
#define __SC_bind 2
int getrlimit(int resource, struct rlimit *rlim)
{
long k_rlim[2];
- if (syscall2(__NR_ugetrlimit, resource, (long)k_rlim) < 0)
+ if (syscall2(__NR_getrlimit, resource, (long)k_rlim) < 0)
return -1;
- rlim->rlim_cur = k_rlim[0];
- rlim->rlim_max = k_rlim[1];
+ rlim->rlim_cur = k_rlim[0] == -1 ? -1 : (unsigned long)k_rlim[0];
+ rlim->rlim_max = k_rlim[1] == -1 ? -1 : (unsigned long)k_rlim[1];
return 0;
}