From f1505f3dc03218cce46c278dbd6fffc2b3809bd7 Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sun, 11 Apr 2021 23:18:15 +0200
Subject: Call _hurd_libc_proc_init when available

glibc 2.33 separated out _hurd_libc_proc_init from _hurd_init, so we
have to additionally call it.

* configure.ac (_hurd_libc_proc_init): Detect function.
* libdiskfs/boot-start.c (diskfs_S_fsys_init): Call
_hurd_libc_proc_init.
* libmachdev/trivfs_server.c (trivfs_S_fsys_init): Call
_hurd_libc_proc_init.
---
 configure.ac               | 1 +
 libdiskfs/boot-start.c     | 3 +++
 libmachdev/trivfs_server.c | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 6dbb97e6..182548f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,7 @@ AC_CACHE_CHECK([for libio],
 
 # Check if libc contains these functions.
 AC_CHECK_FUNCS(file_exec_paths exec_exec_paths _hurd_exec_paths)
+AC_CHECK_FUNCS(_hurd_libc_proc_init)
 
 # Compatibility with glibc < 2.28
 AC_CHECK_FUNCS(file_futimens)
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index fa59e1b2..0ae90144 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -634,6 +634,9 @@ diskfs_S_fsys_init (struct diskfs_control *pt,
       portarray[INIT_PORT_CRDIR] = root_pt;
       portarray[INIT_PORT_CWDIR] = root_pt;
       _hurd_init (0, diskfs_argv, portarray, INIT_PORT_MAX, NULL, 0);
+#ifdef HAVE__HURD_LIBC_PROC_INIT
+      _hurd_libc_proc_init(diskfs_argv);
+#endif
     }
 
   err = get_privileged_ports (&host, 0);
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index 4d9b415d..833bfbff 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -318,6 +318,9 @@ trivfs_S_fsys_init (struct trivfs_control *fsys,
   portarray[INIT_PORT_CRDIR] = root;
   portarray[INIT_PORT_CWDIR] = root;
   _hurd_init (0, machdev_argv, portarray, INIT_PORT_MAX, NULL, 0);
+#ifdef HAVE__HURD_LIBC_PROC_INIT
+  _hurd_libc_proc_init(diskfs_argv);
+#endif
 
   /* Mark us as important.  */
   proc = getproc ();
-- 
cgit v1.2.3