X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fenvironment.c;h=b7001b57ac5664ceae8e509c920c273cc5f83ed6;hb=9d84dcb2fc35af1d75450045a8212bf5ab3ff383;hp=e0d1970f61279e87374354b4bc734610cd344c9d;hpb=468225a247b8897b2a4fa1e6bd7ffa32aa8c243b;p=mono.git diff --git a/mono/metadata/environment.c b/mono/metadata/environment.c index e0d1970f612..b7001b57ac5 100644 --- a/mono/metadata/environment.c +++ b/mono/metadata/environment.c @@ -1,5 +1,6 @@ -/* - * environment.c: System.Environment support internal calls +/** + * \file + * System.Environment support internal calls * * Authors: * Dick Porter (dick@ximian.com) @@ -7,6 +8,7 @@ * * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com) * Copyright 2004-2009 Novell, Inc (http://www.novell.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include @@ -15,10 +17,11 @@ #include #include #include +#include #include -#include +#include -extern MonoString* ves_icall_System_Environment_GetOSVersionString (void); +extern MonoStringHandle ves_icall_System_Environment_GetOSVersionString (MonoError *error); #if !defined(HOST_WIN32) && defined(HAVE_SYS_UTSNAME_H) #include @@ -26,20 +29,29 @@ extern MonoString* ves_icall_System_Environment_GetOSVersionString (void); static gint32 exitcode=0; -gint32 mono_environment_exitcode_get (void) +/** + * mono_environment_exitcode_get: + */ +gint32 +mono_environment_exitcode_get (void) { return(exitcode); } -void mono_environment_exitcode_set (gint32 value) +/** + * mono_environment_exitcode_set: + */ +void +mono_environment_exitcode_set (gint32 value) { exitcode=value; } /* note: we better manipulate the string in managed code (easier and safer) */ -MonoString* -ves_icall_System_Environment_GetOSVersionString (void) +MonoStringHandle +ves_icall_System_Environment_GetOSVersionString (MonoError *error) { + error_init (error); #ifdef HOST_WIN32 OSVERSIONINFOEX verinfo; @@ -53,15 +65,15 @@ ves_icall_System_Environment_GetOSVersionString (void) verinfo.dwMinorVersion, verinfo.dwBuildNumber, verinfo.wServicePackMajor << 16); - return mono_string_new (mono_domain_get (), version); + return mono_string_new_handle (mono_domain_get (), version, error); } #elif defined(HAVE_SYS_UTSNAME_H) struct utsname name; if (uname (&name) >= 0) { - return mono_string_new (mono_domain_get (), name.release); + return mono_string_new_handle (mono_domain_get (), name.release, error); } #endif - return mono_string_new (mono_domain_get (), "0.0.0.0"); + return mono_string_new_handle (mono_domain_get (), "0.0.0.0", error); }