diff --git a/headers/private/libroot/libroot_private.h b/headers/private/libroot/libroot_private.h index 6416ae9154..eef754d777 100644 --- a/headers/private/libroot/libroot_private.h +++ b/headers/private/libroot/libroot_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #ifndef LIBROOT_PRIVATE_H @@ -29,6 +29,8 @@ status_t __test_executable(const char *path, char *invoker); status_t __flatten_process_args(const char* const* args, int32 argCount, const char* const* env, int32 envCount, char*** _flatArgs, size_t* _flatSize); +void _call_atexit_hooks_for_range(addr_t start, addr_t size); +void __init_exit_stack_lock(void); void __init_env(const struct user_space_program_args *args); void __init_heap(void); diff --git a/src/system/libroot/libroot_init.c b/src/system/libroot/libroot_init.c index 20faa1fdd9..01eceb8198 100644 --- a/src/system/libroot/libroot_init.c +++ b/src/system/libroot/libroot_init.c @@ -1,8 +1,9 @@ /* - * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2009, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ + #include #include @@ -13,8 +14,6 @@ void initialize_before(image_id imageID); -void _call_atexit_hooks_for_range(addr_t start, addr_t size); -void __init_exit_stack_lock(); struct rld_export *__gRuntimeLoader = NULL; // This little bugger is set to something meaningful by the runtime loader diff --git a/src/system/libroot/posix/stdlib/exit.c b/src/system/libroot/posix/stdlib/exit.c index dbe699c522..40873ea45e 100644 --- a/src/system/libroot/posix/stdlib/exit.c +++ b/src/system/libroot/posix/stdlib/exit.c @@ -1,5 +1,5 @@ /* - * Copyright 2004, Haiku Inc. All rights reserved. + * Copyright 2004-2009, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Author(s): @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -35,15 +36,6 @@ struct exit_stack_info { static struct exit_stack_info sExitStackInfo = { {}, 0, -1, 0, -1, 0 }; -void -__init_exit_stack_lock() -{ - sExitStackInfo.lock = create_sem(0, "exit stack lock"); - if (sExitStackInfo.lock < 0) - debugger("failed to create exit stack lock"); -} - - static void _exit_stack_lock() { @@ -73,6 +65,9 @@ _exit_stack_unlock() } +// #pragma mark - private API + + void _call_atexit_hooks_for_range(addr_t start, addr_t size) { @@ -105,6 +100,18 @@ _call_atexit_hooks_for_range(addr_t start, addr_t size) } +void +__init_exit_stack_lock(void) +{ + sExitStackInfo.lock = create_sem(0, "exit stack lock"); + if (sExitStackInfo.lock < 0) + debugger("failed to create exit stack lock"); +} + + +// #pragma mark - public API + + void abort() {