xref: /haiku/headers/private/system/user_runtime.h (revision b30304acc8c37e678a1bf66976d15bdab103f931)
1 /*
2  * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2002, Manuel J. Petit. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef KERNEL_USER_RUNTIME_H_
9 #define KERNEL_USER_RUNTIME_H_
10 
11 
12 #include <image.h>
13 #include <OS.h>
14 
15 
16 #define MAGIC_APP_NAME	"_APP_"
17 
18 struct user_space_program_args {
19 	char	program_name[B_OS_NAME_LENGTH];
20 	char	program_path[B_PATH_NAME_LENGTH];
21 	port_id	error_port;
22 	uint32	error_token;
23 	int		arg_count;
24 	int		env_count;
25 	char	**args;
26 	char	**env;
27 };
28 
29 struct rld_export {
30 	// runtime linker API export
31 	image_id (*load_add_on)(char const *path, uint32 flags);
32 	status_t (*unload_add_on)(image_id imageID);
33 	status_t (*get_image_symbol)(image_id imageID, char const *symbolName,
34 		int32 symbolType, void **_location);
35 	status_t (*get_nth_image_symbol)(image_id imageID, int32 num, char *symbolName,
36 		int32 *nameLength, int32 *symbolType, void **_location);
37 	status_t (*test_executable)(const char *path, char *interpreter);
38 	status_t (*get_next_image_dependency)(image_id id, uint32 *cookie,
39 		const char **_name);
40 
41 	status_t (*reinit_after_fork)();
42 
43 	void (*call_atexit_hooks_for_range)(addr_t start, addr_t size);
44 
45 	const struct user_space_program_args *program_args;
46 };
47 
48 extern struct rld_export *__gRuntimeLoader;
49 
50 #endif	/* KERNEL_USER_RUNTIME_H_ */
51