From c27be22d6861fbc6d86e326329d3bb1de4d3358e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 24 Jan 2000 01:38:53 +0000 Subject: [PATCH] Revert to glibc 2.0 versions of these functions. --- sysdeps/unix/sysv/linux/arm/getrlimit.c | 1 - sysdeps/unix/sysv/linux/arm/getrlimit64.c | 1 - sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c | 1 - sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c | 1 - sysdeps/unix/sysv/linux/arm/setrlimit.c | 1 - sysdeps/unix/sysv/linux/arm/setrlimit64.c | 1 - sysdeps/unix/sysv/linux/i386/getrlimit.c | 79 ------------------- sysdeps/unix/sysv/linux/i386/getrlimit64.c | 28 ------- sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c | 53 ------------- sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c | 52 ------------ sysdeps/unix/sysv/linux/i386/setrlimit.c | 76 ------------------ sysdeps/unix/sysv/linux/i386/setrlimit64.c | 28 ------- 12 files changed, 322 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/arm/getrlimit.c delete mode 100644 sysdeps/unix/sysv/linux/arm/getrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/arm/setrlimit.c delete mode 100644 sysdeps/unix/sysv/linux/arm/setrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/i386/getrlimit.c delete mode 100644 sysdeps/unix/sysv/linux/i386/getrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/i386/setrlimit.c delete mode 100644 sysdeps/unix/sysv/linux/i386/setrlimit64.c diff --git a/sysdeps/unix/sysv/linux/arm/getrlimit.c b/sysdeps/unix/sysv/linux/arm/getrlimit.c deleted file mode 100644 index fc06dbd6419..00000000000 --- a/sysdeps/unix/sysv/linux/arm/getrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arm/getrlimit64.c b/sysdeps/unix/sysv/linux/arm/getrlimit64.c deleted file mode 100644 index fef018f4717..00000000000 --- a/sysdeps/unix/sysv/linux/arm/getrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c deleted file mode 100644 index 4c27e957bf4..00000000000 --- a/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c b/sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c deleted file mode 100644 index 93bdc37cacd..00000000000 --- a/sysdeps/unix/sysv/linux/arm/oldsetrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arm/setrlimit.c b/sysdeps/unix/sysv/linux/arm/setrlimit.c deleted file mode 100644 index bfaef74c387..00000000000 --- a/sysdeps/unix/sysv/linux/arm/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arm/setrlimit64.c b/sysdeps/unix/sysv/linux/arm/setrlimit64.c deleted file mode 100644 index ed64b871f4b..00000000000 --- a/sysdeps/unix/sysv/linux/arm/setrlimit64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/i386/getrlimit.c b/sysdeps/unix/sysv/linux/i386/getrlimit.c deleted file mode 100644 index c63b4baa5c6..00000000000 --- a/sysdeps/unix/sysv/linux/i386/getrlimit.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 1999 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include -#include - -#include -#include - -extern int __syscall_ugetrlimit __P ((unsigned int resource, - struct rlimit *rlimits)); -extern int __syscall_getrlimit __P ((unsigned int resource, - struct rlimit *rlimits)); - -/* Linux 2.3.25 introduced a new system call since the types used for - the limits are now unsigned. */ -#ifdef __NR_ugetrlimit -int __have_no_new_getrlimit; -#endif - -int -__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits) -{ - int result; - -#ifdef __NR_ugetrlimit - if (__have_no_new_getrlimit <= 0) - { - result = INLINE_SYSCALL (ugetrlimit, 2, resource, rlimits); - - /* If the system call is available remember this fact and return. */ - if (result != -1 || errno != ENOSYS) - { - __have_no_new_getrlimit = -1; - return result; - } - - /* Remember that the system call is not available. */ - __have_no_new_getrlimit = 1; - } -#endif - - /* Fall back to the old system call. */ - result = INLINE_SYSCALL (getrlimit, 2, resource, rlimits); - - if (result == -1) - return result; - - /* We might have to correct the limits values. Since the old values - were signed the infinity value is too small. */ - if (rlimits->rlim_cur == RLIM_INFINITY >> 1) - rlimits->rlim_cur = RLIM_INFINITY; - if (rlimits->rlim_max == RLIM_INFINITY >> 1) - rlimits->rlim_max = RLIM_INFINITY; - - return result; -} - -weak_alias (__new_getrlimit, __getrlimit); -#if defined PIC && DO_VERSIONING -default_symbol_version (__new_getrlimit, getrlimit, GLIBC_2.1.3); -#else -weak_alias (__new_getrlimit, getrlimit); -#endif diff --git a/sysdeps/unix/sysv/linux/i386/getrlimit64.c b/sysdeps/unix/sysv/linux/i386/getrlimit64.c deleted file mode 100644 index 602dd28d8ab..00000000000 --- a/sysdeps/unix/sysv/linux/i386/getrlimit64.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1999 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#define getrlimit64 __new_getrlimit64 - -#include - -#undef getrlimit64 -#if defined PIC && defined DO_VERSIONING -default_symbol_version (__new_getrlimit64, getrlimit64, GLIBC_2.1.3); -#else -weak_alias (__new_getrlimit64, getrlimit64); -#endif diff --git a/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c deleted file mode 100644 index 5fb0becfbe2..00000000000 --- a/sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 1999 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This is a compatibility file. If we don't build the libc with - versioning don't compile this file. */ -#if defined PIC && DO_VERSIONING - -#include -#include -#include - -extern int __old_getrlimit (enum __rlimit_resource, struct rlimit *); - -/* Put the soft and hard limits for RESOURCE in *RLIMITS. - Returns 0 if successful, -1 if not (and sets errno). */ -int -__old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits) -{ - struct rlimit rlimits32; - - if (__old_getrlimit (resource, &rlimits32) < 0) - return -1; - - if (rlimits32.rlim_cur == RLIM_INFINITY >> 1) - rlimits->rlim_cur = RLIM64_INFINITY >> 1; - else - rlimits->rlim_cur = rlimits32.rlim_cur; - if (rlimits32.rlim_max == RLIM_INFINITY >> 1) - rlimits->rlim_max = RLIM64_INFINITY >> 1; - else - rlimits->rlim_max = rlimits32.rlim_max; - - return 0; -} - -symbol_version (__old_getrlimit64, getrlimit64, GLIBC_2.1); - -#endif /* PIC && DO_VERSIONING */ diff --git a/sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c b/sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c deleted file mode 100644 index c5448dcdcef..00000000000 --- a/sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 1991, 95, 96, 97, 98, 1999 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This is a compatibility file. If we don't build the libc with - versioning don't compile this file. */ -#if defined PIC && DO_VERSIONING - -#include -#include -#include - -extern int __old_setrlimit (enum __rlimit_resource, const struct rlimit *); - -/* Set the soft and hard limits for RESOURCE to *RLIMITS. - Only the super-user can increase hard limits. - Return 0 if successful, -1 if not (and sets errno). */ -int -__old_setrlimit64 (enum __rlimit_resource resource, - const struct rlimit64 *rlimits) -{ - struct rlimit rlimits32; - - if (rlimits->rlim_cur >= RLIM_INFINITY >> 1) - rlimits32.rlim_cur = RLIM_INFINITY >> 1; - else - rlimits32.rlim_cur = rlimits->rlim_cur; - if (rlimits->rlim_max >= RLIM_INFINITY >> 1) - rlimits32.rlim_max = RLIM_INFINITY >> 1; - else - rlimits32.rlim_max = rlimits->rlim_max; - - return __old_setrlimit (resource, &rlimits32); -} - -symbol_version (__old_setrlimit64, setrlimit64, GLIBC_2.1); - -#endif /* PIC && DO_VERSIONING */ diff --git a/sysdeps/unix/sysv/linux/i386/setrlimit.c b/sysdeps/unix/sysv/linux/i386/setrlimit.c deleted file mode 100644 index 9663812bb2f..00000000000 --- a/sysdeps/unix/sysv/linux/i386/setrlimit.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1999 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include -#include -#include - -#include -#include - -extern int __syscall_setrlimit (unsigned int resource, - const struct rlimit *rlimits); -extern int __syscall_ugetrlimit (unsigned int resource, - const struct rlimit *rlimits); - -/* Linux 2.3.25 introduced a new system call since the types used for - the limits are now unsigned. */ -#ifdef __NR_ugetrlimit -extern int __have_no_new_getrlimit; /* In getrlimit.c. */ -#endif - -int -__new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits) -{ - struct rlimit rlimits_small; - -#ifdef __NR_ugetrlimit - if (__have_no_new_getrlimit == 0) - { - /* Check if the new ugetrlimit syscall exists. We must do this - first because older kernels don't reject negative rlimit - values in setrlimit. */ - int result = INLINE_SYSCALL (ugetrlimit, 2, resource, &rlimits_small); - if (result != -1 || errno != ENOSYS) - /* The syscall exists. */ - __have_no_new_getrlimit = -1; - else - /* The syscall does not exist. */ - __have_no_new_getrlimit = 1; - } - if (__have_no_new_getrlimit < 0) - return INLINE_SYSCALL (setrlimit, 2, resource, rlimits); -#endif - - /* We might have to correct the limits values. Since the old values - were signed the new values might be too large. */ - rlimits_small.rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur, - RLIM_INFINITY >> 1); - rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max, - RLIM_INFINITY >> 1); - - /* Use the adjusted values. */ - return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small); -} - -weak_alias (__new_setrlimit, __setrlimit); -#if defined PIC && DO_VERSIONING -default_symbol_version (__new_setrlimit, setrlimit, GLIBC_2.1.3); -#else -weak_alias (__new_setrlimit, setrlimit); -#endif diff --git a/sysdeps/unix/sysv/linux/i386/setrlimit64.c b/sysdeps/unix/sysv/linux/i386/setrlimit64.c deleted file mode 100644 index 3e7e5cc0e05..00000000000 --- a/sysdeps/unix/sysv/linux/i386/setrlimit64.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1999 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#define setrlimit64 __new_setrlimit64 - -#include - -#undef setrlimit64 -#if defined PIC && defined DO_VERSIONING -default_symbol_version (__new_setrlimit64, setrlimit64, GLIBC_2.1.3); -#else -weak_alias (__new_setrlimit64, setrlimit64); -#endif -- 2.47.2