From patchwork Sun Feb 1 20:33:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Michael X-Patchwork-Id: 4865 Received: (qmail 11551 invoked by alias); 1 Feb 2015 20:33:44 -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 11531 invoked by uid 89); 1 Feb 2015 20:33:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f50.google.com X-Received: by 10.224.20.198 with SMTP id g6mr649879qab.89.1422822819953; Sun, 01 Feb 2015 12:33:39 -0800 (PST) From: David Michael To: libc-alpha@sourceware.org Cc: bug-hurd@gnu.org Subject: [PATCH] hurd: Get a startup server port from a file instead of a PID Date: Sun, 01 Feb 2015 15:33:37 -0500 Message-ID: <87d25tbcda.fsf@gmail.com> MIME-Version: 1.0 To allow easier implementation of different init systems, Hurd no longer requires PID 1 to speak the startup protocol. Ports to the startup server are now obtained from /servers/startup instead. --- Hi, This patch has been included in Hurd's glibc branch and Debian's libc for a while, and we'd like to have it applied upstream. I haven't submitted copyright assignment papers for glibc, but I don't believe this change is legally significant. Let me know if I need to take care of copyright assignment for this. Thanks. David ChangeLog | 6 ++++++ sysdeps/mach/hurd/reboot.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50e8153..9b0b580 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-02-01 David Michael + + * sysdeps/mach/hurd/reboot.c: Include . + (reboot): Look up the file _SERVERS_STARTUP instead of PID 1 to get a + port to the startup server. + 2015-01-31 David S. Miller * sysdeps/sparc/sparc32/bits/atomic.h diff --git a/sysdeps/mach/hurd/reboot.c b/sysdeps/mach/hurd/reboot.c index 654745b..cb59a2b 100644 --- a/sysdeps/mach/hurd/reboot.c +++ b/sysdeps/mach/hurd/reboot.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -33,8 +34,8 @@ reboot (int howto) if (err) return __hurd_fail (EPERM); - err = __USEPORT (PROC, __proc_getmsgport (port, 1, &init)); - if (!err) + init = __file_name_lookup (_SERVERS_STARTUP, 0, 0); + if (init != MACH_PORT_NULL) { err = __startup_reboot (init, hostpriv, howto); __mach_port_deallocate (__mach_task_self (), init);