mirror of
https://sourceware.org/git/glibc.git
synced 2025-06-15 06:41:47 +03:00
Consolidate Linux setrlimit and getrlimit implementation
This patch consolidates all Linux setrlimit and getrlimit on the default
sysdeps/unix/sysv/linux/{set,get}rlimit{64}.c. It contains two exceptions:
1. mips32 and mips64n32 which requires a versioned symbol for GLIBC 2.19
and higher due a broken RLIM64_INFINITY constant.
2. sparc32 does not define a compat symbol for getrlimit64 for old 2GB
limit. I am not sure if it is required, but a RLIM_INFINITY fix [1]
change its definition without adding a compat symbol. This patch does
not aim to address this possible issue, it follow current symbol
export.
The default implementation uses prlimit64 for 64 bit rlim_t ({set,get}rlimit64)
and if it fails with ENOSYS it fall back to {get,set}rlimit syscall. This
code path is only used on kernel older than 2.6.36 (basically now only x86)
and I avoid to user __ASSUME_PRLIMTI64 to simplify the implementation. Once
x86 moves to be on par with other architectures regarding minimum kernel
supported we can get rid of using old syscalls and default path.
A new type size define is added, __RLIM_T_MATCHES_RLIM64_T, where is set as
default for 64 bits ports. This allows the default implementation to avoid
{get,set}rlimit building and alias {get,set}rlimit64 to {get,set}rlimit.
Checked on x86_64, i386, armhf, aarch64, and powerpc64le. I also did a
sanity build plus check-abi on all other supported architectures.
[1] Commit 9c96ff2385
Adhemerval Zanella <adhemerval.zanella@linaro.org>
Yury Norov <ynorov@caviumnetworks.com>
* bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): define.
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h [__s390x__]
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
[__arch64__ || __sparcv9] (__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h [__86_64__]
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
* sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = resource]
(sysdep_routines): Remove oldgetrlimit64.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = resource]
(sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/m68k/Makefile [$(subdir) = resource]
(sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
[$(subdir) = resource] (sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/Makefile
[$(subdir) = resource] (sysdep_routines): Likewise.
* sysdeps/unix/sysv/linux/arm/getrlimit64.c: Remove file.
* sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/hppa/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/i386/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/m68k/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/sh/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c: Likewise.
* sysdeps/sysv/linux/generic/wordsize-32/syscalls.list: Remove
setrlimit and getrlimit.
* sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/getrlimit.c: New file.
* sysdeps/unix/sysv/linux/sparc/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/setrlimit.c: Likewise.
* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Handle
__RLIM_T_MATCHES_RLIM64_T and add alias if defined.
(__old_getrlimit64): Add compatibility symbol.
* sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit): Likewise.
This commit is contained in:
59
ChangeLog
59
ChangeLog
@ -1,3 +1,62 @@
|
|||||||
|
2016-11-17 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
Yury Norov <ynorov@caviumnetworks.com>
|
||||||
|
|
||||||
|
* bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): define.
|
||||||
|
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
|
||||||
|
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
|
||||||
|
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h [__s390x__]
|
||||||
|
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
|
||||||
|
[__arch64__ || __sparcv9] (__RLIM_T_MATCHES_RLIM64_T): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h [__86_64__]
|
||||||
|
(__RLIM_T_MATCHES_RLIM64_T): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = resource]
|
||||||
|
(sysdep_routines): Remove oldgetrlimit64.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = resource]
|
||||||
|
(sysdep_routines): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/m68k/Makefile [$(subdir) = resource]
|
||||||
|
(sysdep_routines): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
|
||||||
|
[$(subdir) = resource] (sysdep_routines): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/s390/s390-32/Makefile
|
||||||
|
[$(subdir) = resource] (sysdep_routines): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/arm/getrlimit64.c: Remove file.
|
||||||
|
* sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/arm/oldgetrlimit.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/arm/oldsetrlimit.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/hppa/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/m68k/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/sh/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c: Likewise.
|
||||||
|
* sysdeps/sysv/linux/generic/wordsize-32/syscalls.list: Remove
|
||||||
|
setrlimit and getrlimit.
|
||||||
|
* sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/getrlimit.c: New file.
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/getrlimit64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/setrlimit.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Handle
|
||||||
|
__RLIM_T_MATCHES_RLIM64_T and add alias if defined.
|
||||||
|
(__old_getrlimit64): Add compatibility symbol.
|
||||||
|
* sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit): Likewise.
|
||||||
|
|
||||||
2016-11-17 Joseph Myers <joseph@codesourcery.com>
|
2016-11-17 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* scripts/build-many-glibcs.py (Config.build_gcc): Configure with
|
* scripts/build-many-glibcs.py (Config.build_gcc): Configure with
|
||||||
|
@ -69,6 +69,11 @@
|
|||||||
|
|
||||||
/* Same for ino_t and ino64_t. */
|
/* Same for ino_t and ino64_t. */
|
||||||
# define __INO_T_MATCHES_INO64_T 1
|
# define __INO_T_MATCHES_INO64_T 1
|
||||||
|
|
||||||
|
/* And for rlim_t and rlim64_t. */
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 1
|
||||||
|
#else
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of descriptors that can fit in an `fd_set'. */
|
/* Number of descriptors that can fit in an `fd_set'. */
|
||||||
|
@ -66,6 +66,9 @@
|
|||||||
for C type-checking purposes. */
|
for C type-checking purposes. */
|
||||||
#define __OFF_T_MATCHES_OFF64_T 1
|
#define __OFF_T_MATCHES_OFF64_T 1
|
||||||
|
|
||||||
|
/* And for __rlim_t and __rlim64_t. */
|
||||||
|
#define __RLIM_T_MATCHES_RLIM64_T 1
|
||||||
|
|
||||||
/* Number of descriptors that can fit in an `fd_set'. */
|
/* Number of descriptors that can fit in an `fd_set'. */
|
||||||
#define __FD_SETSIZE 1024
|
#define __FD_SETSIZE 1024
|
||||||
|
|
||||||
|
@ -12,10 +12,6 @@ ifeq ($(subdir),signal)
|
|||||||
sysdep_routines += sigrestorer
|
sysdep_routines += sigrestorer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),resource)
|
|
||||||
sysdep_routines += oldgetrlimit64
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(subdir),stdlib)
|
ifeq ($(subdir),stdlib)
|
||||||
gen-as-const-headers += ucontext_i.sym
|
gen-as-const-headers += ucontext_i.sym
|
||||||
endif
|
endif
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
|
@ -1 +0,0 @@
|
|||||||
/* Empty. */
|
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
|
|
@ -1 +0,0 @@
|
|||||||
/* Empty. */
|
|
@ -70,6 +70,11 @@
|
|||||||
|
|
||||||
/* Same for ino_t and ino64_t. */
|
/* Same for ino_t and ino64_t. */
|
||||||
# define __INO_T_MATCHES_INO64_T 1
|
# define __INO_T_MATCHES_INO64_T 1
|
||||||
|
|
||||||
|
/* And for __rlim_t and __rlim64_t. */
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 1
|
||||||
|
#else
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of descriptors that can fit in an `fd_set'. */
|
/* Number of descriptors that can fit in an `fd_set'. */
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# File name Caller Syscall name # args Strong name Weak names
|
# File name Caller Syscall name # args Strong name Weak names
|
||||||
|
|
||||||
# rlimit APIs
|
# rlimit APIs
|
||||||
getrlimit - getrlimit i:ip __getrlimit getrlimit
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit
|
|
||||||
prlimit64 EXTRA prlimit64 i:iipp prlimit64
|
prlimit64 EXTRA prlimit64 i:iipp prlimit64
|
||||||
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
|
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
|
||||||
|
56
sysdeps/unix/sysv/linux/getrlimit.c
Normal file
56
sysdeps/unix/sysv/linux/getrlimit.c
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/* Linux getrlimit implementation (32 bits rlim_t).
|
||||||
|
Copyright (C) 2016 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
|
||||||
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <shlib-compat.h>
|
||||||
|
|
||||||
|
#if !__RLIM_T_MATCHES_RLIM64_T
|
||||||
|
|
||||||
|
/* The __NR_getrlimit compatibility implementation is required iff
|
||||||
|
__NR_ugetrlimit is also defined (meaning an old broken RLIM_INFINITY
|
||||||
|
definition). */
|
||||||
|
# ifndef __NR_ugetrlimit
|
||||||
|
# define __NR_ugetrlimit __NR_getrlimit
|
||||||
|
# undef SHLIB_COMPAT
|
||||||
|
# define SHLIB_COMPAT(a, b, c) 0
|
||||||
|
# endif
|
||||||
|
|
||||||
|
int
|
||||||
|
__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
|
||||||
|
{
|
||||||
|
return INLINE_SYSCALL_CALL (ugetrlimit, resource, rlim);
|
||||||
|
}
|
||||||
|
weak_alias (__new_getrlimit, __getrlimit)
|
||||||
|
hidden_weak (__getrlimit)
|
||||||
|
|
||||||
|
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
|
||||||
|
/* Back compatible 2Gig limited rlimit. */
|
||||||
|
int
|
||||||
|
__old_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
|
||||||
|
{
|
||||||
|
return INLINE_SYSCALL_CALL (getrlimit, resource, rlim);
|
||||||
|
}
|
||||||
|
compat_symbol (libc, __old_getrlimit, getrlimit, GLIBC_2_0);
|
||||||
|
versioned_symbol (libc, __new_getrlimit, getrlimit, GLIBC_2_2);
|
||||||
|
# else
|
||||||
|
weak_alias (__new_getrlimit, getrlimit)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif /* __RLIM_T_MATCHES_RLIM64_T */
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
/* Linux getrlimit64 implementation (64 bits rlim_t).
|
||||||
|
Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,29 +17,46 @@
|
|||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/resource.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sysdep.h>
|
#include <shlib-compat.h>
|
||||||
#include <kernel-features.h>
|
|
||||||
|
/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
|
||||||
|
linking getlimit64 to {__}getrlimit does not throw a type error. */
|
||||||
|
#undef getrlimit
|
||||||
|
#undef __getrlimit
|
||||||
|
#define getrlimit getrlimit_redirect
|
||||||
|
#define __getrlimit __getrlimit_redirect
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#undef getrlimit
|
||||||
|
#undef __getrlimit
|
||||||
|
|
||||||
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
|
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
|
||||||
Returns 0 if successful, -1 if not (and sets errno). */
|
Returns 0 if successful, -1 if not (and sets errno). */
|
||||||
int
|
int
|
||||||
__getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
|
__getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
|
||||||
{
|
{
|
||||||
#ifdef __ASSUME_PRLIMIT64
|
#ifdef __NR_prlimit64
|
||||||
return INLINE_SYSCALL (prlimit64, 4, 0, resource, NULL, rlimits);
|
int res = INLINE_SYSCALL_CALL (prlimit64, 0, resource, NULL, rlimits);
|
||||||
#else
|
|
||||||
# ifdef __NR_prlimit64
|
|
||||||
int res = INLINE_SYSCALL (prlimit64, 4, 0, resource, NULL, rlimits);
|
|
||||||
if (res == 0 || errno != ENOSYS)
|
if (res == 0 || errno != ENOSYS)
|
||||||
return res;
|
return res;
|
||||||
# endif
|
#endif
|
||||||
struct rlimit rlimits32;
|
|
||||||
|
|
||||||
if (__getrlimit (resource, &rlimits32) < 0)
|
/* The fallback code only makes sense if the platform supports either
|
||||||
|
__NR_ugetrlimit and/or __NR_getrlimit. */
|
||||||
|
#if defined (__NR_ugetrlimit) || defined (__NR_getrlimit)
|
||||||
|
# ifndef __NR_ugetrlimit
|
||||||
|
# define __NR_ugetrlimit __NR_getrlimit
|
||||||
|
# endif
|
||||||
|
# if __RLIM_T_MATCHES_RLIM64_T
|
||||||
|
# define rlimits32 (*rlimits)
|
||||||
|
# else
|
||||||
|
struct rlimit rlimits32;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (INLINE_SYSCALL_CALL (ugetrlimit, resource, &rlimits32) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
# if !__RLIM_T_MATCHES_RLIM64_T
|
||||||
if (rlimits32.rlim_cur == RLIM_INFINITY)
|
if (rlimits32.rlim_cur == RLIM_INFINITY)
|
||||||
rlimits->rlim_cur = RLIM64_INFINITY;
|
rlimits->rlim_cur = RLIM64_INFINITY;
|
||||||
else
|
else
|
||||||
@ -47,12 +65,56 @@ __getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
|
|||||||
rlimits->rlim_max = RLIM64_INFINITY;
|
rlimits->rlim_max = RLIM64_INFINITY;
|
||||||
else
|
else
|
||||||
rlimits->rlim_max = rlimits32.rlim_max;
|
rlimits->rlim_max = rlimits32.rlim_max;
|
||||||
|
# endif /* !__RLIM_T_MATCHES_RLIM64_T */
|
||||||
|
#endif /* defined (__NR_ugetrlimit) || defined (__NR_getrlimit) */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
libc_hidden_def (__getrlimit64)
|
libc_hidden_def (__getrlimit64)
|
||||||
#ifndef getrlimit64
|
|
||||||
|
#if __RLIM_T_MATCHES_RLIM64_T
|
||||||
|
/* If both rlim_t and rlimt64_t are essentially the same type we can use
|
||||||
|
alias both interfaces. */
|
||||||
|
strong_alias (__getrlimit64, __GI_getrlimit)
|
||||||
|
strong_alias (__getrlimit64, __GI___getrlimit)
|
||||||
|
strong_alias (__getrlimit64, __getrlimit)
|
||||||
|
weak_alias (__getrlimit64, getrlimit)
|
||||||
|
/* And there is no need for compat symbols. */
|
||||||
|
# undef SHLIB_COMPAT
|
||||||
|
# define SHLIB_COMPAT(a, b, c) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
|
||||||
|
/* Back compatible 2GiB limited rlimit. */
|
||||||
|
extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
|
||||||
|
|
||||||
|
int
|
||||||
|
attribute_compat_text_section
|
||||||
|
__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
|
||||||
|
{
|
||||||
|
# if __RLIM_T_MATCHES_RLIM64_T
|
||||||
|
# define rlimits32 (*rlimits)
|
||||||
|
# else
|
||||||
|
struct rlimit rlimits32;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (__new_getrlimit (resource, &rlimits32) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (rlimits32.rlim_cur == RLIM_INFINITY)
|
||||||
|
rlimits->rlim_cur = RLIM64_INFINITY >> 1;
|
||||||
|
else
|
||||||
|
rlimits->rlim_cur = rlimits32.rlim_cur;
|
||||||
|
if (rlimits32.rlim_max == RLIM_INFINITY)
|
||||||
|
rlimits->rlim_max = RLIM64_INFINITY >> 1;
|
||||||
|
else
|
||||||
|
rlimits->rlim_max = rlimits32.rlim_max;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
|
||||||
|
compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
|
||||||
|
#else
|
||||||
weak_alias (__getrlimit64, getrlimit64)
|
weak_alias (__getrlimit64, getrlimit64)
|
||||||
libc_hidden_weak (getrlimit64)
|
libc_hidden_weak (getrlimit64)
|
||||||
#endif
|
#endif
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
|
@ -31,8 +31,6 @@ shutdown - shutdown i:ii __shutdown shutdown
|
|||||||
socket - socket i:iii __socket socket
|
socket - socket i:iii __socket socket
|
||||||
socketpair - socketpair i:iiif __socketpair socketpair
|
socketpair - socketpair i:iiif __socketpair socketpair
|
||||||
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit
|
|
||||||
getrlimit - getrlimit i:ip __getrlimit getrlimit
|
|
||||||
prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
|
prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
|
||||||
fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
|
fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
|
||||||
personality EXTRA personality Ei:i __personality personality
|
personality EXTRA personality Ei:i __personality personality
|
||||||
|
@ -49,10 +49,6 @@ libpthread-sysdep_routines += libc-do-syscall
|
|||||||
libpthread-shared-only-routines += libc-do-syscall
|
libpthread-shared-only-routines += libc-do-syscall
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),resource)
|
|
||||||
sysdep_routines += oldgetrlimit64
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(subdir),stdlib)
|
ifeq ($(subdir),stdlib)
|
||||||
gen-as-const-headers += ucontext_i.sym
|
gen-as-const-headers += ucontext_i.sym
|
||||||
endif
|
endif
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
/* Copyright (C) 1991-2016 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
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
/* This is a compatibility file. If we don't build the libc with
|
|
||||||
versioning don't compile this file. */
|
|
||||||
#include <shlib-compat.h>
|
|
||||||
#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/resource.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
|
|
||||||
extern int __old_getrlimit64 (enum __rlimit_resource resource,
|
|
||||||
struct rlimit64 *rlimits);
|
|
||||||
|
|
||||||
|
|
||||||
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
|
|
||||||
Returns 0 if successful, -1 if not (and sets errno). */
|
|
||||||
int
|
|
||||||
attribute_compat_text_section
|
|
||||||
__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
|
|
||||||
{
|
|
||||||
struct rlimit rlimits32;
|
|
||||||
|
|
||||||
if (__new_getrlimit (resource, &rlimits32) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (rlimits32.rlim_cur == RLIM_INFINITY)
|
|
||||||
rlimits->rlim_cur = RLIM64_INFINITY >> 1;
|
|
||||||
else
|
|
||||||
rlimits->rlim_cur = rlimits32.rlim_cur;
|
|
||||||
if (rlimits32.rlim_max == RLIM_INFINITY)
|
|
||||||
rlimits->rlim_max = RLIM64_INFINITY >> 1;
|
|
||||||
else
|
|
||||||
rlimits->rlim_max = rlimits32.rlim_max;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
|
|
||||||
|
|
||||||
#endif /* SHLIB_COMPAT */
|
|
@ -18,8 +18,6 @@ setfsuid - setfsuid32 Ei:i setfsuid
|
|||||||
modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt
|
modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt
|
||||||
vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0
|
vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0
|
||||||
vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4
|
vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4
|
||||||
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
|
|
||||||
waitpid - waitpid Ci:ipi __waitpid waitpid
|
waitpid - waitpid Ci:ipi __waitpid waitpid
|
||||||
|
|
||||||
prlimit64 EXTRA prlimit64 i:iipp prlimit64
|
prlimit64 EXTRA prlimit64 i:iipp prlimit64
|
||||||
|
@ -18,7 +18,3 @@ sysdep-rtld-routines += m68k-vdso
|
|||||||
sysdep-others += lddlibc4
|
sysdep-others += lddlibc4
|
||||||
install-bin += lddlibc4
|
install-bin += lddlibc4
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),resource)
|
|
||||||
sysdep_routines += oldgetrlimit64
|
|
||||||
endif
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
|
@ -1,4 +0,0 @@
|
|||||||
# File name Caller Syscall name Args Strong name Weak names
|
|
||||||
|
|
||||||
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
|
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
|
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
|
|
@ -1,6 +1,2 @@
|
|||||||
# See Makeconfig regarding the use of default-abi.
|
# See Makeconfig regarding the use of default-abi.
|
||||||
default-abi := 32
|
default-abi := 32
|
||||||
|
|
||||||
ifeq ($(subdir),resource)
|
|
||||||
sysdep_routines += oldgetrlimit64
|
|
||||||
endif
|
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
chown - chown i:sii __chown chown@@GLIBC_2.1
|
chown - chown i:sii __chown chown@@GLIBC_2.1
|
||||||
lchown - lchown i:sii __lchown lchown@@GLIBC_2.0 chown@GLIBC_2.0
|
lchown - lchown i:sii __lchown lchown@@GLIBC_2.0 chown@GLIBC_2.0
|
||||||
|
|
||||||
# System calls with wrappers.
|
|
||||||
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
|
|
||||||
|
|
||||||
# Due to 64bit alignment there is a dummy second parameter
|
# Due to 64bit alignment there is a dummy second parameter
|
||||||
readahead - readahead i:iiiii __readahead readahead
|
readahead - readahead i:iiiii __readahead readahead
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
# File name Caller Syscall name # args Strong name Weak names
|
|
||||||
|
|
||||||
getrlimit - ugetrlimit i:ip __getrlimit getrlimit getrlimit64 __getrlimit64
|
|
@ -75,6 +75,11 @@
|
|||||||
|
|
||||||
/* Same for ino_t and ino64_t. */
|
/* Same for ino_t and ino64_t. */
|
||||||
# define __INO_T_MATCHES_INO64_T 1
|
# define __INO_T_MATCHES_INO64_T 1
|
||||||
|
|
||||||
|
/* And for __rlim_t and __rlim64_t. */
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 1
|
||||||
|
#else
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of descriptors that can fit in an `fd_set'. */
|
/* Number of descriptors that can fit in an `fd_set'. */
|
||||||
|
@ -10,10 +10,6 @@ ifeq ($(subdir),misc)
|
|||||||
sysdep_headers += sys/elf.h
|
sysdep_headers += sys/elf.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),resource)
|
|
||||||
sysdep_routines += oldgetrlimit64
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(subdir),elf)
|
ifeq ($(subdir),elf)
|
||||||
ifeq (yes,$(build-shared))
|
ifeq (yes,$(build-shared))
|
||||||
# This is needed to support g++ v2 and v3.
|
# This is needed to support g++ v2 and v3.
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
|
|
@ -15,9 +15,6 @@ getgroups - getgroups32 i:ip __getgroups getgroups
|
|||||||
setfsgid - setfsgid32 Ei:i setfsgid
|
setfsgid - setfsgid32 Ei:i setfsgid
|
||||||
setfsuid - setfsuid32 Ei:i setfsuid
|
setfsuid - setfsuid32 Ei:i setfsuid
|
||||||
|
|
||||||
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
|
|
||||||
|
|
||||||
prlimit64 EXTRA prlimit64 i:iipp prlimit64
|
prlimit64 EXTRA prlimit64 i:iipp prlimit64
|
||||||
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
|
fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
|
||||||
personality EXTRA personality Ei:i __personality personality
|
personality EXTRA personality Ei:i __personality personality
|
||||||
|
64
sysdeps/unix/sysv/linux/setrlimit.c
Normal file
64
sysdeps/unix/sysv/linux/setrlimit.c
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/* Linux setrlimit implementation (32 bits off_t).
|
||||||
|
Copyright (C) 2016 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
|
||||||
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <shlib-compat.h>
|
||||||
|
|
||||||
|
#if !__RLIM_T_MATCHES_RLIM64_T
|
||||||
|
|
||||||
|
/* The compatibility symbol is meant to match the old __NR_getrlimit syscall
|
||||||
|
(with broken RLIM_INFINITY definition). It should be provided iff
|
||||||
|
__NR_getrlimit and __NR_ugetrlimit are both defined. */
|
||||||
|
# ifndef __NR_ugetrlimit
|
||||||
|
# undef SHLIB_COMPAT
|
||||||
|
# define SHLIB_COMPAT(a, b, c) 0
|
||||||
|
# endif
|
||||||
|
|
||||||
|
int
|
||||||
|
__setrlimit (enum __rlimit_resource resource, const struct rlimit *rlim)
|
||||||
|
{
|
||||||
|
# ifdef __NR_prlimit64
|
||||||
|
struct rlimit64 rlim64;
|
||||||
|
|
||||||
|
if (rlim->rlim_cur == RLIM_INFINITY)
|
||||||
|
rlim64.rlim_cur = RLIM64_INFINITY;
|
||||||
|
else
|
||||||
|
rlim64.rlim_cur = rlim->rlim_cur;
|
||||||
|
if (rlim->rlim_max == RLIM_INFINITY)
|
||||||
|
rlim64.rlim_max = RLIM64_INFINITY;
|
||||||
|
else
|
||||||
|
rlim64.rlim_max = rlim->rlim_max;
|
||||||
|
|
||||||
|
int res = INLINE_SYSCALL_CALL (prlimit64, 0, resource, &rlim64, NULL);
|
||||||
|
if (res == 0 || errno != ENOSYS)
|
||||||
|
return res;
|
||||||
|
# endif
|
||||||
|
return INLINE_SYSCALL_CALL (setrlimit, resource, rlim);
|
||||||
|
}
|
||||||
|
|
||||||
|
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
|
||||||
|
strong_alias (__setrlimit, __setrlimit_1)
|
||||||
|
compat_symbol (libc, __setrlimit, setrlimit, GLIBC_2_0);
|
||||||
|
versioned_symbol (libc, __setrlimit_1, setrlimit, GLIBC_2_2);
|
||||||
|
# else
|
||||||
|
weak_alias (__setrlimit, setrlimit)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif /* __RLIM_T_MATCHES_RLIM64_T */
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
/* Linux setrlimit64 implementation (64 bits off_t).
|
||||||
|
Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,25 +17,37 @@
|
|||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/resource.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sysdep.h>
|
#include <shlib-compat.h>
|
||||||
#include <kernel-features.h>
|
|
||||||
|
/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T
|
||||||
|
linking setlimit64 to {__}setrlimit does not throw a type error. */
|
||||||
|
#undef settrlimit
|
||||||
|
#undef __sttrlimit
|
||||||
|
#define setrlimit setrlimit_redirect
|
||||||
|
#define __setrlimit __setrlimit_redirect
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#undef setrlimit
|
||||||
|
#undef __setrlimit
|
||||||
|
|
||||||
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
|
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
|
||||||
Only the super-user can increase hard limits.
|
Only the super-user can increase hard limits.
|
||||||
Return 0 if successful, -1 if not (and sets errno). */
|
Return 0 if successful, -1 if not (and sets errno). */
|
||||||
int
|
int
|
||||||
setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
|
__setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
|
||||||
{
|
{
|
||||||
#ifdef __ASSUME_PRLIMIT64
|
int res;
|
||||||
return INLINE_SYSCALL (prlimit64, 4, 0, resource, rlimits, NULL);
|
|
||||||
#else
|
#ifdef __NR_prlimit64
|
||||||
# ifdef __NR_prlimit64
|
res = INLINE_SYSCALL_CALL (prlimit64, 0, resource, rlimits, NULL);
|
||||||
int res = INLINE_SYSCALL (prlimit64, 4, 0, resource, rlimits, NULL);
|
|
||||||
if (res == 0 || errno != ENOSYS)
|
if (res == 0 || errno != ENOSYS)
|
||||||
return res;
|
return res;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
|
/* The fallback code only makes sense if the platform supports
|
||||||
|
__NR_setrlimit. */
|
||||||
|
#ifdef __NR_setrlimit
|
||||||
|
# if !__RLIM_T_MATCHES_RLIM64_T
|
||||||
struct rlimit rlimits32;
|
struct rlimit rlimits32;
|
||||||
|
|
||||||
if (rlimits->rlim_cur >= RLIM_INFINITY)
|
if (rlimits->rlim_cur >= RLIM_INFINITY)
|
||||||
@ -45,7 +58,18 @@ setrlimit64 (enum __rlimit_resource resource, const struct rlimit64 *rlimits)
|
|||||||
rlimits32.rlim_max = RLIM_INFINITY;
|
rlimits32.rlim_max = RLIM_INFINITY;
|
||||||
else
|
else
|
||||||
rlimits32.rlim_max = rlimits->rlim_max;
|
rlimits32.rlim_max = rlimits->rlim_max;
|
||||||
|
# else
|
||||||
|
# define rlimits32 (*rlimits)
|
||||||
|
# endif
|
||||||
|
|
||||||
return __setrlimit (resource, &rlimits32);
|
res = INLINE_SYSCALL_CALL (setrlimit, resource, &rlimits32);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
weak_alias (__setrlimit64, setrlimit64)
|
||||||
|
|
||||||
|
#if __RLIM_T_MATCHES_RLIM64_T
|
||||||
|
strong_alias (__setrlimit64, __setrlimit)
|
||||||
|
weak_alias (__setrlimit64, setrlimit)
|
||||||
|
#endif
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
|
@ -69,6 +69,11 @@
|
|||||||
|
|
||||||
/* Same for ino_t and ino64_t. */
|
/* Same for ino_t and ino64_t. */
|
||||||
# define __INO_T_MATCHES_INO64_T 1
|
# define __INO_T_MATCHES_INO64_T 1
|
||||||
|
|
||||||
|
/* And for __rlim_t and __rlim64_t. */
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 1
|
||||||
|
#else
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of descriptors that can fit in an `fd_set'. */
|
/* Number of descriptors that can fit in an `fd_set'. */
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
|
/* Linux getrlimit64 sparc32 implementation (64 bits rlim_t).
|
||||||
|
Copyright (C) 2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -15,11 +16,9 @@
|
|||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#define getrlimit64 __new_getrlimit64
|
|
||||||
|
|
||||||
#include "../getrlimit64.c"
|
|
||||||
|
|
||||||
#undef getrlimit64
|
|
||||||
#include <shlib-compat.h>
|
#include <shlib-compat.h>
|
||||||
versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
|
|
||||||
strong_alias (__getrlimit64, __GI_getrlimit64)
|
#undef SHLIB_COMPAT
|
||||||
|
#define SHLIB_COMPAT(a,b,c) 0
|
||||||
|
|
||||||
|
#include <sysdeps/unix/sysv/linux/getrlimit64.c>
|
@ -4,8 +4,6 @@ chown - chown32 i:sii __chown chown
|
|||||||
lchown - lchown32 i:sii __lchown lchown
|
lchown - lchown32 i:sii __lchown lchown
|
||||||
fchown - fchown32 i:iii __fchown fchown
|
fchown - fchown32 i:iii __fchown fchown
|
||||||
|
|
||||||
setrlimit - setrlimit 2 __setrlimit setrlimit
|
|
||||||
getrlimit - getrlimit 2 __getrlimit getrlimit
|
|
||||||
getegid - getegid32 Ei: __getegid getegid
|
getegid - getegid32 Ei: __getegid getegid
|
||||||
geteuid - geteuid32 Ei: __geteuid geteuid
|
geteuid - geteuid32 Ei: __geteuid geteuid
|
||||||
getgid - getgid32 Ei: __getgid getgid
|
getgid - getgid32 Ei: __getgid getgid
|
||||||
|
@ -26,7 +26,6 @@ getpmsg - getpmsg i:ipppp getpmsg
|
|||||||
getppid - getppid Ei: __getppid getppid
|
getppid - getppid Ei: __getppid getppid
|
||||||
getresuid - getresuid i:ppp getresuid
|
getresuid - getresuid i:ppp getresuid
|
||||||
getresgid - getresgid i:ppp getresgid
|
getresgid - getresgid i:ppp getresgid
|
||||||
getrlimit - ugetrlimit i:ip __new_getrlimit __getrlimit getrlimit@@GLIBC_2.2
|
|
||||||
getsid - getsid i:i getsid
|
getsid - getsid i:i getsid
|
||||||
init_module EXTRA init_module 5 init_module
|
init_module EXTRA init_module 5 init_module
|
||||||
inotify_add_watch EXTRA inotify_add_watch i:isi inotify_add_watch
|
inotify_add_watch EXTRA inotify_add_watch i:isi inotify_add_watch
|
||||||
|
@ -1 +0,0 @@
|
|||||||
/* getrlimit64 is the same as getrlimit. */
|
|
@ -1 +0,0 @@
|
|||||||
/* setrlimit64 is the same as setrlimit. */
|
|
@ -3,8 +3,6 @@
|
|||||||
fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64
|
fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64
|
||||||
statfs - statfs i:sp __statfs statfs statfs64
|
statfs - statfs i:sp __statfs statfs statfs64
|
||||||
mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64
|
mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64
|
||||||
getrlimit - getrlimit i:ip __getrlimit getrlimit getrlimit64 __getrlimit64
|
|
||||||
setrlimit - setrlimit i:ip __setrlimit setrlimit setrlimit64
|
|
||||||
readahead - readahead i:iii __readahead readahead
|
readahead - readahead i:iii __readahead readahead
|
||||||
sendfile - sendfile i:iipi sendfile sendfile64
|
sendfile - sendfile i:iipi sendfile sendfile64
|
||||||
sync_file_range - sync_file_range Ci:iiii sync_file_range
|
sync_file_range - sync_file_range Ci:iiii sync_file_range
|
||||||
|
@ -81,6 +81,11 @@
|
|||||||
|
|
||||||
/* Same for ino_t and ino64_t. */
|
/* Same for ino_t and ino64_t. */
|
||||||
# define __INO_T_MATCHES_INO64_T 1
|
# define __INO_T_MATCHES_INO64_T 1
|
||||||
|
|
||||||
|
/* And for __rlim_t and __rlim64_t. */
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 1
|
||||||
|
#else
|
||||||
|
# define __RLIM_T_MATCHES_RLIM64_T 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of descriptors that can fit in an `fd_set'. */
|
/* Number of descriptors that can fit in an `fd_set'. */
|
||||||
|
Reference in New Issue
Block a user