diff --git a/src/kernel/libroot/posix/stdlib/Jamfile b/src/kernel/libroot/posix/stdlib/Jamfile index 49546af0e8..cf11b211ac 100644 --- a/src/kernel/libroot/posix/stdlib/Jamfile +++ b/src/kernel/libroot/posix/stdlib/Jamfile @@ -1,7 +1,10 @@ SubDir OBOS_TOP src kernel libroot posix stdlib ; +UsePrivateHeaders libroot ; + KernelMergeObject posix_stdlib.o : abs.c + atfork.c atof.c atoi.c bsearch.c diff --git a/src/kernel/libroot/posix/stdlib/atfork.c b/src/kernel/libroot/posix/stdlib/atfork.c new file mode 100644 index 0000000000..66a699c8a2 --- /dev/null +++ b/src/kernel/libroot/posix/stdlib/atfork.c @@ -0,0 +1,29 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include + +#include +#include + + +/** This is the BeOS compatible atfork() function; since it's not part of POSIX, + * it should probably go away over time. + * Use pthread_atfork() instead. + */ + +int +atfork(void (*function)(void)) +{ + status_t status = __register_atfork(NULL, NULL, function); + if (status < B_OK) { + errno = status; + return -1; + } + + return 0; +} +