cleared during P/Invoke, previously Stdlib.perror("") would always print
"Success", which isn't very helpful.)
svn path=/trunk/mcs/; revision=88162
+2007-10-25 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Stdlib.cs: Fix perror(3) so that it works as expected. (Since errno is
+ cleared during P/Invoke, previously Stdlib.perror("") would always print
+ "Success", which isn't very helpful.)
+
2007-06-28 Jonathan Pryor <jonpryor@vt.edu>
* NativeConvert.generated.cs: Flush (add TryCopy() methods for Utimbuf).
[DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
SetLastError=true, EntryPoint="Mono_Posix_Stdlib_perror")]
- public static extern int perror (string s);
+ private static extern int perror (string s, int err);
+
+ public static int perror (string s)
+ {
+ return perror (s, Marshal.GetLastWin32Error ());
+ }
//
// <stdlib.h>