* Author:
* Zoltan Varga (vargaz@gmail.com)
*
- * (C) 2007-2008 Novell, Inc.
+ * Copyright 2007-2009 Novell, Inc (http://www.novell.com)
*/
#include <config.h>
#include <glib.h>
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
#define DISABLE_ATTACH
#endif
#ifndef DISABLE_ATTACH
#include <netdb.h>
#include <unistd.h>
-
#include <mono/metadata/assembly.h>
#include <mono/metadata/metadata.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/gc-internal.h>
+#include <mono/utils/mono-threads.h>
#include "attach.h"
/*
*/
/* FIXME: Use TMP ? */
pw = NULL;
+#ifdef HAVE_GETPWUID_R
res = getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw);
+#else
+ pw = getpwuid(getuid ());
+ res = pw != NULL ? 0 : 1;
+#endif
if (res != 0) {
fprintf (stderr, "attach: getpwuid_r () failed.\n");
return;
static void
transport_start_receive (void)
{
- gsize tid;
-
transport_connect ();
if (!listen_fd)
return;
- receiver_thread_handle = CreateThread (NULL, 0, receiver_thread, NULL, 0, &tid);
+ receiver_thread_handle = mono_threads_create_thread (receiver_thread, NULL, 0, 0, NULL);
g_assert (receiver_thread_handle);
}
/* Ask the runtime to not abort this thread */
//mono_thread_current ()->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
/* Ask the runtime to not wait for this thread */
- mono_thread_current ()->state |= ThreadState_Background;
+ mono_thread_internal_current ()->state |= ThreadState_Background;
while (TRUE) {
char *cmd, *agent_name, *agent_args;