{
try {
Translate = new ErrorTranslator (strerror_r);
- string ignore = Translate (Error.EPERM);
- ignore = ignore;
+ Translate (Error.ERANGE);
HaveStrerror_r = true;
}
catch (EntryPointNotFoundException e) {
private static string strerror (Error errno)
{
- return Syscall.strerror (errno);
+ return Stdlib.strerror (errno);
}
private static string strerror_r (Error errno)
do {
buf.Capacity *= 2;
r = Syscall.strerror_r (errno, buf);
- } while (r == -1 && Syscall.GetLastError() == Error.ERANGE);
+ } while (r == -1 && Stdlib.GetLastError() == Error.ERANGE);
if (r == -1)
return "** Unknown error code: " + ((int) errno) + "**";
public static bool ShouldRetrySyscall (int r)
{
- if (r == -1 && Syscall.GetLastError () == Error.EINTR)
+ if (r == -1 && Stdlib.GetLastError () == Error.EINTR)
return true;
return false;
}
public static bool ShouldRetrySyscall (int r, out Error error)
{
error = (Error) 0;
- if (r == -1 && (error = Syscall.GetLastError ()) == Error.EINTR)
+ if (r == -1 && (error = Stdlib.GetLastError ()) == Error.EINTR)
return true;
return false;
}
return p;
}
+ internal static Exception CreateExceptionForLastError ()
+ {
+ return CreateExceptionForError (Stdlib.GetLastError());
+ }
+
public static void ThrowExceptionForError (Error errno)
{
throw CreateExceptionForError (errno);
public static void ThrowExceptionForLastError ()
{
- throw CreateExceptionForError (Syscall.GetLastError());
+ throw CreateExceptionForLastError ();
}
public static void ThrowExceptionForErrorIf (int retval, Error errno)