aboutsummaryrefslogtreecommitdiffstats
path: root/guts
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-12-14 18:53:59 -0600
committerPeter Seebach <peter.seebach@windriver.com>2010-12-16 16:35:01 -0600
commit0eec00c99f7c7e25313caa97937a77383df8b0e8 (patch)
treeba0949af819971ddadba24dbcff39307842ce297 /guts
parenteba97c46608e776088a86d9d8db25d07e8de09ac (diff)
downloadpseudo-0eec00c99f7c7e25313caa97937a77383df8b0e8.tar.gz
pseudo-0eec00c99f7c7e25313caa97937a77383df8b0e8.tar.bz2
pseudo-0eec00c99f7c7e25313caa97937a77383df8b0e8.zip
Restructure wrapfuncs.c
Restructure wrapfuncs.c in an attempt to improve PSEUDO_DISABLED=1 performance. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'guts')
-rw-r--r--guts/clone.c20
-rw-r--r--guts/fork.c27
2 files changed, 18 insertions, 29 deletions
diff --git a/guts/clone.c b/guts/clone.c
index 8299c54..b3400c7 100644
--- a/guts/clone.c
+++ b/guts/clone.c
@@ -12,21 +12,15 @@
* undo it later. UGH!
*/
pseudo_debug(1, "client resetting for clone(2) call\n");
- if (real_clone) {
- if (!pseudo_get_value("PSEUDO_RELOADED")) {
- pseudo_setupenv();
- pseudo_reinit_libpseudo();
- } else {
- pseudo_setupenv();
- pseudo_dropenv();
- }
- /* call the real syscall */
- rc = (*real_clone)(fn, child_stack, flags, arg, pid, tls, ctid);
+ if (!pseudo_get_value("PSEUDO_RELOADED")) {
+ pseudo_setupenv();
+ pseudo_reinit_libpseudo();
} else {
- /* rc was initialized to the "failure" value */
- pseudo_enosys("clone");
+ pseudo_setupenv();
+ pseudo_dropenv();
}
-
+ /* call the real syscall */
+ rc = (*real_clone)(fn, child_stack, flags, arg, pid, tls, ctid);
/* ...
* return rc;
* }
diff --git a/guts/fork.c b/guts/fork.c
index b7fd239..76cac6f 100644
--- a/guts/fork.c
+++ b/guts/fork.c
@@ -6,23 +6,18 @@
* wrap_fork(void) {
* int rc = -1;
*/
- if (real_fork) {
- rc = real_fork();
- /* special case: we may want to enable or disable
- * pseudo in the child process
- */
- if (rc == 0) {
- if (!pseudo_get_value("PSEUDO_RELOADED")) {
- pseudo_setupenv();
- pseudo_reinit_libpseudo();
- } else {
- pseudo_setupenv();
- pseudo_dropenv();
- }
+ rc = real_fork();
+ /* special case: we may want to enable or disable
+ * pseudo in the child process
+ */
+ if (rc == 0) {
+ if (!pseudo_get_value("PSEUDO_RELOADED")) {
+ pseudo_setupenv();
+ pseudo_reinit_libpseudo();
+ } else {
+ pseudo_setupenv();
+ pseudo_dropenv();
}
- } else {
- /* rc was initialized to the "failure" value */
- pseudo_enosys("fork");
}
/* return rc;
* }