aboutsummaryrefslogtreecommitdiff
path: root/src/libthread
diff options
context:
space:
mode:
Diffstat (limited to 'src/libthread')
-rw-r--r--src/libthread/exec.c1
-rw-r--r--src/libthread/thread.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libthread/exec.c b/src/libthread/exec.c
index 3c71e4b1..1875eb98 100644
--- a/src/libthread/exec.c
+++ b/src/libthread/exec.c
@@ -62,6 +62,7 @@ _threadspawn(int fd[3], char *cmd, char *argv[])
int i, n, p[2], pid;
char exitstr[100];
+ notifyoff("sys: child"); /* do not let child note kill us */
if(pipe(p) < 0)
return -1;
if(fcntl(p[0], F_SETFD, 1) < 0 || fcntl(p[1], F_SETFD, 1) < 0){
diff --git a/src/libthread/thread.c b/src/libthread/thread.c
index 94910f2c..06230f53 100644
--- a/src/libthread/thread.c
+++ b/src/libthread/thread.c
@@ -155,6 +155,10 @@ _threadcreate(Proc *p, void (*fn)(void*), void *arg, uint stack)
{
_Thread *t;
+ /* defend against bad C libraries */
+ if(stack < (256<<10))
+ stack = 256<<10;
+
t = threadalloc(fn, arg, stack);
t->proc = p;
addthreadinproc(p, t);