public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Fix __close_nocancel_nostatus availability
@ 2019-12-13  2:41 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2019-12-13  2:41 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=186e119bbd4a10895429ffe405ae96dc5c5634b8

commit 186e119bbd4a10895429ffe405ae96dc5c5634b8
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Fri Dec 13 03:32:21 2019 +0100

    hurd: Fix __close_nocancel_nostatus availability
    
    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.

Diff:
---
 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(-)

diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 0ae6529..6b48d8f 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 9dee71e..6ddd297 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 0000000..0c7c8ac
--- /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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <unistd.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+#include <not-cancel.h>
+
+/* 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 b78870a..c9a67c1 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  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-13  2:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13  2:41 [glibc] hurd: Fix __close_nocancel_nostatus availability Samuel Thibault

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).