summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-21 15:23:16 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-21 15:23:16 +0100
commitbeea9e5dfe5541ab568262ea38399298054cbf58 (patch)
tree2728629420936a1899102c9029e5029eeb5eb731
parentd36b0e1bf836ae3c7ee4ae670311389d5b22cc06 (diff)
update feature-proc-set-task-name-to-pid.patch
-rw-r--r--debian/patches/feature-proc-set-task-name-to-pid.patch112
1 files changed, 69 insertions, 43 deletions
diff --git a/debian/patches/feature-proc-set-task-name-to-pid.patch b/debian/patches/feature-proc-set-task-name-to-pid.patch
index 73506883..de57d61e 100644
--- a/debian/patches/feature-proc-set-task-name-to-pid.patch
+++ b/debian/patches/feature-proc-set-task-name-to-pid.patch
@@ -1,19 +1,60 @@
---- a/proc/Makefile
-+++ b/proc/Makefile
-@@ -29,7 +29,7 @@ MIGSFLAGS="-DPROCESS_INTRAN=pstruct_t reqport_find (process_t)" \
- "-DPROCESS_IMPORTS=import \"proc.h\";"
+diff --git a/exec/Makefile b/exec/Makefile
+index 3ef742d..a9ae914 100644
+--- a/exec/Makefile
++++ b/exec/Makefile
+@@ -22,7 +22,7 @@ makemode := server
- MIGSTUBS = processServer.o notifyServer.o \
-- ourmsgUser.o proc_excUser.o proc_excServer.o
-+ ourmsgUser.o proc_excUser.o proc_excServer.o gnumachUser.o
- OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
- HURDLIBS = ihash ports shouldbeinlibc
- OTHERLIBS = -lpthread
-diff --git a/proc/gnumach.defs b/proc/gnumach.defs
+ SRCS = exec.c main.c hashexec.c hostarch.c
+ OBJS = main.o hostarch.o exec.o hashexec.o \
+- execServer.o exec_startupServer.o
++ execServer.o exec_startupServer.o gnumachUser.o
+
+ target = exec
+ #targets = exec exec.static
+diff --git a/exec/exec.c b/exec/exec.c
+index fad9492..f045247 100644
+--- a/exec/exec.c
++++ b/exec/exec.c
+@@ -1151,14 +1151,28 @@ do_exec (file_t file,
+ }
+ boot->user_entry = e.entry; /* already adjusted in `load' */
+
+- /* Set the start_code and end_code values for this process.
+- /hurd/exec is used to start /hurd/proc, so at this point there is
++ /* /hurd/exec is used to start /hurd/proc, so at this point there is
+ no proc server, so we need to be careful here. */
+ if (boot->portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
+- e.error = proc_set_code (boot->portarray[INIT_PORT_PROC],
+- e.start_code, e.end_code);
+- if (e.error)
+- goto out;
++ {
++ /* Set the start_code and end_code values for this process. */
++ e.error = proc_set_code (boot->portarray[INIT_PORT_PROC],
++ e.start_code, e.end_code);
++ if (e.error)
++ goto out;
++
++ pid_t pid;
++ e.error = proc_task2pid (boot->portarray[INIT_PORT_PROC],
++ newtask, &pid);
++ if (e.error)
++ goto out;
++
++ char *name;
++ asprintf (&name, "%s(%d)", argv, pid);
++ if (name)
++ task_set_name (newtask, name);
++ free (name);
++ }
+
+ /* Create the initial thread. */
+ e.error = thread_create (newtask, &thread);
+diff --git a/exec/gnumach.defs b/exec/gnumach.defs
new file mode 100644
index 0000000..6cfbb0d
--- /dev/null
-+++ b/proc/gnumach.defs
++++ b/exec/gnumach.defs
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2012 Free Software Foundation
@@ -89,11 +130,11 @@ index 0000000..6cfbb0d
+simpleroutine task_set_name(
+ task : task_t;
+ name : kernel_debug_name_t);
-diff --git a/proc/mach_debug/hash_info.h b/proc/mach_debug/hash_info.h
+diff --git a/exec/mach_debug/hash_info.h b/exec/mach_debug/hash_info.h
new file mode 100644
index 0000000..6944277
--- /dev/null
-+++ b/proc/mach_debug/hash_info.h
++++ b/exec/mach_debug/hash_info.h
@@ -0,0 +1,41 @@
+/*
+ * Mach Operating System
@@ -136,11 +177,11 @@ index 0000000..6944277
+typedef hash_info_bucket_t *hash_info_bucket_array_t;
+
+#endif /* _MACH_DEBUG_HASH_INFO_H_ */
-diff --git a/proc/mach_debug/ipc_info.h b/proc/mach_debug/ipc_info.h
+diff --git a/exec/mach_debug/ipc_info.h b/exec/mach_debug/ipc_info.h
new file mode 100644
index 0000000..ef0b0c6
--- /dev/null
-+++ b/proc/mach_debug/ipc_info.h
++++ b/exec/mach_debug/ipc_info.h
@@ -0,0 +1,100 @@
+/*
+ * Mach Operating System
@@ -242,11 +283,11 @@ index 0000000..ef0b0c6
+#define IPC_INFO_TYPE_PAGING_NAME 12
+
+#endif /* _MACH_DEBUG_IPC_INFO_H_ */
-diff --git a/proc/mach_debug/mach_debug.defs b/proc/mach_debug/mach_debug.defs
+diff --git a/exec/mach_debug/mach_debug.defs b/exec/mach_debug/mach_debug.defs
new file mode 100644
index 0000000..053c3fe
--- /dev/null
-+++ b/proc/mach_debug/mach_debug.defs
++++ b/exec/mach_debug/mach_debug.defs
@@ -0,0 +1,233 @@
+/*
+ * Mach Operating System
@@ -481,11 +522,11 @@ index 0000000..053c3fe
+skip; /* mach_vm_object_info */
+skip; /* mach_vm_object_pages */
+#endif /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
-diff --git a/proc/mach_debug/mach_debug_types.defs b/proc/mach_debug/mach_debug_types.defs
+diff --git a/exec/mach_debug/mach_debug_types.defs b/exec/mach_debug/mach_debug_types.defs
new file mode 100644
index 0000000..d24b6f9
--- /dev/null
-+++ b/proc/mach_debug/mach_debug_types.defs
++++ b/exec/mach_debug/mach_debug_types.defs
@@ -0,0 +1,64 @@
+/*
+ * Mach Operating System
@@ -551,11 +592,11 @@ index 0000000..d24b6f9
+import <mach_debug/mach_debug_types.h>;
+
+#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_DEFS_ */
-diff --git a/proc/mach_debug/mach_debug_types.h b/proc/mach_debug/mach_debug_types.h
+diff --git a/exec/mach_debug/mach_debug_types.h b/exec/mach_debug/mach_debug_types.h
new file mode 100644
index 0000000..9c7d1fd
--- /dev/null
-+++ b/proc/mach_debug/mach_debug_types.h
++++ b/exec/mach_debug/mach_debug_types.h
@@ -0,0 +1,51 @@
+/*
+ * Mach Operating System
@@ -608,11 +649,11 @@ index 0000000..9c7d1fd
+typedef char kernel_debug_name_t[KERNEL_DEBUG_NAME_MAX];
+
+#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
-diff --git a/proc/mach_debug/pc_info.h b/proc/mach_debug/pc_info.h
+diff --git a/exec/mach_debug/pc_info.h b/exec/mach_debug/pc_info.h
new file mode 100644
index 0000000..bc43fa8
--- /dev/null
-+++ b/proc/mach_debug/pc_info.h
++++ b/exec/mach_debug/pc_info.h
@@ -0,0 +1,43 @@
+/*
+ * Permission to use, copy, modify and distribute this software and its
@@ -657,11 +698,11 @@ index 0000000..bc43fa8
+typedef unsigned int sampled_pc_seqno_t;
+
+#endif _MACH_DEBUG_PC_INFO_H_
-diff --git a/proc/mach_debug/slab_info.h b/proc/mach_debug/slab_info.h
+diff --git a/exec/mach_debug/slab_info.h b/exec/mach_debug/slab_info.h
new file mode 100644
index 0000000..37dcb8c
--- /dev/null
-+++ b/proc/mach_debug/slab_info.h
++++ b/exec/mach_debug/slab_info.h
@@ -0,0 +1,62 @@
+/*
+ * Mach Operating System
@@ -725,11 +766,11 @@ index 0000000..37dcb8c
+typedef cache_info_t *cache_info_array_t;
+
+#endif /* _MACH_DEBUG_SLAB_INFO_H_ */
-diff --git a/proc/mach_debug/vm_info.h b/proc/mach_debug/vm_info.h
+diff --git a/exec/mach_debug/vm_info.h b/exec/mach_debug/vm_info.h
new file mode 100644
index 0000000..70ba887
--- /dev/null
-+++ b/proc/mach_debug/vm_info.h
++++ b/exec/mach_debug/vm_info.h
@@ -0,0 +1,132 @@
+/*
+ * Mach Operating System
@@ -863,18 +904,3 @@ index 0000000..70ba887
+typedef vm_page_info_t *vm_page_info_array_t;
+
+#endif /* _MACH_DEBUG_VM_INFO_H_ */
-diff --git a/proc/mgt.c b/proc/mgt.c
-index 5e0accd..61a45a6 100644
---- a/proc/mgt.c
-+++ b/proc/mgt.c
-@@ -663,6 +663,10 @@ complete_proc (struct proc *p, pid_t pid)
-
- p->p_pid = pid;
-
-+ char name[20]; /* prefix + 10 digits + \0 */
-+ snprintf (name, sizeof name, "with pid %i", pid);
-+ task_set_name (p->p_task, name);
-+
- ids_ref (&nullids);
- p->p_id = &nullids;
-