finished implementing get_thread_info, get_next_thread_info, get_team_info, get_next_team_info. New ps command behaving like the BeOS one is here, but doesn't work as libroot seems to crash when loaded at process startup... :/

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@570 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
lillo
2002-08-04 02:04:37 +00:00
parent aded06e0aa
commit 854c31f835
10 changed files with 229 additions and 89 deletions
+9 -1
View File
@@ -345,14 +345,22 @@ thread_id find_thread(const char *);
status_t snooze(bigtime_t);
status_t _get_thread_info(thread_id id, thread_info *info, size_t size);
status_t _get_next_thread_info(team_id team, int32 *cookie, thread_info *info, size_t size);
status_t _get_team_info(team_id id, team_info *info, size_t size);
status_t _get_next_team_info(int32 *cookie, team_info *info, size_t size);
#define get_thread_info(id, info) \
_get_thread_info((id), (info), sizeof(*(info)))
#define get_next_thread_info(team, cookie, info) \
_get_next_thread_info((team), (cookie), (info), sizeof(*(info)))
#define get_team_info(id, info) \
_get_team_info((id), (info), sizeof(*(info)))
#define get_next_team_info(cookie, info) \
_get_next_sem_info((cookie), (info), sizeof(*(info)))
_get_next_team_info((cookie), (info), sizeof(*(info)))
/** @} */
#ifdef __cplusplus
+5 -2
View File
@@ -60,8 +60,6 @@ int sys_get_sem_info(sem_id, struct sem_info *, size_t);
int sys_get_next_sem_info(team_id, uint32 *, struct sem_info *, size_t);
int sys_set_sem_owner(sem_id id, team_id proc);
//int sys_team_get_table(struct proc_info *pi, size_t len);
void sys_exit(int retcode);
team_id sys_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority);
@@ -77,6 +75,11 @@ int sys_kill_team(team_id tid);
team_id sys_get_current_team_id();
int sys_wait_on_team(team_id tid, int *retcode);
status_t sys_get_thread_info(thread_id id, thread_info *info);
status_t sys_get_next_thread_info(team_id team, int32 *cookie, thread_info *info);
status_t sys_get_team_info(team_id id, team_info *info);
status_t sys_get_next_team_info(int32 *cookie, team_info *info);
region_id sys_vm_create_anonymous_region(const char *name, void **address, int addr_type,
addr size, int wiring, int lock);
region_id sys_vm_clone_region(const char *name, void **address, int addr_type,
+4
View File
@@ -96,6 +96,10 @@ enum {
SYSCALL_CREATE_DIR_ENTRY_REF,
SYSCALL_CREATE_SYMLINK,
SYSCALL_READ_LINK,
SYSCALL_GET_THREAD_INFO,
SYSCALL_GET_NEXT_THREAD_INFO,
SYSCALL_GET_TEAM_INFO, /* 90 */
SYSCALL_GET_NEXT_TEAM_INFO,
};
int syscall_dispatcher(unsigned long call_num, void *arg_buffer, uint64 *call_ret);
+3 -2
View File
@@ -58,6 +58,7 @@ team_id team_get_kernel_team_id(void);
team_id team_get_current_team_id(void);
char **user_team_get_arguments(void);
int user_team_get_arg_count(void);
struct team *team_get_team_struct(team_id id);
struct team *team_get_team_struct_locked(team_id id);
// used in syscalls.c
@@ -68,11 +69,11 @@ int user_team_wait_on_team(team_id id, int *uretcode);
thread_id user_thread_create_user_thread(addr, team_id, const char*,
int, void *);
status_t user_get_thread_info(thread_id id, thread_info *info);
status_t user_get_next_thread_info(team_id team, int32 *cookie, thread_info *info);
status_t user_get_team_info(team_id id, team_info *info);
status_t user_get_next_team_info(int32 *cookie, team_info *info);
//int user_proc_get_table(struct proc_info *pi, size_t len);
int user_getrlimit(int resource, struct rlimit * rlp);
int user_setrlimit(int resource, const struct rlimit * rlp);