From patchwork Fri Dec 13 02:41:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1208940 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108041-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="r+yCdCyE"; dkim-atps=neutral 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 47Yw0w5dp1z9sPL for ; Fri, 13 Dec 2019 13:41:52 +1100 (AEDT) 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:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=k0Z 5V30bGGsgQRuYEtkRzK2cRuaDuZbn9oerZ1RNj0dzaD4hJIQ0wuBZfLIabSMWgG5 AE1V1/3oeCCJfxnzcjKUugOEbEDF/X7PLITQmkgavQGkAOEhh44FJPNtO8hvqwFP ZSmJj9pslmXqIGxj7/JZkPPCZ8fbZ96/OnScxxTI= 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:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=b+xxAU//y iRx5CVu70bLwL+N2vA=; b=r+yCdCyETxrkb2WBoZgbScqE6OMxrPpbF8oA+1ErP urzFnHxsDqySecawMzOWGtTMIMu+5jqeWSPZ9dgFw2aDbm0ekM1GjZ+L5T69BWBM dagRekD65OOU6jCWaLsOFjbFP3b9PcEg3yhQW21sY8qBHyflYwgVrFORKE6qt5tV mc= Received: (qmail 28934 invoked by alias); 13 Dec 2019 02:41:45 -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 28925 invoked by uid 89); 13 Dec 2019 02:41:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Fix __close_nocancel_nostatus availability Date: Fri, 13 Dec 2019 03:41:40 +0100 Message-Id: <20191213024140.186593-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Not only libc/rtld use __close_nocancel_nostatus. * sysdeps/mach/hurd/Makefile [$(subdir) == io] (sysdep_routines): Add close_nocancel_nostatus. * sysdeps/mach/hurd/Versions (libc): Add __close_nocancel_nostatus to GLIBC_PRIVATE. * sysdeps/mach/hurd/not-cancel.h (__close_nocancel_nostatus): Declare function instead of defining inline. [IS_IN (libc) || IS_IN (rtld)] (__close_nocancel_nostatus): Make function hidden. * sysdeps/mach/hurd/close_nocancel_nostatus.c: New file. --- sysdeps/mach/hurd/Makefile | 2 +- sysdeps/mach/hurd/Versions | 1 + sysdeps/mach/hurd/close_nocancel_nostatus.c | 30 +++++++++++++++++++++ sysdeps/mach/hurd/not-cancel.h | 10 +++---- 4 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 sysdeps/mach/hurd/close_nocancel_nostatus.c diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile index 0ae65291d3..6b48d8f843 100644 --- a/sysdeps/mach/hurd/Makefile +++ b/sysdeps/mach/hurd/Makefile @@ -196,7 +196,7 @@ sysdep_routines += cthreads endif ifeq (io, $(subdir)) -sysdep_routines += f_setlk +sysdep_routines += f_setlk close_nocancel_nostatus endif ifeq ($(subdir),sunrpc) diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions index 9dee71efa3..6ddd2977f6 100644 --- a/sysdeps/mach/hurd/Versions +++ b/sysdeps/mach/hurd/Versions @@ -13,6 +13,7 @@ libc { __libc_lock_self0; __sigprocmask; __getcwd; _dl_init_first; + __close_nocancel_nostatus; } } diff --git a/sysdeps/mach/hurd/close_nocancel_nostatus.c b/sysdeps/mach/hurd/close_nocancel_nostatus.c new file mode 100644 index 0000000000..0c7c8acfba --- /dev/null +++ b/sysdeps/mach/hurd/close_nocancel_nostatus.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1991-2019 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 + +/* Close the file descriptor FD. */ +void +__close_nocancel_nostatus (int fd) +{ + HURD_FD_USE (fd, _hurd_fd_close (descriptor)); +} +libc_hidden_def (__close_nocancel_nostatus) diff --git a/sysdeps/mach/hurd/not-cancel.h b/sysdeps/mach/hurd/not-cancel.h index b78870a5b7..c9a67c199d 100644 --- a/sysdeps/mach/hurd/not-cancel.h +++ b/sysdeps/mach/hurd/not-cancel.h @@ -40,11 +40,7 @@ #define __close_nocancel(fd) \ __close (fd) -static inline void -__close_nocancel_nostatus (int fd) -{ - HURD_FD_USE (fd, _hurd_fd_close (descriptor)); -} +void __close_nocancel_nostatus (int fd); #define __read_nocancel(fd, buf, n) \ __read (fd, buf, n) @@ -59,4 +55,8 @@ __close_nocancel_nostatus (int fd) #define __fcntl64_nocancel(fd, cmd, ...) \ __fcntl64 (fd, cmd, __VA_ARGS__) +#if IS_IN (libc) || IS_IN (rtld) +hidden_proto (__close_nocancel_nostatus) +#endif + #endif /* NOT_CANCEL_H */