[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/16] libtrivfs: register libtrivfs-based translators as importa
From: |
Justus Winter |
Subject: |
[PATCH 10/16] libtrivfs: register libtrivfs-based translators as important |
Date: |
Mon, 5 Aug 2013 12:06:34 +0200 |
Register libtrivfs-based translators running as root as important
processes at the proc server.
* libtrivfs/startup.c (trivfs_startup): Mark us as important.
---
libtrivfs/startup.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/libtrivfs/startup.c b/libtrivfs/startup.c
index 86b0f82..e7be67a 100644
--- a/libtrivfs/startup.c
+++ b/libtrivfs/startup.c
@@ -65,5 +65,24 @@ trivfs_startup(mach_port_t bootstrap, int flags,
if (!err && control)
*control = fsys;
+ /* Mark us as important. */
+ if (! err)
+ {
+ mach_port_t proc = getproc ();
+ if (proc == MACH_PORT_NULL)
+ /* /hurd/exec uses libtrivfs. We have no handle to the proc
+ server in /hurd/exec when it does its handshake with the
+ root filesystem, so fail graciously here. */
+ return 0;
+
+ err = proc_mark_important (proc);
+ /* This might fail due to permissions, ignore any such
+ errors. */
+ if (err == EPERM)
+ err = 0;
+
+ mach_port_deallocate (mach_task_self (), proc);
+ }
+
return err;
}
--
1.7.10.4
- Make sysvinit pid 1, fix killall5, Justus Winter, 2013/08/05
- [PATCH 02/16] Define and use symbolic names for important processes, Justus Winter, 2013/08/05
- [PATCH 01/16] hurd: add missing routines in process_reply.defs, Justus Winter, 2013/08/05
- [PATCH 04/16] proc: make the function check_owner available, Justus Winter, 2013/08/05
- [PATCH 03/16] Add proc_set_init_task, make runsystem pid 1, Justus Winter, 2013/08/05
- [PATCH 05/16] proc: add proc_mark_important server code, Justus Winter, 2013/08/05
- [PATCH 06/16] hurd: add proc_mark_important, Justus Winter, 2013/08/05
- [PATCH 07/16] init: Mark all of inits children and init itself as important, Justus Winter, 2013/08/05
- [PATCH 08/16] libdiskfs: register libdiskfs-based translators as important, Justus Winter, 2013/08/05
- [PATCH 09/16] libnetfs: register libnetfs-based translators as important, Justus Winter, 2013/08/05
- [PATCH 10/16] libtrivfs: register libtrivfs-based translators as important,
Justus Winter <=
- [PATCH 11/16] mach-defpager: register mach-defpager translators as important, Justus Winter, 2013/08/05
- [PATCH 12/16] trans: register symlink translators as important, Justus Winter, 2013/08/05
- [PATCH 13/16] proc: keep track of {start,end}_code, Justus Winter, 2013/08/05
- [PATCH 14/16] hurd: add proc_{get,set}_code, Justus Winter, 2013/08/05
- [PATCH 15/16] exec: keep track of the range where executable segments are mapped, Justus Winter, 2013/08/05
- [PATCH 16/16] Build fixes: Build processUser.o and link against it, Justus Winter, 2013/08/05
- [PATCH] Make start_code and end_code available in /proc/*/stat, Justus Winter, 2013/08/05