Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / support / errno.c
index 384451da47c4af2149080cad2de18498e7be577b..76b4b388e9862170e2647ed127d1bf71017f1fbd 100644 (file)
 
 G_BEGIN_DECLS
 
+int
+Mono_Posix_Stdlib_GetLastError (void)
+{
+       return errno;
+}
+
 void
 Mono_Posix_Stdlib_SetLastError (int error_number)
 {
@@ -35,7 +41,7 @@ Mono_Posix_Stdlib_SetLastError (int error_number)
  * we assume that the XPG version is present.
  */
 
-#ifdef _GNU_SOURCE && !PLATFORM_ANDROID
+#ifdef _GNU_SOURCE
 #define mph_min(x,y) ((x) <= (y) ? (x) : (y))
 
 /* If you pass an invalid errno value to glibc 2.3.2's strerror_r, you get
@@ -80,7 +86,7 @@ Mono_Posix_Syscall_strerror_r (int errnum, char *buf, mph_size_t n)
        mph_return_if_size_t_overflow (n);
 
        /* first, check for valid errnum */
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
        /* Android NDK defines _GNU_SOURCE but strerror_r follows the XSI semantics
         * not the GNU one. XSI version returns an integer, as opposed to the GNU one
         * which returns pointer to the buffer.