Added child utcb initialisation to fork call implementation in libposix.

This commit is contained in:
Bahadir Balban
2008-08-22 00:26:19 +03:00
parent 1d15821acb
commit 1a90b655c7
3 changed files with 9 additions and 3 deletions

View File

@@ -7,4 +7,6 @@
#include <l4lib/types.h> #include <l4lib/types.h>
#include <l4lib/arch/utcb.h> #include <l4lib/arch/utcb.h>
int utcb_init(void);
#endif /* __UTCB_H__ */ #endif /* __UTCB_H__ */

View File

@@ -75,7 +75,8 @@ static void *l4_utcb_page(void)
/* /*
* Initialises a non-pager task's shared memory utcb page * Initialises a non-pager task's shared memory utcb page
* using posix semantics. * using posix semantics. Used during task initialisation
* and by child tasks after a fork.
*/ */
int utcb_init(void) int utcb_init(void)
{ {

View File

@@ -39,8 +39,11 @@ int fork(void)
errno = -ret; errno = -ret;
return -1; return -1;
} }
/* else return value */
return ret;
/* If we're a child, we need to initialise the utcb page */
if (ret == 0)
utcb_init();
return ret;
} }