[runtime] Added helper methods to iterate MonoInst with filters.
[mono.git] / mono / mini / wapihandles.c
index 9f9eac28fcba1e3b2d2fba6566851c46b2580c83..7bda38843ef4d8df290858f41da479d940727c6c 100644 (file)
@@ -1,7 +1,9 @@
 #include <config.h>
 #include <glib.h>
 
-#ifdef PLATFORM_WIN32
+#include "mini.h"
+
+#if defined(HOST_WIN32) || !defined(HAVE_SYS_IPC_H) || !defined(HAVE_SYS_SEM_H) || (defined(__native_client__) && defined(__GLIBC__)) || defined(DISABLE_SHARED_HANDLES)
 
 int mini_wapi_hps (int argc, char **argv)
 {
@@ -34,11 +36,12 @@ int mini_wapi_seminfo (int argc, char **argv)
 
 static const gchar *unused_details (struct _WapiHandleShared *handle);
 static const gchar *unshared_details (struct _WapiHandleShared *handle);
+#if 0
 static const gchar *thread_details (struct _WapiHandleShared *handle);
+#endif
 static const gchar *namedmutex_details (struct _WapiHandleShared *handle);
 static const gchar *namedsem_details (struct _WapiHandleShared *handle);
 static const gchar *namedevent_details (struct _WapiHandleShared *handle);
-static const gchar *process_details (struct _WapiHandleShared *handle);
 
 /* This depends on the ordering of the enum WapiHandleType in
  * io-layer/wapi-private.h
@@ -48,13 +51,13 @@ static const gchar * (*details[])(struct _WapiHandleShared *)=
        unused_details,
        unshared_details,               /* file */
        unshared_details,               /* console */
-       thread_details,
+       unshared_details,               /* thread */
        unshared_details,               /* sem */
        unshared_details,               /* mutex */
        unshared_details,               /* event */
        unshared_details,               /* socket */
        unshared_details,               /* find */
-       process_details,
+       unshared_details,       /* process */
        unshared_details,               /* pipe */
        namedmutex_details,
        namedsem_details,
@@ -111,7 +114,7 @@ int mini_wapi_hps (int argc, char **argv)
                
                file_share = &_wapi_fileshare_layout->share_info[i];
                if (file_share->handle_refs > 0) {
-                       g_print ("dev: 0x%llx ino: %lld open pid: %d share: 0x%x access: 0x%x refs: %d\n", file_share->device, file_share->inode, file_share->opened_by_pid, file_share->sharemode, file_share->access, file_share->handle_refs);
+                       g_print ("dev: 0x%llx ino: %lld open pid: %d share: 0x%x access: 0x%x refs: %d\n", (long long int)file_share->device, (long long int)file_share->inode, file_share->opened_by_pid, file_share->sharemode, file_share->access, file_share->handle_refs);
                }
        }
        
@@ -128,6 +131,7 @@ static const gchar *unshared_details (struct _WapiHandleShared *handle)
        return("unshared details");
 }
 
+#if 0
 static const gchar *thread_details (struct _WapiHandleShared *handle)
 {
        static gchar buf[80];
@@ -140,6 +144,7 @@ static const gchar *thread_details (struct _WapiHandleShared *handle)
        
        return(buf);
 }
+#endif
 
 static const gchar *namedmutex_details (struct _WapiHandleShared *handle)
 {
@@ -185,20 +190,6 @@ static const gchar *namedevent_details (struct _WapiHandleShared *handle)
        return(buf);
 }
 
-static const gchar *process_details (struct _WapiHandleShared *handle)
-{
-       static gchar buf[80];
-       gchar *name;
-       struct _WapiHandle_process *proc=&handle->u.process;
-       
-       name = proc->proc_name;
-       
-       g_snprintf (buf, sizeof(buf), "[%25.25s] pid: %5u exit: %u",
-                   name==NULL?(gchar *)"":name, proc->id, proc->exitstatus);
-       
-       return(buf);
-}
-
 /* The old handles/semdel.c */
 int mini_wapi_semdel (int argc, char **argv)
 {