diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-08-21 09:57:15 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-08-21 09:57:15 -0700 |
commit | e5dee2c896f04d88defdfa00282fa83f5f4004d8 (patch) | |
tree | caebcffacffc0363dc418694eba18b2ce6b8617b /sysdeps/unix/sysv/linux/prlimit.c | |
parent | 8c7c251746ce41779637c83e3b35639517f728d5 (diff) | |
download | glibc-e5dee2c896f04d88defdfa00282fa83f5f4004d8.tar.gz glibc-e5dee2c896f04d88defdfa00282fa83f5f4004d8.tar.xz glibc-e5dee2c896f04d88defdfa00282fa83f5f4004d8.zip |
Revert "Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN"
This reverts commit 0c5b8b5941e036dcaac69cecee9f01fdf9218e6e.
Diffstat (limited to 'sysdeps/unix/sysv/linux/prlimit.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/prlimit.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/prlimit.c b/sysdeps/unix/sysv/linux/prlimit.c index ad164c4b2c..db88ba893c 100644 --- a/sysdeps/unix/sysv/linux/prlimit.c +++ b/sysdeps/unix/sysv/linux/prlimit.c @@ -44,15 +44,10 @@ prlimit (__pid_t pid, enum __rlimit_resource resource, new_rlimit64 = &new_rlimit64_mem; } - INTERNAL_SYSCALL_DECL (err); - int res = INTERNAL_SYSCALL (prlimit64, err, 4, pid, resource, - new_rlimit64, old_rlimit64); + int res = INLINE_SYSCALL (prlimit64, 4, pid, resource, new_rlimit64, + old_rlimit64); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err))) - return INLINE_SYSCALL_ERROR_RETURN (-INTERNAL_SYSCALL_ERRNO (res, - err), - int, -1); - else if (old_rlimit != NULL) + if (res == 0 && old_rlimit != NULL) { /* The prlimit64 syscall is ill-designed for 32-bit machines. We have to provide a 32-bit variant since otherwise the LFS @@ -64,14 +59,20 @@ prlimit (__pid_t pid, enum __rlimit_resource resource, if (old_rlimit->rlim_cur != old_rlimit64_mem.rlim_cur) { if (new_rlimit == NULL) - return INLINE_SYSCALL_ERROR_RETURN (-EOVERFLOW, int, -1); + { + __set_errno (EOVERFLOW); + return -1; + } old_rlimit->rlim_cur = RLIM_INFINITY; } old_rlimit->rlim_max = old_rlimit64_mem.rlim_max; if (old_rlimit->rlim_max != old_rlimit64_mem.rlim_max) { if (new_rlimit == NULL) - return INLINE_SYSCALL_ERROR_RETURN (-EOVERFLOW, int, -1); + { + __set_errno (EOVERFLOW); + return -1; + } old_rlimit->rlim_max = RLIM_INFINITY; } } @@ -83,7 +84,8 @@ int prlimit (__pid_t pid, enum __rlimit_resource resource, const struct rlimit *new_rlimit, struct rlimit *old_rlimit) { - return INLINE_SYSCALL_ERROR_RETURN (-ENOSYS, int, -1); + __set_errno (ENOSYS); + return -1; } stub_warning (prlimit) #endif |