X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fprofiler%2Futils.c;h=753024dcf72963e30c7ebef03da79e54b7cdc7e0;hb=dfac8517b91687f11479801fa0a2191585b1ad4c;hp=b16e9bfc6aa7474e61a40ec7075fc349eb6a30ea;hpb=c963609e64c413d83fcf56d658c73da9375b05f9;p=mono.git diff --git a/mono/profiler/utils.c b/mono/profiler/utils.c index b16e9bfc6aa..753024dcf72 100644 --- a/mono/profiler/utils.c +++ b/mono/profiler/utils.c @@ -12,12 +12,14 @@ * Paolo Molaro (lupus@ximian.com) * * Copyright 2010 Novell, Inc (http://www.novell.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include "utils.h" #include #include #include #include +#include #ifdef HOST_WIN32 #include #else @@ -274,7 +276,7 @@ alloc_buffer (int size) return ptr; #else ptr = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); - if (ptr == (void*)-1) + if (ptr == MAP_FAILED) return NULL; return ptr; #endif @@ -412,3 +414,13 @@ thread_id (void) #endif } +uintptr_t +process_id (void) +{ +#ifdef HOST_WIN32 + return 0; /* FIXME */ +#else + return (uintptr_t)getpid (); +#endif +} +