From patchwork Fri Sep 19 22:10:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 391420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 736BF1400A8 for ; Sat, 20 Sep 2014 08:10:47 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=dr6hVa39waJeBjiv8thu+fpw0pLxh cvvSo/oB49MNEEl7FqV73o93OF/GJ8k/IiFkJFp1Ovr5HK7BBzQrqvPNQeQI3373 fZ4P/p1tR2WwwkhERg1UYYmbnoSXtVnj4+NjKOpfRu0wqox2gIhvL0iKAxgA/Ygk 84eWUwWOehyheE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=4k4LGOVO/f+YOyrd33vzOunAq4A=; b=F3S bLaLmlscVhbHOKwXC6P3dlEiY1z3c/MFaxDcJ0/AwcP8eWuAoy9DKnHPWgf+4apH AYXmTkY/VunHqlOZdo/huBJHVd/UQPDkppq4dNnNRpO8Ivqo86wl7Zk11/dekgSF /u1aU/ApEhPhgLvasJg8hQGeQTDBQQYlbIsVC9JE= Received: (qmail 5997 invoked by alias); 19 Sep 2014 22:10:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 5980 invoked by uid 89); 19 Sep 2014 22:10:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 19 Sep 2014 22:10:25 +0000 From: "Joseph S. Myers" To: Subject: Move some setrlimit definitions to syscalls.list (bug 14138) Message-ID: MIME-Version: 1.0 Bug 14138 is followup cleanup after removal of support for old Linux kernel versions: moving syscalls to syscalls.list where the only reason for using C definitions was kernel version conditionals that are no longer present. This patch deals with the case of setrlimit (sysdeps/unix/sysv/linux/i386/setrlimit.c, included by various other architectures). Where needed (where there is also a compat symbol for setrlimit@GLIBC_2.0), new syscalls.list entries are added. Where not needed (where there is no such compat symbol and the minimum symbol version for libc is 2.2 or later), no such entries are added as that in sysdeps/unix/syscalls.list will suffice. Thus arm and sh need no such entries, while m68k and powerpc need entries only in a subdirectory syscalls.list file rather than for all configurations that previously used setrlimit.c. (setrlimit@@GLIBC_2.2 and setrlimit@GLIBC_2.0 are now semantically identical - the new symbol version was about a change of types from signed to unsigned and the former compatibility code for dealing with large unsigned arguments on old kernels is no longer needed or present, having been removed with support for pre-2.4 kernels. However, making the two versions into aliases doesn't work at present: the case of having both default and non-default symbol versions on the same syscalls.list line results in a compat_symbol call in code built for static libc, which doesn't compile. I don't suppose it would be hard to generate SHARED conditionals from make-syscalls.sh to fix this, but in any case this patch doesn't make things any worse, as the functions weren't aliases before the patch either.) Tested for x86, and ran ABI tests for ARM as an example of an architecture where the setrlimit.c file was just removed without adding syscalls.list entries. 2014-09-19 Joseph Myers [BZ #14138] * sysdeps/unix/sysv/linux/arm/setrlimit.c: Remove file. * sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/sh/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/syscalls.list (setrlimit): Add syscall entry for GLIBC_2.2 symbol version. * sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list (setrlimit): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (setrlimit): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (setrlimit): Likewise. diff --git a/sysdeps/unix/sysv/linux/arm/setrlimit.c b/sysdeps/unix/sysv/linux/arm/setrlimit.c deleted file mode 100644 index bfaef74..0000000 --- a/sysdeps/unix/sysv/linux/arm/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/i386/setrlimit.c b/sysdeps/unix/sysv/linux/i386/setrlimit.c deleted file mode 100644 index 2868d90..0000000 --- a/sysdeps/unix/sysv/linux/i386/setrlimit.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1999-2014 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 - . */ - -#include -#include -#include - -#include -#include -#include - -extern int __new_setrlimit (enum __rlimit_resource resource, - const struct rlimit *rlimits); - -/* Consider moving to syscalls.list. */ - -int -__new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits) -{ - return INLINE_SYSCALL (setrlimit, 2, resource, rlimits); -} - -weak_alias (__new_setrlimit, __setrlimit); -versioned_symbol (libc, __new_setrlimit, setrlimit, GLIBC_2_2); diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list index 149d432..8d94828 100644 --- a/sysdeps/unix/sysv/linux/i386/syscalls.list +++ b/sysdeps/unix/sysv/linux/i386/syscalls.list @@ -5,6 +5,7 @@ vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0 vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4 oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 +setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2 waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list b/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list index 913f051..6f10536 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list @@ -2,3 +2,4 @@ oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 +setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/m68k/setrlimit.c b/sysdeps/unix/sysv/linux/m68k/setrlimit.c deleted file mode 100644 index bfaef74..0000000 --- a/sysdeps/unix/sysv/linux/m68k/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list index aaa3557..fb6535a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list @@ -3,6 +3,7 @@ # System calls with wrappers. oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 +setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2 # Due to 64bit alignment there is a dummy second parameter readahead - readahead i:iiiii __readahead readahead diff --git a/sysdeps/unix/sysv/linux/powerpc/setrlimit.c b/sysdeps/unix/sysv/linux/powerpc/setrlimit.c deleted file mode 100644 index bfaef74..0000000 --- a/sysdeps/unix/sysv/linux/powerpc/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c b/sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c deleted file mode 100644 index bfaef74..0000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list index ce9f210..523bd2c 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list @@ -2,6 +2,7 @@ oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 +setrlimit - setrlimit i:ip __setrlimit setrlimit@@GLIBC_2.2 prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/sh/setrlimit.c b/sysdeps/unix/sysv/linux/sh/setrlimit.c deleted file mode 100644 index bfaef74..0000000 --- a/sysdeps/unix/sysv/linux/sh/setrlimit.c +++ /dev/null @@ -1 +0,0 @@ -#include