summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-05-20 16:54:13 +0800
committerPo Lu <luangruo@yahoo.com>2023-05-20 16:54:13 +0800
commitd86643a7863cef268b69d7925e0982bdb70ba672 (patch)
treef6f7edab475f13225d1691fcc58dd74e1915a6cd /exec
parent181453285c67783ebf8eb269dc19fdb0e563af62 (diff)
downloademacs-d86643a7863cef268b69d7925e0982bdb70ba672.tar.gz
Remove arbitrary process count limit
* exec/trace.c (handle_clone_prepare): (handle_clone): When !REENTRANT, use malloc to allocate tracees after running out of static ones.
Diffstat (limited to 'exec')
-rw-r--r--exec/trace.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/exec/trace.c b/exec/trace.c
index 974df1dd5e1..23db8ebcbc7 100644
--- a/exec/trace.c
+++ b/exec/trace.c
@@ -456,6 +456,12 @@ handle_clone_prepare (struct exec_tracee *parent)
tracee = &static_tracees[tracees];
tracees++;
}
+#ifndef REENTRANT
+ /* Try to allocate a tracee using `malloc' if this library is
+ not being built to run inside a signal handler. */
+ else if ((tracee = malloc (sizeof *tracee)))
+ ;
+#endif /* REENTRANT */
else
return;
@@ -506,6 +512,12 @@ handle_clone (struct exec_tracee *tracee, pid_t pid)
tracee = &static_tracees[tracees];
tracees++;
}
+#ifndef REENTRANT
+ /* Try to allocate a tracee using `malloc' if this library is
+ not being built to run inside a signal handler. */
+ else if ((tracee = malloc (sizeof *tracee)))
+ ;
+#endif /* REENTRANT */
else
return 1;