Assorted whitespace cleanup and typo fixes.
[haiku.git] / src / system / libroot / posix / stdlib / atfork.c
blob1ddc6eff10d19b12e95b405217e1d0b2907bda32
1 /*
2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
7 #include <fork.h>
9 #include <stdlib.h>
10 #include <errno.h>
12 #include <errno_private.h>
15 /** This is the BeOS compatible atfork() function; since it's not part of POSIX,
16 * it should probably go away over time.
17 * Use pthread_atfork() instead.
20 int
21 atfork(void (*function)(void))
23 status_t status = __register_atfork(NULL, NULL, function);
24 if (status < B_OK) {
25 __set_errno(status);
26 return -1;
29 return 0;