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 X-Patchwork-Id: 20302 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 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)