From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113853 invoked by alias); 16 Nov 2016 14:39:07 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 113807 invoked by uid 89); 16 Nov 2016 14:39:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-vk0-f42.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=23pQtHMV2p+piu/dnkYDkbdUCSdcdK6q4qDkdqOoPTc=; b=j+Vn+D/haDZH1gIhkKbyauir02UY+8Vts2DS3JYV3IV1/Ka+mmQa5/88bGx6VnJ/UY 0pd1DVEEfoIBnPMlyS38jyQSYpKtpd+uQqBxeibY8wAhIYoCjMbabWiIqx6tHpOzdeAG 9ZeGeFZif7Baf3Kq8C5A2wQ5kWtfc72mge3ERhHO2zDZrOv/SS7o4fzjEWVfHSr1hlUz v3rpkwvHv4yWRDY/QVf4zT+g5JcAaqLUS3izojcArdzE6qUkjfzDRPnavu2iC18WQJo/ AptOhgI+Gxk2N7+lXtDAMfmxGQvN4A6s8GDIsozaCLyafF9iDjStBmgpTYnIc9Pm0tD5 zJfQ== X-Gm-Message-State: ABUngve1L2STrDl047SNQ6cWdMVoWOSlXbZGgcKcGL33My3WbBfRJmL73VLCTD8PBVVlgGch X-Received: by 10.31.200.4 with SMTP id y4mr1684394vkf.115.1479307134079; Wed, 16 Nov 2016 06:38:54 -0800 (PST) Subject: Re: [PATCH v2] Consolidate Linux setrlimit and getrlimit implementation To: Andreas Schwab References: <1477592495-22272-1-git-send-email-adhemerval.zanella@linaro.org> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <2e51428a-eb0e-490b-f3ac-79c4cfd9d734@linaro.org> Date: Wed, 16 Nov 2016 14:39:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00552.txt.bz2 On 16/11/2016 12:19, Andreas Schwab wrote: > On Okt 27 2016, Adhemerval Zanella wrote: > >> Adhemerval Zanella >> Yury Norov >> >> * 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. > > Ok. > >> diff --git a/sysdeps/unix/sysv/linux/getrlimit64.c b/sysdeps/unix/sysv/linux/getrlimit64.c >> index d055a7f..739d054 100644 >> --- a/sysdeps/unix/sysv/linux/getrlimit64.c >> +++ b/sysdeps/unix/sysv/linux/getrlimit64.c >> @@ -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. >> >> The GNU C Library is free software; you can redistribute it and/or >> @@ -16,29 +17,46 @@ >> . */ >> >> #include >> -#include >> #include >> -#include >> -#include >> +#include >> + >> +/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T >> + linking getlimit64 to {__}getrlimit does not thrown a type error. */ > > throw Ack, I fixed it on my local branch. > >> +/* The fallback code only make sense if the platform supports either > > makes Ack. > >> +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2) >> +/* Back compatible 2Gig limited rlimit. */ > > 2GiB > Ack. >> diff --git a/sysdeps/unix/sysv/linux/setrlimit64.c b/sysdeps/unix/sysv/linux/setrlimit64.c >> index 5f444d2..0825465 100644 >> --- a/sysdeps/unix/sysv/linux/setrlimit64.c >> +++ b/sysdeps/unix/sysv/linux/setrlimit64.c >> @@ -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. >> >> The GNU C Library is free software; you can redistribute it and/or >> @@ -16,25 +17,37 @@ >> . */ >> >> #include >> -#include >> #include >> -#include >> -#include >> +#include >> + >> +/* Add this redirection so the strong_alias for __RLIM_T_MATCHES_RLIM64_T >> + linking setlimit64 to {__}setrlimit does not thrown a type error. */ > > throw Ack. > >> +/* The fallback code only make sense if the platform supports > > makes Ack.