public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Andreas Schwab <schwab@suse.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2] Consolidate Linux setrlimit and getrlimit implementation
Date: Wed, 16 Nov 2016 14:39:00 -0000	[thread overview]
Message-ID: <2e51428a-eb0e-490b-f3ac-79c4cfd9d734@linaro.org> (raw)
In-Reply-To: <mvmbmxf5wyp.fsf@hawking.suse.de>



On 16/11/2016 12:19, Andreas Schwab wrote:
> On Okt 27 2016, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> 
>> 	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.
> 
> 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 @@
>>     <http://www.gnu.org/licenses/>.  */
>>  
>>  #include <errno.h>
>> -#include <sys/resource.h>
>>  #include <sys/types.h>
>> -#include <sysdep.h>
>> -#include <kernel-features.h>
>> +#include <shlib-compat.h>
>> +
>> +/* 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 @@
>>     <http://www.gnu.org/licenses/>.  */
>>  
>>  #include <errno.h>
>> -#include <sys/resource.h>
>>  #include <sys/types.h>
>> -#include <sysdep.h>
>> -#include <kernel-features.h>
>> +#include <shlib-compat.h>
>> +
>> +/* 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.

      reply	other threads:[~2016-11-16 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 18:21 Adhemerval Zanella
2016-11-16 12:11 ` Adhemerval Zanella
2016-11-16 14:19 ` Andreas Schwab
2016-11-16 14:39   ` Adhemerval Zanella [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e51428a-eb0e-490b-f3ac-79c4cfd9d734@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).