Various additions and fixes.
This commit is contained in:
parent
74f990ad84
commit
fd04aacee1
57 changed files with 2176 additions and 159 deletions
|
|
@ -1,26 +1 @@
|
|||
#include <lib9.h>
|
||||
#include <pthread.h>
|
||||
|
||||
extern int __isthreaded;
|
||||
int
|
||||
ffork(int flags, void(*fn)(void*), void *arg)
|
||||
{
|
||||
void *p;
|
||||
pthread_t tid;
|
||||
|
||||
if(flags != (RFMEM|RFNOWAIT)){
|
||||
werrstr("ffork unsupported");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(pthread_create(&tid, NULL, (void*(*)(void*))fn, arg) < 0)
|
||||
return -1;
|
||||
return (int)tid;
|
||||
}
|
||||
|
||||
int
|
||||
getfforkid(void)
|
||||
{
|
||||
return (int)pthread_self();
|
||||
}
|
||||
|
||||
#include "ffork-pthread.c"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue