ifeq ($(subdir),misc)
sysdep_routines += adjtimex clone umount umount2 readahead sysctl \
setfsuid setfsgid epoll_pwait signalfd \
- eventfd eventfd_read eventfd_write prlimit \
+ eventfd eventfd_read eventfd_write prlimit prlimit64 \
personality epoll_wait tee vmsplice splice \
open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get \
timerfd_gettime timerfd_settime prctl \
setfsgid - setfsgid32 Ei:i setfsgid
setfsuid - setfsuid32 Ei:i setfsuid
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
-
personality EXTRA personality Ei:i __personality personality
# proper socket implementations:
+++ /dev/null
-# File name Caller Syscall name # args Strong name Weak names
-
-# rlimit APIs
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
--- /dev/null
+#define VERSION_prlimit64 GLIBC_2_17
+#include <sysdeps/unix/sysv/linux/prlimit64.c>
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
-prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
personality EXTRA personality Ei:i __personality personality
vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0
vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
-
personality EXTRA personality Ei:i __personality personality
setfsuid - setfsuid32 Ei:i setfsuid
cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
personality EXTRA personality Ei:i __personality personality
cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
personality EXTRA personality Ei:i __personality personality
+++ /dev/null
-# File name Caller Syscall name # args Strong name Weak names
-
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
# return value.
lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
-
personality EXTRA personality Ei:i __personality personality
# File name Caller Syscall name # args Strong name Weak names
-prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
-
sendfile - sendfile i:iipi sendfile sendfile64
chown - chown i:sii __chown chown@@GLIBC_2.1
lchown - lchown i:sii __lchown lchown@@GLIBC_2.0 chown@GLIBC_2.0
-
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
#include <sys/resource.h>
#include <sysdep.h>
+/* For ports that support the 64-bit ABI we do not need to define prlimit
+ and instead prlimit aliases to prlimit64. See the prlimit64
+ implementation. */
+#if !__RLIM_T_MATCHES_RLIM64_T
int
prlimit (__pid_t pid, enum __rlimit_resource resource,
const struct rlimit *new_rlimit, struct rlimit *old_rlimit)
return res;
}
+#endif /* __RLIM_T_MATCHES_RLIM64_T */
--- /dev/null
+/* Get/set resource limits. Linux specific syscall.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#define prlimit __redirect_prlimit
+#include <sys/resource.h>
+#undef prlimit
+#include <sysdep.h>
+
+int
+__prlimit64 (pid_t pid, enum __rlimit_resource resource,
+ const struct rlimit64 *new_rlimit, struct rlimit64 *old_rlimit)
+{
+ return INLINE_SYSCALL_CALL (prlimit64, pid, resource, new_rlimit,
+ old_rlimit);
+}
+#ifdef VERSION_prlimit64
+# include <shlib-compat.h>
+versioned_symbol (libc, __prlimit64, prlimit64, VERSION_prlimit64);
+#else
+strong_alias (__prlimit64, prlimit64)
+# if __RLIM_T_MATCHES_RLIM64_T
+strong_alias (prlimit64, prlimit)
+# endif
+#endif
setfsgid - setfsgid32 Ei:i setfsgid
setfsuid - setfsuid32 Ei:i setfsuid
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
personality EXTRA personality Ei:i __personality personality
setfsgid - setfsgid32 Ei:i setfsgid
setfsuid - setfsuid32 Ei:i setfsuid
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
-
personality EXTRA personality Ei:i __personality personality
setfsgid - setfsgid32 Ei:i setfsgid
setfsuid - setfsuid32 Ei:i setfsuid
-
-prlimit64 EXTRA prlimit64 i:iipp prlimit64
# File name Caller Syscall name # args Strong name Weak names
sendfile - sendfile i:iipi sendfile sendfile64
-prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
personality EXTRA personality i:i __personality personality