libthread: make page work on OS X
This commit is contained in:
parent
5186b55afc
commit
0829f75bba
@ -62,6 +62,7 @@ _threadspawn(int fd[3], char *cmd, char *argv[])
|
|||||||
int i, n, p[2], pid;
|
int i, n, p[2], pid;
|
||||||
char exitstr[100];
|
char exitstr[100];
|
||||||
|
|
||||||
|
notifyoff("sys: child"); /* do not let child note kill us */
|
||||||
if(pipe(p) < 0)
|
if(pipe(p) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if(fcntl(p[0], F_SETFD, 1) < 0 || fcntl(p[1], F_SETFD, 1) < 0){
|
if(fcntl(p[0], F_SETFD, 1) < 0 || fcntl(p[1], F_SETFD, 1) < 0){
|
||||||
|
|||||||
@ -155,6 +155,10 @@ _threadcreate(Proc *p, void (*fn)(void*), void *arg, uint stack)
|
|||||||
{
|
{
|
||||||
_Thread *t;
|
_Thread *t;
|
||||||
|
|
||||||
|
/* defend against bad C libraries */
|
||||||
|
if(stack < (256<<10))
|
||||||
|
stack = 256<<10;
|
||||||
|
|
||||||
t = threadalloc(fn, arg, stack);
|
t = threadalloc(fn, arg, stack);
|
||||||
t->proc = p;
|
t->proc = p;
|
||||||
addthreadinproc(p, t);
|
addthreadinproc(p, t);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user