SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
92
lang/mono/patches/patch-mono_utils_mono-proclib_c
Normal file
92
lang/mono/patches/patch-mono_utils_mono-proclib_c
Normal file
|
@ -0,0 +1,92 @@
|
|||
Index: mono/utils/mono-proclib.c
|
||||
--- mono/utils/mono-proclib.c.orig
|
||||
+++ mono/utils/mono-proclib.c
|
||||
@@ -107,30 +107,30 @@ mono_process_list (int *size)
|
||||
{
|
||||
#if USE_SYSCTL
|
||||
int res, i;
|
||||
-#ifdef KERN_PROC2
|
||||
+#ifdef KERN_PROC
|
||||
int mib [6];
|
||||
- size_t data_len = sizeof (struct kinfo_proc2) * 400;
|
||||
- struct kinfo_proc2 *processes = g_malloc (data_len);
|
||||
+ size_t data_len = sizeof (struct kinfo_proc) * 400;
|
||||
+ struct kinfo_proc *processes = g_malloc (data_len);
|
||||
#else
|
||||
int mib [4];
|
||||
size_t data_len = sizeof (struct kinfo_proc) * 16;
|
||||
struct kinfo_proc *processes;
|
||||
int limit = 8;
|
||||
-#endif /* KERN_PROC2 */
|
||||
+#endif /* KERN_PROC */
|
||||
void **buf = NULL;
|
||||
|
||||
if (size)
|
||||
*size = 0;
|
||||
|
||||
-#ifdef KERN_PROC2
|
||||
+#ifdef KERN_PROC
|
||||
if (!processes)
|
||||
return NULL;
|
||||
|
||||
mib [0] = CTL_KERN;
|
||||
- mib [1] = KERN_PROC2;
|
||||
+ mib [1] = KERN_PROC;
|
||||
mib [2] = KERN_PROC_ALL;
|
||||
mib [3] = 0;
|
||||
- mib [4] = sizeof(struct kinfo_proc2);
|
||||
+ mib [4] = sizeof(struct kinfo_proc);
|
||||
mib [5] = 400; /* XXX */
|
||||
|
||||
res = sysctl (mib, 6, processes, &data_len, NULL, 0);
|
||||
@@ -160,13 +160,13 @@ mono_process_list (int *size)
|
||||
break;
|
||||
}
|
||||
}
|
||||
-#endif /* KERN_PROC2 */
|
||||
+#endif /* KERN_PROC */
|
||||
|
||||
-#ifdef KERN_PROC2
|
||||
- res = data_len/sizeof (struct kinfo_proc2);
|
||||
+#ifdef KERN_PROC
|
||||
+ res = data_len/sizeof (struct kinfo_proc);
|
||||
#else
|
||||
res = data_len/sizeof (struct kinfo_proc);
|
||||
-#endif /* KERN_PROC2 */
|
||||
+#endif /* KERN_PROC */
|
||||
buf = (void **) g_realloc (buf, res * sizeof (void*));
|
||||
for (i = 0; i < res; ++i)
|
||||
buf [i] = GINT_TO_POINTER (processes [i].kinfo_pid_member);
|
||||
@@ -300,8 +300,8 @@ get_pid_status_item_buf (int pid, const char *item, ch
|
||||
|
||||
#if USE_SYSCTL
|
||||
|
||||
-#ifdef KERN_PROC2
|
||||
-#define KINFO_PROC struct kinfo_proc2
|
||||
+#ifdef KERN_PROC
|
||||
+#define KINFO_PROC struct kinfo_proc
|
||||
#else
|
||||
#define KINFO_PROC struct kinfo_proc
|
||||
#endif
|
||||
@@ -312,10 +312,10 @@ sysctl_kinfo_proc (gpointer pid, KINFO_PROC* processi)
|
||||
int res;
|
||||
size_t data_len = sizeof (KINFO_PROC);
|
||||
|
||||
-#ifdef KERN_PROC2
|
||||
+#ifdef KERN_PROC
|
||||
int mib [6];
|
||||
mib [0] = CTL_KERN;
|
||||
- mib [1] = KERN_PROC2;
|
||||
+ mib [1] = KERN_PROC;
|
||||
mib [2] = KERN_PROC_PID;
|
||||
mib [3] = GPOINTER_TO_UINT (pid);
|
||||
mib [4] = sizeof(KINFO_PROC);
|
||||
@@ -330,7 +330,7 @@ sysctl_kinfo_proc (gpointer pid, KINFO_PROC* processi)
|
||||
mib [3] = GPOINTER_TO_UINT (pid);
|
||||
|
||||
res = sysctl (mib, 4, processi, &data_len, NULL, 0);
|
||||
-#endif /* KERN_PROC2 */
|
||||
+#endif /* KERN_PROC */
|
||||
|
||||
if (res < 0 || data_len != sizeof (KINFO_PROC))
|
||||
return FALSE;
|
Loading…
Add table
Add a link
Reference in a new issue