* Added a mechanism to retrieve a BMessage with eventual error descriptions

for _kern_load_image().
* Added KMessage to the runtime_loader (a bit hacky, though) - it will use
  it to deliver the above mentioned functionality.
* load_dependencies() did return the wrong status code in case a library
  was missing; now it returns B_MISSING_LIBRARY.
* load_dependencies() will now try to load all dependencies when a report
  message is requested; therefore, all missing libraries are listed.
* Renamed uspace_program_args to user_space_program_args.
* The kernel filled in various members of the user_space_program_args structure
  unsafely, ie. was not using user_memcpy().
* Renamed some local variables in team.c to better fit our style guide (ie.
  uargs to userArgs).
* Changed Tracker to use the new _kern_load_image() variant on Haiku to retrieve
  and report all missing libraries. This fixes bug #1324.
* Adapted kernel_cpp.cpp to the runtime loader as well; the latter will now
  compile with _LOADER_MODE defined.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21715 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-07-27 02:32:19 +00:00
parent d6dfbc4de5
commit 74c0424a43
19 changed files with 323 additions and 136 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2006, Haiku Inc. All rights reserved.
* Copyright 2004-2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_SYSCALLS_H
@@ -73,7 +73,7 @@ extern status_t _kern_set_sem_owner(sem_id id, team_id proc);
extern thread_id _kern_load_image(int32 argCount, const char **args,
int32 envCount, const char **envp, int32 priority,
uint32 flags);
uint32 flags, port_id errorPort, uint32 errorToken);
extern void _kern_exit_team(status_t returnValue);
extern status_t _kern_kill_team(team_id team);
extern team_id _kern_get_current_team();
+20 -13
View File
@@ -6,7 +6,6 @@
#define _TEAM_H
#include <OS.h>
#include <thread_types.h>
@@ -15,37 +14,44 @@ extern "C" {
#endif
status_t team_init(struct kernel_args *args);
team_id team_create_team(const char *path, const char *name, char **args, int argc,
char **envp, int envc, int priority);
team_id team_create_team(const char *path, const char *name, char **args,
int argc, char **envp, int envc, int priority);
status_t wait_for_team(team_id id, status_t *returnCode);
void team_remove_team(struct team *team, struct process_group **_freeGroup);
void team_delete_team(struct team *team);
struct process_group *team_get_process_group_locked(struct process_session *session, pid_t id);
struct process_group *team_get_process_group_locked(
struct process_session *session, pid_t id);
void team_delete_process_group(struct process_group *group);
struct team *team_get_kernel_team(void);
team_id team_get_kernel_team_id(void);
team_id team_get_current_team_id(void);
status_t team_get_address_space(team_id id, struct vm_address_space **_addressSpace);
status_t team_get_address_space(team_id id,
struct vm_address_space **_addressSpace);
char **user_team_get_arguments(void);
int user_team_get_arg_count(void);
status_t team_get_death_entry(struct team *team, thread_id child,
struct death_entry *death, struct death_entry **_freeDeath);
struct death_entry *death, struct death_entry **_freeDeath);
bool team_is_valid(team_id id);
struct team *team_get_team_struct_locked(team_id id);
int32 team_max_teams(void);
int32 team_used_teams(void);
status_t start_watching_team(team_id team, void (*hook)(team_id, void *), void *data);
status_t stop_watching_team(team_id team, void (*hook)(team_id, void *), void *data);
status_t start_watching_team(team_id team, void (*hook)(team_id, void *),
void *data);
status_t stop_watching_team(team_id team, void (*hook)(team_id, void *),
void *data);
// used in syscalls.c
thread_id _user_load_image(int32 argCount, const char **args, int32 envCount,
const char **envp, int32 priority, uint32 flags);
const char **env, int32 priority, uint32 flags,
port_id errorPort, uint32 errorToken);
status_t _user_wait_for_team(team_id id, status_t *_returnCode);
void _user_exit_team(status_t returnValue);
status_t _user_kill_team(thread_id thread);
thread_id _user_wait_for_child(thread_id child, uint32 flags, int32 *_reason, status_t *_returnCode);
status_t _user_exec(const char *path, int32 argc, char * const *argv, int32 envCount, char * const *environment);
thread_id _user_wait_for_child(thread_id child, uint32 flags, int32 *_reason,
status_t *_returnCode);
status_t _user_exec(const char *path, int32 argc, char * const *argv,
int32 envCount, char * const *environment);
thread_id _user_fork(void);
team_id _user_get_current_team(void);
pid_t _user_process_info(pid_t process, int32 which);
@@ -54,10 +60,11 @@ pid_t _user_setsid(void);
status_t _user_get_team_info(team_id id, team_info *info);
status_t _user_get_next_team_info(int32 *cookie, team_info *info);
status_t _user_get_team_usage_info(team_id team, int32 who, team_usage_info *info, size_t size);
status_t _user_get_team_usage_info(team_id team, int32 who,
team_usage_info *info, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* _TIME_H */
#endif /* _TEAM_H */
+11 -9
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*
* Copyright 2002, Manuel J. Petit. All rights reserved.
@@ -15,13 +15,15 @@
#define MAGIC_APP_NAME "_APP_"
struct uspace_program_args {
char program_name[B_OS_NAME_LENGTH];
char program_path[B_PATH_NAME_LENGTH];
int argc;
int envc;
char **argv;
char **envp;
struct user_space_program_args {
char program_name[B_OS_NAME_LENGTH];
char program_path[B_PATH_NAME_LENGTH];
port_id error_port;
uint32 error_token;
int arg_count;
int env_count;
char **args;
char **env;
};
struct rld_export {
@@ -37,7 +39,7 @@ struct rld_export {
status_t (*get_next_image_dependency)(image_id id, uint32 *cookie,
const char **_name);
const struct uspace_program_args *program_args;
const struct user_space_program_args *program_args;
};
extern struct rld_export *__gRuntimeLoader;
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#ifndef LIBROOT_PRIVATE_H
@@ -10,7 +10,7 @@
#include <image.h>
struct uspace_program_args;
struct user_space_program_args;
struct real_time_data;
extern char _single_threaded;
@@ -26,7 +26,7 @@ status_t __parse_invoke_line(char *invoker, char ***_newArgs,
status_t __get_next_image_dependency(image_id id, uint32 *cookie,
const char **_name);
status_t __test_executable(const char *path, char *invoker);
void __init_env(const struct uspace_program_args *args);
void __init_env(const struct user_space_program_args *args);
void __init_heap(void);
void __init_time(void);