From patchwork Mon May 8 15:26:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 98826 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1382834qge; Mon, 8 May 2017 08:27:15 -0700 (PDT) X-Received: by 10.99.136.65 with SMTP id l62mr19121279pgd.151.1494257235919; Mon, 08 May 2017 08:27:15 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u73si10213210pgc.248.2017.05.08.08.27.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 May 2017 08:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-79115-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79115-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79115-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=QJCBVC5EiOc1XbrT+wY73t1Jri45rDj01YyjRikdsIb+nZmlcW/HC gAEXRbkcZk5/JFy+WI7kR6P/qMxdIw2F8YcinG70iL8WUxs7s6JVgTKj+E9IY1k/ CN1j1Ih+e11VxFad3j5IOC3tuEktjLvvTe1ZNodlCYOSglXZJQnsdk= 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:from:to:subject:date:message-id; s=default; bh=GdbGEyJx/VZHS8VvgXYE9srQmzQ=; b=IkLgUTr2ugo0tUca1F0jnsKMfPzQ v35oPEuAWqCkoIZzzEE6XvgddEZyTFJCIiyHtVu9uaZYF1Ob/5OqbxqNWVwccAcC oTmhxC8egXQIvGfnBLMDbZb4Ou74UZ8oRlimH9SUgDJcL7nPQ1Swz7IqoFdFxlyf SqzlHuY+u4PfAKM= Received: (qmail 52428 invoked by alias); 8 May 2017 15:27:01 -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 52085 invoked by uid 89); 8 May 2017 15:27:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=P2jZfDgMszxeWlGxt7nRSZ/xEIJtTg5euOyzOo9xCNo=; b=qAGwE8KLDn//q1PGIjM7dNQUzCyQSkQLGJxzhI5LcFZRLmOMFpFQ+y/ZLJdyGyhUs0 u1ZvFCuI/IkP0iPPwn/HsaURx5pS+zWqr16H9PZRgpvdQh4XjGQdGwiaDrPpilKANvya mBH58gsK2VjtHKIF1S+REoKDBWVbVIxtseRToCvRa0gn/sB/bLeHQLXKx6QA3hS2uk0P Fc/GHmdyfKjNr0n76HyHxUet7WSPnOMgl8uWN/XoGKPxc5S9g2H+Yr/+k2+BbX1jHOJy xdiWLauJxu3CmspR18yp78RINAgaZHf9de2WuX2/l2eXqgjEKcrTITyc1WgGKf45e7eM LY5g== X-Gm-Message-State: AN3rC/7Raca4bnUEm/Dt2R+ml66Oy265bC4DyxN+/kHBNOqhKMMQpf+Z 3/WfYjm2v/IyY4D1Sp2CXA== X-Received: by 10.55.19.86 with SMTP id d83mr26990440qkh.196.1494257219350; Mon, 08 May 2017 08:26:59 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/8] Consolidate Linux close syscall generation Date: Mon, 8 May 2017 12:26:45 -0300 Message-Id: <1494257212-524-1-git-send-email-adhemerval.zanella@linaro.org> This patch consolidates the close Linux syscall generation on sysdeps/unix/sysv/linux/close.c. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * nptl/Makefile (CFLAGS-close.c): New flag. * sysdeps/unix/sysv/linux/close.c: New file. --- ChangeLog | 5 +++++ nptl/Makefile | 1 + sysdeps/unix/sysv/linux/close.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/close.c -- 2.7.4 diff --git a/nptl/Makefile b/nptl/Makefile index 6d48c0c..8251ac4 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -213,6 +213,7 @@ CFLAGS-connect.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-recvfrom.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-recvmsg.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-sendmsg.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-close.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pt-system.c = -fexceptions diff --git a/sysdeps/unix/sysv/linux/close.c b/sysdeps/unix/sysv/linux/close.c new file mode 100644 index 0000000..1ac71ce --- /dev/null +++ b/sysdeps/unix/sysv/linux/close.c @@ -0,0 +1,30 @@ +/* Linux close syscall implementation. + Copyright (C) 2017 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 + +/* Close the file descriptor FD. */ +int +__close (int fd) +{ + return SYSCALL_CANCEL (close, fd); +} +libc_hidden_def (__close) +strong_alias (__close, __libc_close) +weak_alias (__close, close)