* Syscall.cs: Update comment with correct exception type.
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / UnixMarshal.cs
index a3c5e53fdcbfb424cfd707233651ecdf5e7a8253..c9ba832f18dd4212e31e0d3a785605e8120be2e2 100644 (file)
@@ -51,28 +51,22 @@ namespace Mono.Unix {
        //            using strerror(3).
        //            This should be thread safe, since the check is done within the
        //            class constructor lock.
-       //  Problem:  But if strerror_r() isn't present, we're not thread safe!
-       // Solution:  Tough.  It's still better than nothing.  I think.  
-       //            Check UnixMarshal.IsErrorDescriptionThreadSafe if you need to
-       //            know which error translator is being used.
+       //            Strerror(3) will be thread-safe from managed code, but won't
+       //            be thread-safe between managed & unmanaged code.
        internal class ErrorMarshal
        {
-               public delegate string ErrorTranslator (Error errno);
+               internal delegate string ErrorTranslator (Error errno);
 
-               public static readonly ErrorTranslator Translate;
-               public static readonly bool HaveStrerror_r;
+               internal static readonly ErrorTranslator Translate;
 
                static ErrorMarshal ()
                {
                        try {
                                Translate = new ErrorTranslator (strerror_r);
-                               string ignore = Translate (Error.ERANGE);
-                               ignore = ignore;
-                               HaveStrerror_r = true;
+                               Translate (Error.ERANGE);
                        }
                        catch (EntryPointNotFoundException e) {
                                Translate = new ErrorTranslator (strerror);
-                               HaveStrerror_r = false;
                        }
                }
 
@@ -105,10 +99,6 @@ namespace Mono.Unix {
                        return ErrorMarshal.Translate (errno);
                }
 
-               public static bool IsErrorDescriptionThreadSafe {
-                       get {return ErrorMarshal.HaveStrerror_r;}
-               }
-
                public static IntPtr Alloc (long size)
                {
                        if (size < 0)