diff options
| author | Russ Cox <rsc@swtch.com> | 2009-08-17 17:29:44 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@swtch.com> | 2009-08-17 17:29:44 -0700 |
| commit | 0829f75bba8a5eb60a7f46e21aa266736b4c4bab (patch) | |
| tree | c5966ec780f68a8ae0c9aec1932e5f4147fcd180 /src/libthread/thread.c | |
| parent | 5186b55afc97730b733a85cdcb38d6ee7fdd32c7 (diff) | |
libthread: make page work on OS X
Diffstat (limited to 'src/libthread/thread.c')
| -rw-r--r-- | src/libthread/thread.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |