[System] Tweak socket test
[mono-project.git] / mono / metadata / w32process-unix-haiku.c
blob4311993bb10554af25b9b1c34e1d548c690d7642
2 #include "w32process.h"
3 #include "w32process-unix-internals.h"
5 #ifdef USE_HAIKU_BACKEND
7 #include <KernelKit.h>
9 gchar*
10 mono_w32process_get_name (pid_t pid)
12 image_info imageInfo;
13 int32 cookie = 0;
15 if (get_next_image_info ((team_id) pid, &cookie, &imageInfo) != B_OK)
16 return NULL;
18 return g_strdup (imageInfo.name);
21 gchar*
22 mono_w32process_get_path (pid_t pid)
24 return mono_w32process_get_name (pid);
27 GSList*
28 mono_w32process_get_modules (pid_t pid)
30 GSList *ret = NULL;
31 MonoW32ProcessModule *mod;
32 gint32 cookie = 0;
33 image_info imageInfo;
35 while (get_next_image_info (B_CURRENT_TEAM, &cookie, &imageInfo) == B_OK) {
36 mod = g_new0 (MonoW32ProcessModule, 1);
37 mod->device = imageInfo.device;
38 mod->inode = imageInfo.node;
39 mod->filename = g_strdup (imageInfo.name);
40 mod->address_start = MIN (imageInfo.text, imageInfo.data);
41 mod->address_end = MAX ((uint8_t*)imageInfo.text + imageInfo.text_size,
42 (uint8_t*)imageInfo.data + imageInfo.data_size);
43 mod->perms = g_strdup ("r--p");
44 mod->address_offset = 0;
46 if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
47 ret = g_slist_prepend (ret, mod);
48 } else {
49 mono_w32process_module_free (mod);
53 return g_slist_reverse (ret);
56 #endif