[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 46/70: proc: keep track of {start,end}_code
From: |
Samuel Thibault |
Subject: |
[hurd] 46/70: proc: keep track of {start,end}_code |
Date: |
Mon, 16 Sep 2013 07:41:43 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit c62a440d866ccd8259b408ec59a2c16069e0ce0c
Author: Justus Winter <address@hidden>
Date: Thu Aug 15 09:38:04 2013 +0200
proc: keep track of {start,end}_code
Any executable segments loaded from the ELF binary are in this range.
* proc/proc.h (struct proc): Add {start,end}_code.
* proc/mgt.h (S_proc_set_code): New function.
* proc/mgt.h (S_proc_get_code): New function.
---
proc/mgt.c | 39 +++++++++++++++++++++++++++++++++++++++
proc/proc.h | 2 ++
2 files changed, 41 insertions(+)
diff --git a/proc/mgt.c b/proc/mgt.c
index 6a10e91..c093b8f 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -210,6 +210,15 @@ S_proc_child (struct proc *parentp,
childp->p_parent->p_pid, childp->p_pgrp->pg_pgid,
!childp->p_pgrp->pg_orphcnt);
childp->p_parentset = 1;
+
+ /* If these are not set in the child, it was probably fork(2)ed. If
+ so, it inherits the values of its parent. */
+ if (! childp->start_code && ! childp->end_code)
+ {
+ childp->start_code = parentp->start_code;
+ childp->end_code = parentp->end_code;
+ }
+
return 0;
}
@@ -903,3 +912,33 @@ S_proc_is_important (struct proc *callerp,
return 0;
}
+
+/* Implement proc_set_code as described in <hurd/process.defs>. */
+error_t
+S_proc_set_code (struct proc *callerp,
+ vm_address_t start_code,
+ vm_address_t end_code)
+{
+ if (!callerp)
+ return EOPNOTSUPP;
+
+ callerp->start_code = start_code;
+ callerp->end_code = end_code;
+
+ return 0;
+}
+
+/* Implement proc_get_code as described in <hurd/process.defs>. */
+error_t
+S_proc_get_code (struct proc *callerp,
+ vm_address_t *start_code,
+ vm_address_t *end_code)
+{
+ if (!callerp)
+ return EOPNOTSUPP;
+
+ *start_code = callerp->start_code;
+ *end_code = callerp->end_code;
+
+ return 0;
+}
diff --git a/proc/proc.h b/proc/proc.h
index ed47ccc..f846b37 100644
--- a/proc/proc.h
+++ b/proc/proc.h
@@ -64,6 +64,8 @@ struct proc
/* Miscellaneous information */
vm_address_t p_argv, p_envp;
+ vm_address_t start_code; /* all executable segments are in this range */
+ vm_address_t end_code;
int p_status; /* to return via wait */
int p_sigcode;
struct rusage p_rusage; /* my usage if I'm dead, to return via wait */
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 27/70: daemons: fix setsid(2) in console-run, (continued)
- [hurd] 27/70: daemons: fix setsid(2) in console-run, Samuel Thibault, 2013/09/16
- [hurd] 14/70: Optimize translator string copy, Samuel Thibault, 2013/09/16
- [hurd] 13/70: libnetfs: properly respond to file_get_translator requests, Samuel Thibault, 2013/09/16
- [hurd] 23/70: Do not build gzip/bzip2 support, Samuel Thibault, 2013/09/16
- [hurd] 38/70: libdiskfs: register libdiskfs-based translators as important, Samuel Thibault, 2013/09/16
- [hurd] 34/70: proc: make the function check_owner available, Samuel Thibault, 2013/09/16
- [hurd] 24/70: exec: Remove #ifdef 0-out code for user specified exec servers., Samuel Thibault, 2013/09/16
- [hurd] 40/70: libtrivfs: register libtrivfs-based translators as important, Samuel Thibault, 2013/09/16
- [hurd] 36/70: hurd: add proc_mark_important, Samuel Thibault, 2013/09/16
- [hurd] 43/70: Fix build, Samuel Thibault, 2013/09/16
- [hurd] 46/70: proc: keep track of {start,end}_code,
Samuel Thibault <=
- [hurd] 45/70: Fix variable names, Samuel Thibault, 2013/09/16
- [hurd] 25/70: exec: remove the BFD code, Samuel Thibault, 2013/09/16
- [hurd] 26/70: hurd: add missing routines in process_reply.defs, Samuel Thibault, 2013/09/16
- [hurd] 63/70: trans/symlink.c: add fsys_get_source, Samuel Thibault, 2013/09/16
- [hurd] 60/70: libdiskfs: add fsys_get_source, Samuel Thibault, 2013/09/16
- [hurd] 56/70: libnetfs: add fsys_get_children, Samuel Thibault, 2013/09/16
- [hurd] 41/70: mach-defpager: register mach-defpager translators as important, Samuel Thibault, 2013/09/16
- [hurd] 62/70: libtrivfs: add fsys_get_source, Samuel Thibault, 2013/09/16
- [hurd] 66/70: exec: remove support for transparently unbzip2ing executables, Samuel Thibault, 2013/09/16
- [hurd] 58/70: trans/symlink.c: add fsys_get_children, Samuel Thibault, 2013/09/16