Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
9311 lines (9097 sloc) 283 KB
/*
* This file was automatically generated by create-native-map from ../mcs/class/lib/net_4_x/Mono.Posix.dll.
*
* DO NOT MODIFY.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* ndef HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
/*
* Implementation Macros
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif /* ndef _GNU_SOURCE */
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif /* ndef _XOPEN_SOURCE */
/*
* Implementation Includes
*/
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* ndef HAVE_NETINET_IN_H */
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* ndef HAVE_SYS_TIME_H */
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif /* ndef HAVE_SYS_POLL_H */
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif /* ndef HAVE_SYS_WAIT_H */
#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
#endif /* ndef HAVE_SYS_STATVFS_H */
#ifdef HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif /* ndef HAVE_SYS_XATTR_H */
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif /* ndef HAVE_SYS_MMAN_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif /* ndef HAVE_SYS_SOCKET_H */
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif /* ndef HAVE_SYS_UIO_H */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* ndef HAVE_UNISTD_H */
#include <fcntl.h>
#include <signal.h>
#ifdef HAVE_POLL_H
#include <poll.h>
#endif /* ndef HAVE_POLL_H */
#ifdef HAVE_GRP_H
#include <grp.h>
#endif /* ndef HAVE_GRP_H */
#include <errno.h>
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif /* ndef HAVE_SYSLOG_H */
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif /* ndef HAVE_DIRENT_H */
#ifdef HAVE_UTIME_H
#include <utime.h>
#endif /* ndef HAVE_UTIME_H */
#include <time.h>
#include "mph.h"
#include "map.h"
#include <errno.h> /* errno, EOVERFLOW */
#include <glib.h> /* g* types, g_assert_not_reached() */
#if defined (G_MININT8)
#define CNM_MININT8 G_MININT8
#else
#define CNM_MININT8 (-128)
#endif
#if defined (G_MAXINT8)
#define CNM_MAXINT8 G_MAXINT8
#else
#define CNM_MAXINT8 (127)
#endif
#if defined (G_MAXUINT8)
#define CNM_MAXUINT8 G_MAXUINT8
#else
#define CNM_MAXUINT8 (255)
#endif
#if defined (G_MININT16)
#define CNM_MININT16 G_MININT16
#else
#define CNM_MININT16 (-32768)
#endif
#if defined (G_MAXINT16)
#define CNM_MAXINT16 G_MAXINT16
#else
#define CNM_MAXINT16 (32767)
#endif
#if defined (G_MAXUINT16)
#define CNM_MAXUINT16 G_MAXUINT16
#else
#define CNM_MAXUINT16 (65535)
#endif
#if defined (G_MININT32)
#define CNM_MININT32 G_MININT32
#else
#define CNM_MININT32 (-2147483648)
#endif
#if defined (G_MAXINT32)
#define CNM_MAXINT32 G_MAXINT32
#else
#define CNM_MAXINT32 (2147483647)
#endif
#if defined (G_MAXUINT32)
#define CNM_MAXUINT32 G_MAXUINT32
#else
#define CNM_MAXUINT32 (4294967295U)
#endif
#if defined (G_MININT64)
#define CNM_MININT64 G_MININT64
#else
#define CNM_MININT64 (-9223372036854775808LL)
#endif
#if defined (G_MAXINT64)
#define CNM_MAXINT64 G_MAXINT64
#else
#define CNM_MAXINT64 (9223372036854775807LL)
#endif
#if defined (G_MAXUINT64)
#define CNM_MAXUINT64 G_MAXUINT64
#else
#define CNM_MAXUINT64 (18446744073709551615ULL)
#endif
/* returns TRUE if @type is an unsigned type */
#define _cnm_integral_type_is_unsigned(type) \
(sizeof(type) == sizeof(gint8) \
? (((type)-1) > CNM_MAXINT8) \
: sizeof(type) == sizeof(gint16) \
? (((type)-1) > CNM_MAXINT16) \
: sizeof(type) == sizeof(gint32) \
? (((type)-1) > CNM_MAXINT32) \
: sizeof(type) == sizeof(gint64) \
? (((type)-1) > CNM_MAXINT64) \
: (g_assert_not_reached (), 0))
/* returns the minimum value of @type as a gint64 */
#define _cnm_integral_type_min(type) \
(_cnm_integral_type_is_unsigned (type) \
? 0 \
: sizeof(type) == sizeof(gint8) \
? CNM_MININT8 \
: sizeof(type) == sizeof(gint16) \
? CNM_MININT16 \
: sizeof(type) == sizeof(gint32) \
? CNM_MININT32 \
: sizeof(type) == sizeof(gint64) \
? CNM_MININT64 \
: (g_assert_not_reached (), 0))
/* returns the maximum value of @type as a guint64 */
#define _cnm_integral_type_max(type) \
(_cnm_integral_type_is_unsigned (type) \
? sizeof(type) == sizeof(gint8) \
? CNM_MAXUINT8 \
: sizeof(type) == sizeof(gint16) \
? CNM_MAXUINT16 \
: sizeof(type) == sizeof(gint32) \
? CNM_MAXUINT32 \
: sizeof(type) == sizeof(gint64) \
? CNM_MAXUINT64 \
: (g_assert_not_reached (), 0) \
: sizeof(type) == sizeof(gint8) \
? CNM_MAXINT8 \
: sizeof(type) == sizeof(gint16) \
? CNM_MAXINT16 \
: sizeof(type) == sizeof(gint32) \
? CNM_MAXINT32 \
: sizeof(type) == sizeof(gint64) \
? CNM_MAXINT64 \
: (g_assert_not_reached (), 0))
#ifdef _CNM_DUMP
#define _cnm_dump(to_t,from) \
printf ("# %s -> %s: uns=%i; min=%llx; max=%llx; value=%llx; lt=%i; l0=%i; gt=%i; e=%i\n", \
#from, #to_t, \
(int) _cnm_integral_type_is_unsigned (to_t), \
(gint64) (_cnm_integral_type_min (to_t)), \
(gint64) (_cnm_integral_type_max (to_t)), \
(gint64) (from), \
(((gint64) _cnm_integral_type_min (to_t)) <= (gint64) from), \
(from < 0), \
(((guint64) from) <= (guint64) _cnm_integral_type_max (to_t)), \
!((int) _cnm_integral_type_is_unsigned (to_t) \
? ((0 <= from) && \
((guint64) from <= (guint64) _cnm_integral_type_max (to_t))) \
: ((gint64) _cnm_integral_type_min(to_t) <= (gint64) from && \
(guint64) from <= (guint64) _cnm_integral_type_max (to_t))) \
)
#else /* ndef _CNM_DUMP */
#define _cnm_dump(to_t, from) do {} while (0)
#endif /* def _CNM_DUMP */
#ifdef DEBUG
#define _cnm_return_val_if_overflow(to_t,from,val) G_STMT_START { \
int uns = _cnm_integral_type_is_unsigned (to_t); \
gint64 min = (gint64) _cnm_integral_type_min (to_t); \
guint64 max = (guint64) _cnm_integral_type_max (to_t); \
gint64 sf = (gint64) from; \
guint64 uf = (guint64) from; \
if (!(uns ? ((0 <= from) && (uf <= max)) \
: (min <= sf && (from < 0 || uf <= max)))) { \
_cnm_dump(to_t, from); \
errno = EOVERFLOW; \
return (val); \
} \
} G_STMT_END
#else /* !def DEBUG */
/* don't do any overflow checking */
#define _cnm_return_val_if_overflow(to_t,from,val) G_STMT_START { \
} G_STMT_END
#endif /* def DEBUG */
int Mono_Posix_FromAccessModes (int x, int *r)
{
*r = 0;
if ((x & Mono_Posix_AccessModes_F_OK) == Mono_Posix_AccessModes_F_OK)
#ifdef F_OK
*r |= F_OK;
#else /* def F_OK */
{errno = EINVAL; return -1;}
#endif /* ndef F_OK */
if ((x & Mono_Posix_AccessModes_R_OK) == Mono_Posix_AccessModes_R_OK)
#ifdef R_OK
*r |= R_OK;
#else /* def R_OK */
{errno = EINVAL; return -1;}
#endif /* ndef R_OK */
if ((x & Mono_Posix_AccessModes_W_OK) == Mono_Posix_AccessModes_W_OK)
#ifdef W_OK
*r |= W_OK;
#else /* def W_OK */
{errno = EINVAL; return -1;}
#endif /* ndef W_OK */
if ((x & Mono_Posix_AccessModes_X_OK) == Mono_Posix_AccessModes_X_OK)
#ifdef X_OK
*r |= X_OK;
#else /* def X_OK */
{errno = EINVAL; return -1;}
#endif /* ndef X_OK */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToAccessModes (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef F_OK
if ((x & F_OK) == F_OK)
*r |= Mono_Posix_AccessModes_F_OK;
#endif /* ndef F_OK */
#ifdef R_OK
if ((x & R_OK) == R_OK)
*r |= Mono_Posix_AccessModes_R_OK;
#endif /* ndef R_OK */
#ifdef W_OK
if ((x & W_OK) == W_OK)
*r |= Mono_Posix_AccessModes_W_OK;
#endif /* ndef W_OK */
#ifdef X_OK
if ((x & X_OK) == X_OK)
*r |= Mono_Posix_AccessModes_X_OK;
#endif /* ndef X_OK */
return 0;
}
int Mono_Posix_FromAtFlags (int x, int *r)
{
*r = 0;
if ((x & Mono_Posix_AtFlags_AT_EMPTY_PATH) == Mono_Posix_AtFlags_AT_EMPTY_PATH)
#ifdef AT_EMPTY_PATH
*r |= AT_EMPTY_PATH;
#else /* def AT_EMPTY_PATH */
{errno = EINVAL; return -1;}
#endif /* ndef AT_EMPTY_PATH */
if ((x & Mono_Posix_AtFlags_AT_NO_AUTOMOUNT) == Mono_Posix_AtFlags_AT_NO_AUTOMOUNT)
#ifdef AT_NO_AUTOMOUNT
*r |= AT_NO_AUTOMOUNT;
#else /* def AT_NO_AUTOMOUNT */
{errno = EINVAL; return -1;}
#endif /* ndef AT_NO_AUTOMOUNT */
if ((x & Mono_Posix_AtFlags_AT_REMOVEDIR) == Mono_Posix_AtFlags_AT_REMOVEDIR)
#ifdef AT_REMOVEDIR
*r |= AT_REMOVEDIR;
#else /* def AT_REMOVEDIR */
{errno = EINVAL; return -1;}
#endif /* ndef AT_REMOVEDIR */
if ((x & Mono_Posix_AtFlags_AT_SYMLINK_FOLLOW) == Mono_Posix_AtFlags_AT_SYMLINK_FOLLOW)
#ifdef AT_SYMLINK_FOLLOW
*r |= AT_SYMLINK_FOLLOW;
#else /* def AT_SYMLINK_FOLLOW */
{errno = EINVAL; return -1;}
#endif /* ndef AT_SYMLINK_FOLLOW */
if ((x & Mono_Posix_AtFlags_AT_SYMLINK_NOFOLLOW) == Mono_Posix_AtFlags_AT_SYMLINK_NOFOLLOW)
#ifdef AT_SYMLINK_NOFOLLOW
*r |= AT_SYMLINK_NOFOLLOW;
#else /* def AT_SYMLINK_NOFOLLOW */
{errno = EINVAL; return -1;}
#endif /* ndef AT_SYMLINK_NOFOLLOW */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToAtFlags (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef AT_EMPTY_PATH
if ((x & AT_EMPTY_PATH) == AT_EMPTY_PATH)
*r |= Mono_Posix_AtFlags_AT_EMPTY_PATH;
#endif /* ndef AT_EMPTY_PATH */
#ifdef AT_NO_AUTOMOUNT
if ((x & AT_NO_AUTOMOUNT) == AT_NO_AUTOMOUNT)
*r |= Mono_Posix_AtFlags_AT_NO_AUTOMOUNT;
#endif /* ndef AT_NO_AUTOMOUNT */
#ifdef AT_REMOVEDIR
if ((x & AT_REMOVEDIR) == AT_REMOVEDIR)
*r |= Mono_Posix_AtFlags_AT_REMOVEDIR;
#endif /* ndef AT_REMOVEDIR */
#ifdef AT_SYMLINK_FOLLOW
if ((x & AT_SYMLINK_FOLLOW) == AT_SYMLINK_FOLLOW)
*r |= Mono_Posix_AtFlags_AT_SYMLINK_FOLLOW;
#endif /* ndef AT_SYMLINK_FOLLOW */
#ifdef AT_SYMLINK_NOFOLLOW
if ((x & AT_SYMLINK_NOFOLLOW) == AT_SYMLINK_NOFOLLOW)
*r |= Mono_Posix_AtFlags_AT_SYMLINK_NOFOLLOW;
#endif /* ndef AT_SYMLINK_NOFOLLOW */
return 0;
}
#ifdef HAVE_STRUCT_CMSGHDR
int
Mono_Posix_FromCmsghdr (struct Mono_Posix_Cmsghdr *from, struct cmsghdr *to)
{
_cnm_return_val_if_overflow (gint64, from->cmsg_len, -1);
memset (to, 0, sizeof(*to));
to->cmsg_len = from->cmsg_len;
if (Mono_Posix_FromUnixSocketProtocol (from->cmsg_level, &to->cmsg_level) != 0) {
return -1;
}
if (Mono_Posix_FromUnixSocketControlMessage (from->cmsg_type, &to->cmsg_type) != 0) {
return -1;
}
return 0;
}
#endif /* ndef HAVE_STRUCT_CMSGHDR */
#ifdef HAVE_STRUCT_CMSGHDR
int
Mono_Posix_ToCmsghdr (struct cmsghdr *from, struct Mono_Posix_Cmsghdr *to)
{
_cnm_return_val_if_overflow (gint64, from->cmsg_len, -1);
memset (to, 0, sizeof(*to));
to->cmsg_len = from->cmsg_len;
if (Mono_Posix_ToUnixSocketProtocol (from->cmsg_level, &to->cmsg_level) != 0) {
return -1;
}
if (Mono_Posix_ToUnixSocketControlMessage (from->cmsg_type, &to->cmsg_type) != 0) {
return -1;
}
return 0;
}
#endif /* ndef HAVE_STRUCT_CMSGHDR */
int Mono_Posix_FromConfstrName (int x, int *r)
{
*r = 0;
if (x == Mono_Posix_ConfstrName__CS_GNU_LIBC_VERSION)
#ifdef _CS_GNU_LIBC_VERSION
{*r = _CS_GNU_LIBC_VERSION; return 0;}
#else /* def _CS_GNU_LIBC_VERSION */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_GNU_LIBC_VERSION */
if (x == Mono_Posix_ConfstrName__CS_GNU_LIBPTHREAD_VERSION)
#ifdef _CS_GNU_LIBPTHREAD_VERSION
{*r = _CS_GNU_LIBPTHREAD_VERSION; return 0;}
#else /* def _CS_GNU_LIBPTHREAD_VERSION */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
if (x == Mono_Posix_ConfstrName__CS_LFS64_CFLAGS)
#ifdef _CS_LFS64_CFLAGS
{*r = _CS_LFS64_CFLAGS; return 0;}
#else /* def _CS_LFS64_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS64_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_LFS64_LDFLAGS)
#ifdef _CS_LFS64_LDFLAGS
{*r = _CS_LFS64_LDFLAGS; return 0;}
#else /* def _CS_LFS64_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS64_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_LFS64_LIBS)
#ifdef _CS_LFS64_LIBS
{*r = _CS_LFS64_LIBS; return 0;}
#else /* def _CS_LFS64_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS64_LIBS */
if (x == Mono_Posix_ConfstrName__CS_LFS64_LINTFLAGS)
#ifdef _CS_LFS64_LINTFLAGS
{*r = _CS_LFS64_LINTFLAGS; return 0;}
#else /* def _CS_LFS64_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS64_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_LFS_CFLAGS)
#ifdef _CS_LFS_CFLAGS
{*r = _CS_LFS_CFLAGS; return 0;}
#else /* def _CS_LFS_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_LFS_LDFLAGS)
#ifdef _CS_LFS_LDFLAGS
{*r = _CS_LFS_LDFLAGS; return 0;}
#else /* def _CS_LFS_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_LFS_LIBS)
#ifdef _CS_LFS_LIBS
{*r = _CS_LFS_LIBS; return 0;}
#else /* def _CS_LFS_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS_LIBS */
if (x == Mono_Posix_ConfstrName__CS_LFS_LINTFLAGS)
#ifdef _CS_LFS_LINTFLAGS
{*r = _CS_LFS_LINTFLAGS; return 0;}
#else /* def _CS_LFS_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_LFS_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_PATH)
#ifdef _CS_PATH
{*r = _CS_PATH; return 0;}
#else /* def _CS_PATH */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_PATH */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_CFLAGS)
#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
{*r = _CS_POSIX_V6_ILP32_OFF32_CFLAGS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LDFLAGS)
#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
{*r = _CS_POSIX_V6_ILP32_OFF32_LDFLAGS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LIBS)
#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
{*r = _CS_POSIX_V6_ILP32_OFF32_LIBS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFF32_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS)
#ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
{*r = _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS)
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
{*r = _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
{*r = _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LIBS)
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
{*r = _CS_POSIX_V6_ILP32_OFFBIG_LIBS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS)
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
{*r = _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS; return 0;}
#else /* def _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_CFLAGS)
#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
{*r = _CS_POSIX_V6_LP64_OFF64_CFLAGS; return 0;}
#else /* def _CS_POSIX_V6_LP64_OFF64_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LDFLAGS)
#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
{*r = _CS_POSIX_V6_LP64_OFF64_LDFLAGS; return 0;}
#else /* def _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LIBS)
#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
{*r = _CS_POSIX_V6_LP64_OFF64_LIBS; return 0;}
#else /* def _CS_POSIX_V6_LP64_OFF64_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LINTFLAGS)
#ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
{*r = _CS_POSIX_V6_LP64_OFF64_LINTFLAGS; return 0;}
#else /* def _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS)
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
{*r = _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS; return 0;}
#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
{*r = _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS; return 0;}
#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LIBS)
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
{*r = _CS_POSIX_V6_LPBIG_OFFBIG_LIBS; return 0;}
#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
if (x == Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS)
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
{*r = _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS; return 0;}
#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_V6_WIDTH_RESTRICTED_ENVS)
#ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
{*r = _CS_V6_WIDTH_RESTRICTED_ENVS; return 0;}
#else /* def _CS_V6_WIDTH_RESTRICTED_ENVS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_CFLAGS)
#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
{*r = _CS_XBS5_ILP32_OFF32_CFLAGS; return 0;}
#else /* def _CS_XBS5_ILP32_OFF32_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LDFLAGS)
#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
{*r = _CS_XBS5_ILP32_OFF32_LDFLAGS; return 0;}
#else /* def _CS_XBS5_ILP32_OFF32_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LIBS)
#ifdef _CS_XBS5_ILP32_OFF32_LIBS
{*r = _CS_XBS5_ILP32_OFF32_LIBS; return 0;}
#else /* def _CS_XBS5_ILP32_OFF32_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LINTFLAGS)
#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
{*r = _CS_XBS5_ILP32_OFF32_LINTFLAGS; return 0;}
#else /* def _CS_XBS5_ILP32_OFF32_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_CFLAGS)
#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
{*r = _CS_XBS5_ILP32_OFFBIG_CFLAGS; return 0;}
#else /* def _CS_XBS5_ILP32_OFFBIG_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LDFLAGS)
#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
{*r = _CS_XBS5_ILP32_OFFBIG_LDFLAGS; return 0;}
#else /* def _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LIBS)
#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
{*r = _CS_XBS5_ILP32_OFFBIG_LIBS; return 0;}
#else /* def _CS_XBS5_ILP32_OFFBIG_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LINTFLAGS)
#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
{*r = _CS_XBS5_ILP32_OFFBIG_LINTFLAGS; return 0;}
#else /* def _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_CFLAGS)
#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
{*r = _CS_XBS5_LP64_OFF64_CFLAGS; return 0;}
#else /* def _CS_XBS5_LP64_OFF64_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LDFLAGS)
#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
{*r = _CS_XBS5_LP64_OFF64_LDFLAGS; return 0;}
#else /* def _CS_XBS5_LP64_OFF64_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LIBS)
#ifdef _CS_XBS5_LP64_OFF64_LIBS
{*r = _CS_XBS5_LP64_OFF64_LIBS; return 0;}
#else /* def _CS_XBS5_LP64_OFF64_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LINTFLAGS)
#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
{*r = _CS_XBS5_LP64_OFF64_LINTFLAGS; return 0;}
#else /* def _CS_XBS5_LP64_OFF64_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_CFLAGS)
#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
{*r = _CS_XBS5_LPBIG_OFFBIG_CFLAGS; return 0;}
#else /* def _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LDFLAGS)
#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
{*r = _CS_XBS5_LPBIG_OFFBIG_LDFLAGS; return 0;}
#else /* def _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LIBS)
#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
{*r = _CS_XBS5_LPBIG_OFFBIG_LIBS; return 0;}
#else /* def _CS_XBS5_LPBIG_OFFBIG_LIBS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
if (x == Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS)
#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
{*r = _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS; return 0;}
#else /* def _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
{errno = EINVAL; return -1;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
if (x == 0)
return 0;
errno = EINVAL; return -1;
}
int Mono_Posix_ToConfstrName (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef _CS_GNU_LIBC_VERSION
if (x == _CS_GNU_LIBC_VERSION)
{*r = Mono_Posix_ConfstrName__CS_GNU_LIBC_VERSION; return 0;}
#endif /* ndef _CS_GNU_LIBC_VERSION */
#ifdef _CS_GNU_LIBPTHREAD_VERSION
if (x == _CS_GNU_LIBPTHREAD_VERSION)
{*r = Mono_Posix_ConfstrName__CS_GNU_LIBPTHREAD_VERSION; return 0;}
#endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
#ifdef _CS_LFS64_CFLAGS
if (x == _CS_LFS64_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_LFS64_CFLAGS; return 0;}
#endif /* ndef _CS_LFS64_CFLAGS */
#ifdef _CS_LFS64_LDFLAGS
if (x == _CS_LFS64_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_LFS64_LDFLAGS; return 0;}
#endif /* ndef _CS_LFS64_LDFLAGS */
#ifdef _CS_LFS64_LIBS
if (x == _CS_LFS64_LIBS)
{*r = Mono_Posix_ConfstrName__CS_LFS64_LIBS; return 0;}
#endif /* ndef _CS_LFS64_LIBS */
#ifdef _CS_LFS64_LINTFLAGS
if (x == _CS_LFS64_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_LFS64_LINTFLAGS; return 0;}
#endif /* ndef _CS_LFS64_LINTFLAGS */
#ifdef _CS_LFS_CFLAGS
if (x == _CS_LFS_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_LFS_CFLAGS; return 0;}
#endif /* ndef _CS_LFS_CFLAGS */
#ifdef _CS_LFS_LDFLAGS
if (x == _CS_LFS_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_LFS_LDFLAGS; return 0;}
#endif /* ndef _CS_LFS_LDFLAGS */
#ifdef _CS_LFS_LIBS
if (x == _CS_LFS_LIBS)
{*r = Mono_Posix_ConfstrName__CS_LFS_LIBS; return 0;}
#endif /* ndef _CS_LFS_LIBS */
#ifdef _CS_LFS_LINTFLAGS
if (x == _CS_LFS_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_LFS_LINTFLAGS; return 0;}
#endif /* ndef _CS_LFS_LINTFLAGS */
#ifdef _CS_PATH
if (x == _CS_PATH)
{*r = Mono_Posix_ConfstrName__CS_PATH; return 0;}
#endif /* ndef _CS_PATH */
#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
if (x == _CS_POSIX_V6_ILP32_OFF32_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_CFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
if (x == _CS_POSIX_V6_ILP32_OFF32_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LDFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
if (x == _CS_POSIX_V6_ILP32_OFF32_LIBS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LIBS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
#ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
if (x == _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
if (x == _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
if (x == _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
if (x == _CS_POSIX_V6_ILP32_OFFBIG_LIBS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LIBS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
if (x == _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
if (x == _CS_POSIX_V6_LP64_OFF64_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_CFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
if (x == _CS_POSIX_V6_LP64_OFF64_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LDFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
if (x == _CS_POSIX_V6_LP64_OFF64_LIBS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LIBS; return 0;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
#ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
if (x == _CS_POSIX_V6_LP64_OFF64_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LINTFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
if (x == _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LIBS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LIBS; return 0;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS; return 0;}
#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
#ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
if (x == _CS_V6_WIDTH_RESTRICTED_ENVS)
{*r = Mono_Posix_ConfstrName__CS_V6_WIDTH_RESTRICTED_ENVS; return 0;}
#endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
if (x == _CS_XBS5_ILP32_OFF32_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_CFLAGS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
if (x == _CS_XBS5_ILP32_OFF32_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LDFLAGS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
#ifdef _CS_XBS5_ILP32_OFF32_LIBS
if (x == _CS_XBS5_ILP32_OFF32_LIBS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LIBS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
if (x == _CS_XBS5_ILP32_OFF32_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LINTFLAGS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
if (x == _CS_XBS5_ILP32_OFFBIG_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_CFLAGS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
if (x == _CS_XBS5_ILP32_OFFBIG_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LDFLAGS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
if (x == _CS_XBS5_ILP32_OFFBIG_LIBS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LIBS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
if (x == _CS_XBS5_ILP32_OFFBIG_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LINTFLAGS; return 0;}
#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
if (x == _CS_XBS5_LP64_OFF64_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_CFLAGS; return 0;}
#endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
if (x == _CS_XBS5_LP64_OFF64_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LDFLAGS; return 0;}
#endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
#ifdef _CS_XBS5_LP64_OFF64_LIBS
if (x == _CS_XBS5_LP64_OFF64_LIBS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LIBS; return 0;}
#endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
if (x == _CS_XBS5_LP64_OFF64_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LINTFLAGS; return 0;}
#endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
if (x == _CS_XBS5_LPBIG_OFFBIG_CFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_CFLAGS; return 0;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
if (x == _CS_XBS5_LPBIG_OFFBIG_LDFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LDFLAGS; return 0;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
if (x == _CS_XBS5_LPBIG_OFFBIG_LIBS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LIBS; return 0;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
if (x == _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS)
{*r = Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS; return 0;}
#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
errno = EINVAL; return -1;
}
int Mono_Posix_FromDirectoryNotifyFlags (int x, int *r)
{
*r = 0;
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_ACCESS) == Mono_Posix_DirectoryNotifyFlags_DN_ACCESS)
#ifdef DN_ACCESS
*r |= DN_ACCESS;
#else /* def DN_ACCESS */
{errno = EINVAL; return -1;}
#endif /* ndef DN_ACCESS */
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB) == Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB)
#ifdef DN_ATTRIB
*r |= DN_ATTRIB;
#else /* def DN_ATTRIB */
{errno = EINVAL; return -1;}
#endif /* ndef DN_ATTRIB */
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_CREATE) == Mono_Posix_DirectoryNotifyFlags_DN_CREATE)
#ifdef DN_CREATE
*r |= DN_CREATE;
#else /* def DN_CREATE */
{errno = EINVAL; return -1;}
#endif /* ndef DN_CREATE */
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_DELETE) == Mono_Posix_DirectoryNotifyFlags_DN_DELETE)
#ifdef DN_DELETE
*r |= DN_DELETE;
#else /* def DN_DELETE */
{errno = EINVAL; return -1;}
#endif /* ndef DN_DELETE */
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_MODIFY) == Mono_Posix_DirectoryNotifyFlags_DN_MODIFY)
#ifdef DN_MODIFY
*r |= DN_MODIFY;
#else /* def DN_MODIFY */
{errno = EINVAL; return -1;}
#endif /* ndef DN_MODIFY */
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT) == Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT)
#ifdef DN_MULTISHOT
*r |= DN_MULTISHOT;
#else /* def DN_MULTISHOT */
{errno = EINVAL; return -1;}
#endif /* ndef DN_MULTISHOT */
if ((x & Mono_Posix_DirectoryNotifyFlags_DN_RENAME) == Mono_Posix_DirectoryNotifyFlags_DN_RENAME)
#ifdef DN_RENAME
*r |= DN_RENAME;
#else /* def DN_RENAME */
{errno = EINVAL; return -1;}
#endif /* ndef DN_RENAME */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToDirectoryNotifyFlags (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef DN_ACCESS
if ((x & DN_ACCESS) == DN_ACCESS)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_ACCESS;
#endif /* ndef DN_ACCESS */
#ifdef DN_ATTRIB
if ((x & DN_ATTRIB) == DN_ATTRIB)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB;
#endif /* ndef DN_ATTRIB */
#ifdef DN_CREATE
if ((x & DN_CREATE) == DN_CREATE)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_CREATE;
#endif /* ndef DN_CREATE */
#ifdef DN_DELETE
if ((x & DN_DELETE) == DN_DELETE)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_DELETE;
#endif /* ndef DN_DELETE */
#ifdef DN_MODIFY
if ((x & DN_MODIFY) == DN_MODIFY)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_MODIFY;
#endif /* ndef DN_MODIFY */
#ifdef DN_MULTISHOT
if ((x & DN_MULTISHOT) == DN_MULTISHOT)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT;
#endif /* ndef DN_MULTISHOT */
#ifdef DN_RENAME
if ((x & DN_RENAME) == DN_RENAME)
*r |= Mono_Posix_DirectoryNotifyFlags_DN_RENAME;
#endif /* ndef DN_RENAME */
return 0;
}
int Mono_Posix_FromEpollEvents (unsigned int x, unsigned int *r)
{
*r = 0;
if ((x & Mono_Posix_EpollEvents_EPOLLERR) == Mono_Posix_EpollEvents_EPOLLERR)
#ifdef EPOLLERR
*r |= EPOLLERR;
#else /* def EPOLLERR */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLERR */
if ((x & Mono_Posix_EpollEvents_EPOLLET) == Mono_Posix_EpollEvents_EPOLLET)
#ifdef EPOLLET
*r |= EPOLLET;
#else /* def EPOLLET */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLET */
if ((x & Mono_Posix_EpollEvents_EPOLLHUP) == Mono_Posix_EpollEvents_EPOLLHUP)
#ifdef EPOLLHUP
*r |= EPOLLHUP;
#else /* def EPOLLHUP */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLHUP */
if ((x & Mono_Posix_EpollEvents_EPOLLIN) == Mono_Posix_EpollEvents_EPOLLIN)
#ifdef EPOLLIN
*r |= EPOLLIN;
#else /* def EPOLLIN */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLIN */
if ((x & Mono_Posix_EpollEvents_EPOLLMSG) == Mono_Posix_EpollEvents_EPOLLMSG)
#ifdef EPOLLMSG
*r |= EPOLLMSG;
#else /* def EPOLLMSG */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLMSG */
if ((x & Mono_Posix_EpollEvents_EPOLLONESHOT) == Mono_Posix_EpollEvents_EPOLLONESHOT)
#ifdef EPOLLONESHOT
*r |= EPOLLONESHOT;
#else /* def EPOLLONESHOT */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLONESHOT */
if ((x & Mono_Posix_EpollEvents_EPOLLOUT) == Mono_Posix_EpollEvents_EPOLLOUT)
#ifdef EPOLLOUT
*r |= EPOLLOUT;
#else /* def EPOLLOUT */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLOUT */
if ((x & Mono_Posix_EpollEvents_EPOLLPRI) == Mono_Posix_EpollEvents_EPOLLPRI)
#ifdef EPOLLPRI
*r |= EPOLLPRI;
#else /* def EPOLLPRI */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLPRI */
if ((x & Mono_Posix_EpollEvents_EPOLLRDBAND) == Mono_Posix_EpollEvents_EPOLLRDBAND)
#ifdef EPOLLRDBAND
*r |= EPOLLRDBAND;
#else /* def EPOLLRDBAND */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLRDBAND */
if ((x & Mono_Posix_EpollEvents_EPOLLRDHUP) == Mono_Posix_EpollEvents_EPOLLRDHUP)
#ifdef EPOLLRDHUP
*r |= EPOLLRDHUP;
#else /* def EPOLLRDHUP */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLRDHUP */
if ((x & Mono_Posix_EpollEvents_EPOLLRDNORM) == Mono_Posix_EpollEvents_EPOLLRDNORM)
#ifdef EPOLLRDNORM
*r |= EPOLLRDNORM;
#else /* def EPOLLRDNORM */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLRDNORM */
if ((x & Mono_Posix_EpollEvents_EPOLLWRBAND) == Mono_Posix_EpollEvents_EPOLLWRBAND)
#ifdef EPOLLWRBAND
*r |= EPOLLWRBAND;
#else /* def EPOLLWRBAND */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLWRBAND */
if ((x & Mono_Posix_EpollEvents_EPOLLWRNORM) == Mono_Posix_EpollEvents_EPOLLWRNORM)
#ifdef EPOLLWRNORM
*r |= EPOLLWRNORM;
#else /* def EPOLLWRNORM */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLLWRNORM */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToEpollEvents (unsigned int x, unsigned int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef EPOLLERR
if ((x & EPOLLERR) == EPOLLERR)
*r |= Mono_Posix_EpollEvents_EPOLLERR;
#endif /* ndef EPOLLERR */
#ifdef EPOLLET
if ((x & EPOLLET) == EPOLLET)
*r |= Mono_Posix_EpollEvents_EPOLLET;
#endif /* ndef EPOLLET */
#ifdef EPOLLHUP
if ((x & EPOLLHUP) == EPOLLHUP)
*r |= Mono_Posix_EpollEvents_EPOLLHUP;
#endif /* ndef EPOLLHUP */
#ifdef EPOLLIN
if ((x & EPOLLIN) == EPOLLIN)
*r |= Mono_Posix_EpollEvents_EPOLLIN;
#endif /* ndef EPOLLIN */
#ifdef EPOLLMSG
if ((x & EPOLLMSG) == EPOLLMSG)
*r |= Mono_Posix_EpollEvents_EPOLLMSG;
#endif /* ndef EPOLLMSG */
#ifdef EPOLLONESHOT
if ((x & EPOLLONESHOT) == EPOLLONESHOT)
*r |= Mono_Posix_EpollEvents_EPOLLONESHOT;
#endif /* ndef EPOLLONESHOT */
#ifdef EPOLLOUT
if ((x & EPOLLOUT) == EPOLLOUT)
*r |= Mono_Posix_EpollEvents_EPOLLOUT;
#endif /* ndef EPOLLOUT */
#ifdef EPOLLPRI
if ((x & EPOLLPRI) == EPOLLPRI)
*r |= Mono_Posix_EpollEvents_EPOLLPRI;
#endif /* ndef EPOLLPRI */
#ifdef EPOLLRDBAND
if ((x & EPOLLRDBAND) == EPOLLRDBAND)
*r |= Mono_Posix_EpollEvents_EPOLLRDBAND;
#endif /* ndef EPOLLRDBAND */
#ifdef EPOLLRDHUP
if ((x & EPOLLRDHUP) == EPOLLRDHUP)
*r |= Mono_Posix_EpollEvents_EPOLLRDHUP;
#endif /* ndef EPOLLRDHUP */
#ifdef EPOLLRDNORM
if ((x & EPOLLRDNORM) == EPOLLRDNORM)
*r |= Mono_Posix_EpollEvents_EPOLLRDNORM;
#endif /* ndef EPOLLRDNORM */
#ifdef EPOLLWRBAND
if ((x & EPOLLWRBAND) == EPOLLWRBAND)
*r |= Mono_Posix_EpollEvents_EPOLLWRBAND;
#endif /* ndef EPOLLWRBAND */
#ifdef EPOLLWRNORM
if ((x & EPOLLWRNORM) == EPOLLWRNORM)
*r |= Mono_Posix_EpollEvents_EPOLLWRNORM;
#endif /* ndef EPOLLWRNORM */
return 0;
}
int Mono_Posix_FromEpollFlags (int x, int *r)
{
*r = 0;
if ((x & Mono_Posix_EpollFlags_EPOLL_CLOEXEC) == Mono_Posix_EpollFlags_EPOLL_CLOEXEC)
#ifdef EPOLL_CLOEXEC
*r |= EPOLL_CLOEXEC;
#else /* def EPOLL_CLOEXEC */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLL_CLOEXEC */
if ((x & Mono_Posix_EpollFlags_EPOLL_NONBLOCK) == Mono_Posix_EpollFlags_EPOLL_NONBLOCK)
#ifdef EPOLL_NONBLOCK
*r |= EPOLL_NONBLOCK;
#else /* def EPOLL_NONBLOCK */
{errno = EINVAL; return -1;}
#endif /* ndef EPOLL_NONBLOCK */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToEpollFlags (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef EPOLL_CLOEXEC
if ((x & EPOLL_CLOEXEC) == EPOLL_CLOEXEC)
*r |= Mono_Posix_EpollFlags_EPOLL_CLOEXEC;
#endif /* ndef EPOLL_CLOEXEC */
#ifdef EPOLL_NONBLOCK
if ((x & EPOLL_NONBLOCK) == EPOLL_NONBLOCK)
*r |= Mono_Posix_EpollFlags_EPOLL_NONBLOCK;
#endif /* ndef EPOLL_NONBLOCK */
return 0;
}
int Mono_Posix_FromErrno (int x, int *r)
{
*r = 0;
if (x == Mono_Posix_Errno_E2BIG)
#ifdef E2BIG
{*r = E2BIG; return 0;}
#else /* def E2BIG */
{errno = EINVAL; return -1;}
#endif /* ndef E2BIG */
if (x == Mono_Posix_Errno_EACCES)
#ifdef EACCES
{*r = EACCES; return 0;}
#else /* def EACCES */
{errno = EINVAL; return -1;}
#endif /* ndef EACCES */
if (x == Mono_Posix_Errno_EADDRINUSE)
#ifdef EADDRINUSE
{*r = EADDRINUSE; return 0;}
#else /* def EADDRINUSE */
{errno = EINVAL; return -1;}
#endif /* ndef EADDRINUSE */
if (x == Mono_Posix_Errno_EADDRNOTAVAIL)
#ifdef EADDRNOTAVAIL
{*r = EADDRNOTAVAIL; return 0;}
#else /* def EADDRNOTAVAIL */
{errno = EINVAL; return -1;}
#endif /* ndef EADDRNOTAVAIL */
if (x == Mono_Posix_Errno_EADV)
#ifdef EADV
{*r = EADV; return 0;}
#else /* def EADV */
{errno = EINVAL; return -1;}
#endif /* ndef EADV */
if (x == Mono_Posix_Errno_EAFNOSUPPORT)
#ifdef EAFNOSUPPORT
{*r = EAFNOSUPPORT; return 0;}
#else /* def EAFNOSUPPORT */
{errno = EINVAL; return -1;}
#endif /* ndef EAFNOSUPPORT */
if (x == Mono_Posix_Errno_EAGAIN)
#ifdef EAGAIN
{*r = EAGAIN; return 0;}
#else /* def EAGAIN */
{errno = EINVAL; return -1;}
#endif /* ndef EAGAIN */
if (x == Mono_Posix_Errno_EALREADY)
#ifdef EALREADY
{*r = EALREADY; return 0;}
#else /* def EALREADY */
{errno = EINVAL; return -1;}
#endif /* ndef EALREADY */
if (x == Mono_Posix_Errno_EAUTH)
#ifdef EAUTH
{*r = EAUTH; return 0;}
#else /* def EAUTH */
{errno = EINVAL; return -1;}
#endif /* ndef EAUTH */
if (x == Mono_Posix_Errno_EBADARCH)
#ifdef EBADARCH
{*r = EBADARCH; return 0;}
#else /* def EBADARCH */
{errno = EINVAL; return -1;}
#endif /* ndef EBADARCH */
if (x == Mono_Posix_Errno_EBADE)
#ifdef EBADE
{*r = EBADE; return 0;}
#else /* def EBADE */
{errno = EINVAL; return -1;}
#endif /* ndef EBADE */
if (x == Mono_Posix_Errno_EBADEXEC)
#ifdef EBADEXEC
{*r = EBADEXEC; return 0;}
#else /* def EBADEXEC */
{errno = EINVAL; return -1;}
#endif /* ndef EBADEXEC */
if (x == Mono_Posix_Errno_EBADF)
#ifdef EBADF
{*r = EBADF; return 0;}
#else /* def EBADF */
{errno = EINVAL; return -1;}
#endif /* ndef EBADF */
if (x == Mono_Posix_Errno_EBADFD)
#ifdef EBADFD
{*r = EBADFD; return 0;}
#else /* def EBADFD */
{errno = EINVAL; return -1;}
#endif /* ndef EBADFD */
if (x == Mono_Posix_Errno_EBADMACHO)
#ifdef EBADMACHO
{*r = EBADMACHO; return 0;}
#else /* def EBADMACHO */
{errno = EINVAL; return -1;}
#endif /* ndef EBADMACHO */
if (x == Mono_Posix_Errno_EBADMSG)
#ifdef EBADMSG
{*r = EBADMSG; return 0;}
#else /* def EBADMSG */
{errno = EINVAL; return -1;}
#endif /* ndef EBADMSG */
if (x == Mono_Posix_Errno_EBADR)
#ifdef EBADR
{*r = EBADR; return 0;}
#else /* def EBADR */
{errno = EINVAL; return -1;}
#endif /* ndef EBADR */
if (x == Mono_Posix_Errno_EBADRPC)
#ifdef EBADRPC
{*r = EBADRPC; return 0;}
#else /* def EBADRPC */
{errno = EINVAL; return -1;}
#endif /* ndef EBADRPC */
if (x == Mono_Posix_Errno_EBADRQC)
#ifdef EBADRQC
{*r = EBADRQC; return 0;}
#else /* def EBADRQC */
{errno = EINVAL; return -1;}
#endif /* ndef EBADRQC */
if (x == Mono_Posix_Errno_EBADSLT)
#ifdef EBADSLT
{*r = EBADSLT; return 0;}
#else /* def EBADSLT */
{errno = EINVAL; return -1;}
#endif /* ndef EBADSLT */
if (x == Mono_Posix_Errno_EBFONT)
#ifdef EBFONT
{*r = EBFONT; return 0;}
#else /* def EBFONT */
{errno = EINVAL; return -1;}
#endif /* ndef EBFONT */
if (x == Mono_Posix_Errno_EBUSY)
#ifdef EBUSY
{*r = EBUSY; return 0;}
#else /* def EBUSY */
{errno = EINVAL; return -1;}
#endif /* ndef EBUSY */
if (x == Mono_Posix_Errno_ECANCELED)
#ifdef ECANCELED
{*r = ECANCELED; return 0;}
#else /* def ECANCELED */
{errno = EINVAL; return -1;}
#endif /* ndef ECANCELED */
if (x == Mono_Posix_Errno_ECHILD)
#ifdef ECHILD
{*r = ECHILD; return 0;}
#else /* def ECHILD */
{errno = EINVAL; return -1;}
#endif /* ndef ECHILD */
if (x == Mono_Posix_Errno_ECHRNG)
#ifdef ECHRNG
{*r = ECHRNG; return 0;}
#else /* def ECHRNG */
{errno = EINVAL; return -1;}
#endif /* ndef ECHRNG */
if (x == Mono_Posix_Errno_ECOMM)
#ifdef ECOMM
{*r = ECOMM; return 0;}
#else /* def ECOMM */
{errno = EINVAL; return -1;}
#endif /* ndef ECOMM */
if (x == Mono_Posix_Errno_ECONNABORTED)
#ifdef ECONNABORTED
{*r = ECONNABORTED; return 0;}
#else /* def ECONNABORTED */
{errno = EINVAL; return -1;}
#endif /* ndef ECONNABORTED */
if (x == Mono_Posix_Errno_ECONNREFUSED)
#ifdef ECONNREFUSED
{*r = ECONNREFUSED; return 0;}
#else /* def ECONNREFUSED */
{errno = EINVAL; return -1;}
#endif /* ndef ECONNREFUSED */
if (x == Mono_Posix_Errno_ECONNRESET)
#ifdef ECONNRESET
{*r = ECONNRESET; return 0;}
#else /* def ECONNRESET */
{errno = EINVAL; return -1;}
#endif /* ndef ECONNRESET */
if (x == Mono_Posix_Errno_EDEADLK)
#ifdef EDEADLK
{*r = EDEADLK; return 0;}
#else /* def EDEADLK */
{errno = EINVAL; return -1;}
#endif /* ndef EDEADLK */
if (x == Mono_Posix_Errno_EDEADLOCK)
#ifdef EDEADLOCK
{*r = EDEADLOCK; return 0;}
#else /* def EDEADLOCK */
{errno = EINVAL; return -1;}
#endif /* ndef EDEADLOCK */
if (x == Mono_Posix_Errno_EDESTADDRREQ)
#ifdef EDESTADDRREQ
{*r = EDESTADDRREQ; return 0;}
#else /* def EDESTADDRREQ */
{errno = EINVAL; return -1;}
#endif /* ndef EDESTADDRREQ */
if (x == Mono_Posix_Errno_EDEVERR)
#ifdef EDEVERR
{*r = EDEVERR; return 0;}
#else /* def EDEVERR */
{errno = EINVAL; return -1;}
#endif /* ndef EDEVERR */
if (x == Mono_Posix_Errno_EDOM)
#ifdef EDOM
{*r = EDOM; return 0;}
#else /* def EDOM */
{errno = EINVAL; return -1;}
#endif /* ndef EDOM */
if (x == Mono_Posix_Errno_EDOTDOT)
#ifdef EDOTDOT
{*r = EDOTDOT; return 0;}
#else /* def EDOTDOT */
{errno = EINVAL; return -1;}
#endif /* ndef EDOTDOT */
if (x == Mono_Posix_Errno_EDQUOT)
#ifdef EDQUOT
{*r = EDQUOT; return 0;}
#else /* def EDQUOT */
{errno = EINVAL; return -1;}
#endif /* ndef EDQUOT */
if (x == Mono_Posix_Errno_EEXIST)
#ifdef EEXIST
{*r = EEXIST; return 0;}
#else /* def EEXIST */
{errno = EINVAL; return -1;}
#endif /* ndef EEXIST */
if (x == Mono_Posix_Errno_EFAULT)
#ifdef EFAULT
{*r = EFAULT; return 0;}
#else /* def EFAULT */
{errno = EINVAL; return -1;}
#endif /* ndef EFAULT */
if (x == Mono_Posix_Errno_EFBIG)
#ifdef EFBIG
{*r = EFBIG; return 0;}
#else /* def EFBIG */
{errno = EINVAL; return -1;}
#endif /* ndef EFBIG */
if (x == Mono_Posix_Errno_EFTYPE)
#ifdef EFTYPE
{*r = EFTYPE; return 0;}
#else /* def EFTYPE */
{errno = EINVAL; return -1;}
#endif /* ndef EFTYPE */
if (x == Mono_Posix_Errno_EHOSTDOWN)
#ifdef EHOSTDOWN
{*r = EHOSTDOWN; return 0;}
#else /* def EHOSTDOWN */
{errno = EINVAL; return -1;}
#endif /* ndef EHOSTDOWN */
if (x == Mono_Posix_Errno_EHOSTUNREACH)
#ifdef EHOSTUNREACH
{*r = EHOSTUNREACH; return 0;}
#else /* def EHOSTUNREACH */
{errno = EINVAL; return -1;}
#endif /* ndef EHOSTUNREACH */
if (x == Mono_Posix_Errno_EIDRM)
#ifdef EIDRM
{*r = EIDRM; return 0;}
#else /* def EIDRM */
{errno = EINVAL; return -1;}
#endif /* ndef EIDRM */
if (x == Mono_Posix_Errno_EILSEQ)
#ifdef EILSEQ
{*r = EILSEQ; return 0;}
#else /* def EILSEQ */
{errno = EINVAL; return -1;}
#endif /* ndef EILSEQ */
if (x == Mono_Posix_Errno_EINPROGRESS)
#ifdef EINPROGRESS
{*r = EINPROGRESS; return 0;}
#else /* def EINPROGRESS */
{errno = EINVAL; return -1;}
#endif /* ndef EINPROGRESS */
if (x == Mono_Posix_Errno_EINTR)
#ifdef EINTR
{*r = EINTR; return 0;}
#else /* def EINTR */
{errno = EINVAL; return -1;}
#endif /* ndef EINTR */
if (x == Mono_Posix_Errno_EINVAL)
#ifdef EINVAL
{*r = EINVAL; return 0;}
#else /* def EINVAL */
{errno = EINVAL; return -1;}
#endif /* ndef EINVAL */
if (x == Mono_Posix_Errno_EIO)
#ifdef EIO
{*r = EIO; return 0;}
#else /* def EIO */
{errno = EINVAL; return -1;}
#endif /* ndef EIO */
if (x == Mono_Posix_Errno_EISCONN)
#ifdef EISCONN
{*r = EISCONN; return 0;}
#else /* def EISCONN */
{errno = EINVAL; return -1;}
#endif /* ndef EISCONN */
if (x == Mono_Posix_Errno_EISDIR)
#ifdef EISDIR
{*r = EISDIR; return 0;}
#else /* def EISDIR */
{errno = EINVAL; return -1;}
#endif /* ndef EISDIR */
if (x == Mono_Posix_Errno_EISNAM)
#ifdef EISNAM
{*r = EISNAM; return 0;}
#else /* def EISNAM */
{errno = EINVAL; return -1;}
#endif /* ndef EISNAM */
if (x == Mono_Posix_Errno_EKEYEXPIRED)
#ifdef EKEYEXPIRED
{*r = EKEYEXPIRED; return 0;}
#else /* def EKEYEXPIRED */
{errno = EINVAL; return -1;}
#endif /* ndef EKEYEXPIRED */
if (x == Mono_Posix_Errno_EKEYREJECTED)
#ifdef EKEYREJECTED
{*r = EKEYREJECTED; return 0;}
#else /* def EKEYREJECTED */
{errno = EINVAL; return -1;}
#endif /* ndef EKEYREJECTED */
if (x == Mono_Posix_Errno_EKEYREVOKED)
#ifdef EKEYREVOKED
{*r = EKEYREVOKED; return 0;}
#else /* def EKEYREVOKED */
{errno = EINVAL; return -1;}
#endif /* ndef EKEYREVOKED */
if (x == Mono_Posix_Errno_EL2HLT)
#ifdef EL2HLT
{*r = EL2HLT; return 0;}
#else /* def EL2HLT */
{errno = EINVAL; return -1;}
#endif /* ndef EL2HLT */
if (x == Mono_Posix_Errno_EL2NSYNC)
#ifdef EL2NSYNC
{*r = EL2NSYNC; return 0;}
#else /* def EL2NSYNC */
{errno = EINVAL; return -1;}
#endif /* ndef EL2NSYNC */
if (x == Mono_Posix_Errno_EL3HLT)
#ifdef EL3HLT
{*r = EL3HLT; return 0;}
#else /* def EL3HLT */
{errno = EINVAL; return -1;}
#endif /* ndef EL3HLT */
if (x == Mono_Posix_Errno_EL3RST)
#ifdef EL3RST
{*r = EL3RST; return 0;}
#else /* def EL3RST */
{errno = EINVAL; return -1;}
#endif /* ndef EL3RST */
if (x == Mono_Posix_Errno_ELIBACC)
#ifdef ELIBACC
{*r = ELIBACC; return 0;}
#else /* def ELIBACC */
{errno = EINVAL; return -1;}
#endif /* ndef ELIBACC */
if (x == Mono_Posix_Errno_ELIBBAD)
#ifdef ELIBBAD
{*r = ELIBBAD; return 0;}
#else /* def ELIBBAD */
{errno = EINVAL; return -1;}
#endif /* ndef ELIBBAD */
if (x == Mono_Posix_Errno_ELIBEXEC)
#ifdef ELIBEXEC
{*r = ELIBEXEC; return 0;}
#else /* def ELIBEXEC */
{errno = EINVAL; return -1;}
#endif /* ndef ELIBEXEC */
if (x == Mono_Posix_Errno_ELIBMAX)
#ifdef ELIBMAX
{*r = ELIBMAX; return 0;}
#else /* def ELIBMAX */
{errno = EINVAL; return -1;}
#endif /* ndef ELIBMAX */
if (x == Mono_Posix_Errno_ELIBSCN)
#ifdef ELIBSCN
{*r = ELIBSCN; return 0;}
#else /* def ELIBSCN */
{errno = EINVAL; return -1;}
#endif /* ndef ELIBSCN */
if (x == Mono_Posix_Errno_ELNRNG)
#ifdef ELNRNG
{*r = ELNRNG; return 0;}
#else /* def ELNRNG */
{errno = EINVAL; return -1;}
#endif /* ndef ELNRNG */
if (x == Mono_Posix_Errno_ELOOP)
#ifdef ELOOP
{*r = ELOOP; return 0;}
#else /* def ELOOP */
{errno = EINVAL; return -1;}
#endif /* ndef ELOOP */
if (x == Mono_Posix_Errno_EMEDIUMTYPE)
#ifdef EMEDIUMTYPE
{*r = EMEDIUMTYPE; return 0;}
#else /* def EMEDIUMTYPE */
{errno = EINVAL; return -1;}
#endif /* ndef EMEDIUMTYPE */
if (x == Mono_Posix_Errno_EMFILE)
#ifdef EMFILE
{*r = EMFILE; return 0;}
#else /* def EMFILE */
{errno = EINVAL; return -1;}
#endif /* ndef EMFILE */
if (x == Mono_Posix_Errno_EMLINK)
#ifdef EMLINK
{*r = EMLINK; return 0;}
#else /* def EMLINK */
{errno = EINVAL; return -1;}
#endif /* ndef EMLINK */
if (x == Mono_Posix_Errno_EMSGSIZE)
#ifdef EMSGSIZE
{*r = EMSGSIZE; return 0;}
#else /* def EMSGSIZE */
{errno = EINVAL; return -1;}
#endif /* ndef EMSGSIZE */
if (x == Mono_Posix_Errno_EMULTIHOP)
#ifdef EMULTIHOP
{*r = EMULTIHOP; return 0;}
#else /* def EMULTIHOP */
{errno = EINVAL; return -1;}
#endif /* ndef EMULTIHOP */
if (x == Mono_Posix_Errno_ENAMETOOLONG)
#ifdef ENAMETOOLONG
{*r = ENAMETOOLONG; return 0;}
#else /* def ENAMETOOLONG */
{errno = EINVAL; return -1;}
#endif /* ndef ENAMETOOLONG */
if (x == Mono_Posix_Errno_ENAVAIL)
#ifdef ENAVAIL
{*r = ENAVAIL; return 0;}
#else /* def ENAVAIL */
{errno = EINVAL; return -1;}
#endif /* ndef ENAVAIL */
if (x == Mono_Posix_Errno_ENEEDAUTH)
#ifdef ENEEDAUTH
{*r = ENEEDAUTH; return 0;}
#else /* def ENEEDAUTH */
{errno = EINVAL; return -1;}
#endif /* ndef ENEEDAUTH */
if (x == Mono_Posix_Errno_ENETDOWN)
#ifdef ENETDOWN
{*r = ENETDOWN; return 0;}
#else /* def ENETDOWN */
{errno = EINVAL; return -1;}
#endif /* ndef ENETDOWN */
if (x == Mono_Posix_Errno_ENETRESET)
#ifdef ENETRESET
{*r = ENETRESET; return 0;}
#else /* def ENETRESET */
{errno = EINVAL; return -1;}
#endif /* ndef ENETRESET */
if (x == Mono_Posix_Errno_ENETUNREACH)
#ifdef ENETUNREACH
{*r = ENETUNREACH; return 0;}
#else /* def ENETUNREACH */
{errno = EINVAL; return -1;}
#endif /* ndef ENETUNREACH */
if (x == Mono_Posix_Errno_ENFILE)
#ifdef ENFILE
{*r = ENFILE; return 0;}
#else /* def ENFILE */
{errno = EINVAL; return -1;}
#endif /* ndef ENFILE */
if (x == Mono_Posix_Errno_ENOANO)
#ifdef ENOANO
{*r = ENOANO; return 0;}
#else /* def ENOANO */
{errno = EINVAL; return -1;}
#endif /* ndef ENOANO */
if (x == Mono_Posix_Errno_ENOATTR)
#ifdef ENOATTR
{*r = ENOATTR; return 0;}
#else /* def ENOATTR */
{errno = EINVAL; return -1;}
#endif /* ndef ENOATTR */
if (x == Mono_Posix_Errno_ENOBUFS)
#ifdef ENOBUFS
{*r = ENOBUFS; return 0;}
#else /* def ENOBUFS */
{errno = EINVAL; return -1;}
#endif /* ndef ENOBUFS */
if (x == Mono_Posix_Errno_ENOCSI)
#ifdef ENOCSI
{*r = ENOCSI; return 0;}
#else /* def ENOCSI */
{errno = EINVAL; return -1;}
#endif /* ndef ENOCSI */
if (x == Mono_Posix_Errno_ENODATA)
#ifdef ENODATA
{*r = ENODATA; return 0;}
#else /* def ENODATA */
{errno = EINVAL; return -1;}
#endif /* ndef ENODATA */
if (x == Mono_Posix_Errno_ENODEV)
#ifdef ENODEV
{*r = ENODEV; return 0;}
#else /* def ENODEV */
{errno = EINVAL; return -1;}
#endif /* ndef ENODEV */
if (x == Mono_Posix_Errno_ENOENT)
#ifdef ENOENT
{*r = ENOENT; return 0;}
#else /* def ENOENT */
{errno = EINVAL; return -1;}
#endif /* ndef ENOENT */
if (x == Mono_Posix_Errno_ENOEXEC)
#ifdef ENOEXEC
{*r = ENOEXEC; return 0;}
#else /* def ENOEXEC */
{errno = EINVAL; return -1;}
#endif /* ndef ENOEXEC */
if (x == Mono_Posix_Errno_ENOKEY)
#ifdef ENOKEY
{*r = ENOKEY; return 0;}
#else /* def ENOKEY */
{errno = EINVAL; return -1;}
#endif /* ndef ENOKEY */
if (x == Mono_Posix_Errno_ENOLCK)
#ifdef ENOLCK
{*r = ENOLCK; return 0;}
#else /* def ENOLCK */
{errno = EINVAL; return -1;}
#endif /* ndef ENOLCK */
if (x == Mono_Posix_Errno_ENOLINK)
#ifdef ENOLINK
{*r = ENOLINK; return 0;}
#else /* def ENOLINK */
{errno = EINVAL; return -1;}
#endif /* ndef ENOLINK */
if (x == Mono_Posix_Errno_ENOMEDIUM)
#ifdef ENOMEDIUM
{*r = ENOMEDIUM; return 0;}
#else /* def ENOMEDIUM */
{errno = EINVAL; return -1;}
#endif /* ndef ENOMEDIUM */
if (x == Mono_Posix_Errno_ENOMEM)
#ifdef ENOMEM
{*r = ENOMEM; return 0;}
#else /* def ENOMEM */
{errno = EINVAL; return -1;}
#endif /* ndef ENOMEM */
if (x == Mono_Posix_Errno_ENOMSG)
#ifdef ENOMSG
{*r = ENOMSG; return 0;}
#else /* def ENOMSG */
{errno = EINVAL; return -1;}
#endif /* ndef ENOMSG */
if (x == Mono_Posix_Errno_ENONET)
#ifdef ENONET
{*r = ENONET; return 0;}
#else /* def ENONET */
{errno = EINVAL; return -1;}
#endif /* ndef ENONET */
if (x == Mono_Posix_Errno_ENOPKG)
#ifdef ENOPKG
{*r = ENOPKG; return 0;}
#else /* def ENOPKG */
{errno = EINVAL; return -1;}
#endif /* ndef ENOPKG */
if (x == Mono_Posix_Errno_ENOPOLICY)
#ifdef ENOPOLICY
{*r = ENOPOLICY; return 0;}
#else /* def ENOPOLICY */
{errno = EINVAL; return -1;}
#endif /* ndef ENOPOLICY */
if (x == Mono_Posix_Errno_ENOPROTOOPT)
#ifdef ENOPROTOOPT
{*r = ENOPROTOOPT; return 0;}
#else /* def ENOPROTOOPT */
{errno = EINVAL; return -1;}
#endif /* ndef ENOPROTOOPT */
if (x == Mono_Posix_Errno_ENOSPC)
#ifdef ENOSPC
{*r = ENOSPC; return 0;}
#else /* def ENOSPC */
{errno = EINVAL; return -1;}
#endif /* ndef ENOSPC */
if (x == Mono_Posix_Errno_ENOSR)
#ifdef ENOSR
{*r = ENOSR; return 0;}
#else /* def ENOSR */
{errno = EINVAL; return -1;}
#endif /* ndef ENOSR */
if (x == Mono_Posix_Errno_ENOSTR)
#ifdef ENOSTR
{*r = ENOSTR; return 0;}
#else /* def ENOSTR */
{errno = EINVAL; return -1;}
#endif /* ndef ENOSTR */
if (x == Mono_Posix_Errno_ENOSYS)
#ifdef ENOSYS
{*r = ENOSYS; return 0;}
#else /* def ENOSYS */
{errno = EINVAL; return -1;}
#endif /* ndef ENOSYS */
if (x == Mono_Posix_Errno_ENOTBLK)
#ifdef ENOTBLK
{*r = ENOTBLK; return 0;}
#else /* def ENOTBLK */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTBLK */
if (x == Mono_Posix_Errno_ENOTCONN)
#ifdef ENOTCONN
{*r = ENOTCONN; return 0;}
#else /* def ENOTCONN */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTCONN */
if (x == Mono_Posix_Errno_ENOTDIR)
#ifdef ENOTDIR
{*r = ENOTDIR; return 0;}
#else /* def ENOTDIR */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTDIR */
if (x == Mono_Posix_Errno_ENOTEMPTY)
#ifdef ENOTEMPTY
{*r = ENOTEMPTY; return 0;}
#else /* def ENOTEMPTY */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTEMPTY */
if (x == Mono_Posix_Errno_ENOTNAM)
#ifdef ENOTNAM
{*r = ENOTNAM; return 0;}
#else /* def ENOTNAM */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTNAM */
if (x == Mono_Posix_Errno_ENOTRECOVERABLE)
#ifdef ENOTRECOVERABLE
{*r = ENOTRECOVERABLE; return 0;}
#else /* def ENOTRECOVERABLE */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTRECOVERABLE */
if (x == Mono_Posix_Errno_ENOTSOCK)
#ifdef ENOTSOCK
{*r = ENOTSOCK; return 0;}
#else /* def ENOTSOCK */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTSOCK */
if (x == Mono_Posix_Errno_ENOTTY)
#ifdef ENOTTY
{*r = ENOTTY; return 0;}
#else /* def ENOTTY */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTTY */
if (x == Mono_Posix_Errno_ENOTUNIQ)
#ifdef ENOTUNIQ
{*r = ENOTUNIQ; return 0;}
#else /* def ENOTUNIQ */
{errno = EINVAL; return -1;}
#endif /* ndef ENOTUNIQ */
if (x == Mono_Posix_Errno_ENXIO)
#ifdef ENXIO
{*r = ENXIO; return 0;}
#else /* def ENXIO */
{errno = EINVAL; return -1;}
#endif /* ndef ENXIO */
if (x == Mono_Posix_Errno_EOPNOTSUPP)
#ifdef EOPNOTSUPP
{*r = EOPNOTSUPP; return 0;}
#else /* def EOPNOTSUPP */
{errno = EINVAL; return -1;}
#endif /* ndef EOPNOTSUPP */
if (x == Mono_Posix_Errno_EOVERFLOW)
#ifdef EOVERFLOW
{*r = EOVERFLOW; return 0;}
#else /* def EOVERFLOW */
{errno = EINVAL; return -1;}
#endif /* ndef EOVERFLOW */
if (x == Mono_Posix_Errno_EOWNERDEAD)
#ifdef EOWNERDEAD
{*r = EOWNERDEAD; return 0;}
#else /* def EOWNERDEAD */
{errno = EINVAL; return -1;}
#endif /* ndef EOWNERDEAD */
if (x == Mono_Posix_Errno_EPERM)
#ifdef EPERM
{*r = EPERM; return 0;}
#else /* def EPERM */
{errno = EINVAL; return -1;}
#endif /* ndef EPERM */
if (x == Mono_Posix_Errno_EPFNOSUPPORT)
#ifdef EPFNOSUPPORT
{*r = EPFNOSUPPORT; return 0;}
#else /* def EPFNOSUPPORT */
{errno = EINVAL; return -1;}
#endif /* ndef EPFNOSUPPORT */
if (x == Mono_Posix_Errno_EPIPE)
#ifdef EPIPE
{*r = EPIPE; return 0;}
#else /* def EPIPE */
{errno = EINVAL; return -1;}
#endif /* ndef EPIPE */
if (x == Mono_Posix_Errno_EPROCLIM)
#ifdef EPROCLIM
{*r = EPROCLIM; return 0;}
#else /* def EPROCLIM */
{errno = EINVAL; return -1;}
#endif /* ndef EPROCLIM */
if (x == Mono_Posix_Errno_EPROCUNAVAIL)
#ifdef EPROCUNAVAIL
{*r = EPROCUNAVAIL; return 0;}
#else /* def EPROCUNAVAIL */
{errno = EINVAL; return -1;}
#endif /* ndef EPROCUNAVAIL */
if (x == Mono_Posix_Errno_EPROGMISMATCH)
#ifdef EPROGMISMATCH
{*r = EPROGMISMATCH; return 0;}
#else /* def EPROGMISMATCH */
{errno = EINVAL; return -1;}
#endif /* ndef EPROGMISMATCH */
if (x == Mono_Posix_Errno_EPROGUNAVAIL)
#ifdef EPROGUNAVAIL
{*r = EPROGUNAVAIL; return 0;}
#else /* def EPROGUNAVAIL */
{errno = EINVAL; return -1;}
#endif /* ndef EPROGUNAVAIL */
if (x == Mono_Posix_Errno_EPROTO)
#ifdef EPROTO
{*r = EPROTO; return 0;}
#else /* def EPROTO */
{errno = EINVAL; return -1;}
#endif /* ndef EPROTO */
if (x == Mono_Posix_Errno_EPROTONOSUPPORT)
#ifdef EPROTONOSUPPORT
{*r = EPROTONOSUPPORT; return 0;}
#else /* def EPROTONOSUPPORT */
{errno = EINVAL; return -1;}
#endif /* ndef EPROTONOSUPPORT */
if (x == Mono_Posix_Errno_EPROTOTYPE)
#ifdef EPROTOTYPE
{*r = EPROTOTYPE; return 0;}
#else /* def EPROTOTYPE */
{errno = EINVAL; return -1;}
#endif /* ndef EPROTOTYPE */
if (x == Mono_Posix_Errno_EPWROFF)
#ifdef EPWROFF
{*r = EPWROFF; return 0;}
#else /* def EPWROFF */
{errno = EINVAL; return -1;}
#endif /* ndef EPWROFF */
if (x == Mono_Posix_Errno_ERANGE)
#ifdef ERANGE
{*r = ERANGE; return 0;}
#else /* def ERANGE */
{errno = EINVAL; return -1;}
#endif /* ndef ERANGE */
if (x == Mono_Posix_Errno_EREMCHG)
#ifdef EREMCHG
{*r = EREMCHG; return 0;}
#else /* def EREMCHG */
{errno = EINVAL; return -1;}
#endif /* ndef EREMCHG */
if (x == Mono_Posix_Errno_EREMOTE)
#ifdef EREMOTE
{*r = EREMOTE; return 0;}
#else /* def EREMOTE */
{errno = EINVAL; return -1;}
#endif /* ndef EREMOTE */
if (x == Mono_Posix_Errno_EREMOTEIO)
#ifdef EREMOTEIO
{*r = EREMOTEIO; return 0;}
#else /* def EREMOTEIO */
{errno = EINVAL; return -1;}
#endif /* ndef EREMOTEIO */
if (x == Mono_Posix_Errno_ERESTART)
#ifdef ERESTART
{*r = ERESTART; return 0;}
#else /* def ERESTART */
{errno = EINVAL; return -1;}
#endif /* ndef ERESTART */
if (x == Mono_Posix_Errno_EROFS)
#ifdef EROFS
{*r = EROFS; return 0;}
#else /* def EROFS */
{errno = EINVAL; return -1;}
#endif /* ndef EROFS */
if (x == Mono_Posix_Errno_ERPCMISMATCH)
#ifdef ERPCMISMATCH
{*r = ERPCMISMATCH; return 0;}
#else /* def ERPCMISMATCH */
{errno = EINVAL; return -1;}
#endif /* ndef ERPCMISMATCH */
if (x == Mono_Posix_Errno_ESHLIBVERS)
#ifdef ESHLIBVERS
{*r = ESHLIBVERS; return 0;}
#else /* def ESHLIBVERS */
{errno = EINVAL; return -1;}
#endif /* ndef ESHLIBVERS */
if (x == Mono_Posix_Errno_ESHUTDOWN)
#ifdef ESHUTDOWN
{*r = ESHUTDOWN; return 0;}
#else /* def ESHUTDOWN */
{errno = EINVAL; return -1;}
#endif /* ndef ESHUTDOWN */
if (x == Mono_Posix_Errno_ESOCKTNOSUPPORT)
#ifdef ESOCKTNOSUPPORT
{*r = ESOCKTNOSUPPORT; return 0;}
#else /* def ESOCKTNOSUPPORT */
{errno = EINVAL; return -1;}
#endif /* ndef ESOCKTNOSUPPORT */
if (x == Mono_Posix_Errno_ESPIPE)
#ifdef ESPIPE
{*r = ESPIPE; return 0;}
#else /* def ESPIPE */
{errno = EINVAL; return -1;}
#endif /* ndef ESPIPE */
if (x == Mono_Posix_Errno_ESRCH)
#ifdef ESRCH
{*r = ESRCH; return 0;}
#else /* def ESRCH */
{errno = EINVAL; return -1;}
#endif /* ndef ESRCH */
if (x == Mono_Posix_Errno_ESRMNT)
#ifdef ESRMNT
{*r = ESRMNT; return 0;}
#else /* def ESRMNT */
{errno = EINVAL; return -1;}
#endif /* ndef ESRMNT */
if (x == Mono_Posix_Errno_ESTALE)
#ifdef ESTALE
{*r = ESTALE; return 0;}
#else /* def ESTALE */
{errno = EINVAL; return -1;}
#endif /* ndef ESTALE */
if (x == Mono_Posix_Errno_ESTRPIPE)
#ifdef ESTRPIPE
{*r = ESTRPIPE; return 0;}
#else /* def ESTRPIPE */
{errno = EINVAL; return -1;}
#endif /* ndef ESTRPIPE */
if (x == Mono_Posix_Errno_ETIME)
#ifdef ETIME
{*r = ETIME; return 0;}
#else /* def ETIME */
{errno = EINVAL; return -1;}
#endif /* ndef ETIME */
if (x == Mono_Posix_Errno_ETIMEDOUT)
#ifdef ETIMEDOUT
{*r = ETIMEDOUT; return 0;}
#else /* def ETIMEDOUT */
{errno = EINVAL; return -1;}
#endif /* ndef ETIMEDOUT */
if (x == Mono_Posix_Errno_ETOOMANYREFS)
#ifdef ETOOMANYREFS
{*r = ETOOMANYREFS; return 0;}
#else /* def ETOOMANYREFS */
{errno = EINVAL; return -1;}
#endif /* ndef ETOOMANYREFS */
if (x == Mono_Posix_Errno_ETXTBSY)
#ifdef ETXTBSY
{*r = ETXTBSY; return 0;}
#else /* def ETXTBSY */
{errno = EINVAL; return -1;}
#endif /* ndef ETXTBSY */
if (x == Mono_Posix_Errno_EUCLEAN)
#ifdef EUCLEAN
{*r = EUCLEAN; return 0;}
#else /* def EUCLEAN */
{errno = EINVAL; return -1;}
#endif /* ndef EUCLEAN */
if (x == Mono_Posix_Errno_EUNATCH)
#ifdef EUNATCH
{*r = EUNATCH; return 0;}
#else /* def EUNATCH */
{errno = EINVAL; return -1;}
#endif /* ndef EUNATCH */
if (x == Mono_Posix_Errno_EUSERS)
#ifdef EUSERS
{*r = EUSERS; return 0;}
#else /* def EUSERS */
{errno = EINVAL; return -1;}
#endif /* ndef EUSERS */
if (x == Mono_Posix_Errno_EWOULDBLOCK)
#ifdef EWOULDBLOCK
{*r = EWOULDBLOCK; return 0;}
#else /* def EWOULDBLOCK */
{errno = EINVAL; return -1;}
#endif /* ndef EWOULDBLOCK */
if (x == Mono_Posix_Errno_EXDEV)
#ifdef EXDEV
{*r = EXDEV; return 0;}
#else /* def EXDEV */
{errno = EINVAL; return -1;}
#endif /* ndef EXDEV */
if (x == Mono_Posix_Errno_EXFULL)
#ifdef EXFULL
{*r = EXFULL; return 0;}
#else /* def EXFULL */
{errno = EINVAL; return -1;}
#endif /* ndef EXFULL */
if (x == 0)
return 0;
errno = EINVAL; return -1;
}
int Mono_Posix_ToErrno (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef E2BIG
if (x == E2BIG)
{*r = Mono_Posix_Errno_E2BIG; return 0;}
#endif /* ndef E2BIG */
#ifdef EACCES
if (x == EACCES)
{*r = Mono_Posix_Errno_EACCES; return 0;}
#endif /* ndef EACCES */
#ifdef EADDRINUSE
if (x == EADDRINUSE)
{*r = Mono_Posix_Errno_EADDRINUSE; return 0;}
#endif /* ndef EADDRINUSE */
#ifdef EADDRNOTAVAIL
if (x == EADDRNOTAVAIL)
{*r = Mono_Posix_Errno_EADDRNOTAVAIL; return 0;}
#endif /* ndef EADDRNOTAVAIL */
#ifdef EADV
if (x == EADV)
{*r = Mono_Posix_Errno_EADV; return 0;}
#endif /* ndef EADV */
#ifdef EAFNOSUPPORT
if (x == EAFNOSUPPORT)
{*r = Mono_Posix_Errno_EAFNOSUPPORT; return 0;}
#endif /* ndef EAFNOSUPPORT */
#ifdef EAGAIN
if (x == EAGAIN)
{*r = Mono_Posix_Errno_EAGAIN; return 0;}
#endif /* ndef EAGAIN */
#ifdef EALREADY
if (x == EALREADY)
{*r = Mono_Posix_Errno_EALREADY; return 0;}
#endif /* ndef EALREADY */
#ifdef EAUTH
if (x == EAUTH)
{*r = Mono_Posix_Errno_EAUTH; return 0;}
#endif /* ndef EAUTH */
#ifdef EBADARCH
if (x == EBADARCH)
{*r = Mono_Posix_Errno_EBADARCH; return 0;}
#endif /* ndef EBADARCH */
#ifdef EBADE
if (x == EBADE)
{*r = Mono_Posix_Errno_EBADE; return 0;}
#endif /* ndef EBADE */
#ifdef EBADEXEC
if (x == EBADEXEC)
{*r = Mono_Posix_Errno_EBADEXEC; return 0;}
#endif /* ndef EBADEXEC */
#ifdef EBADF
if (x == EBADF)
{*r = Mono_Posix_Errno_EBADF; return 0;}
#endif /* ndef EBADF */
#ifdef EBADFD
if (x == EBADFD)
{*r = Mono_Posix_Errno_EBADFD; return 0;}
#endif /* ndef EBADFD */
#ifdef EBADMACHO
if (x == EBADMACHO)
{*r = Mono_Posix_Errno_EBADMACHO; return 0;}
#endif /* ndef EBADMACHO */
#ifdef EBADMSG
if (x == EBADMSG)
{*r = Mono_Posix_Errno_EBADMSG; return 0;}
#endif /* ndef EBADMSG */
#ifdef EBADR
if (x == EBADR)
{*r = Mono_Posix_Errno_EBADR; return 0;}
#endif /* ndef EBADR */
#ifdef EBADRPC
if (x == EBADRPC)
{*r = Mono_Posix_Errno_EBADRPC; return 0;}
#endif /* ndef EBADRPC */
#ifdef EBADRQC
if (x == EBADRQC)
{*r = Mono_Posix_Errno_EBADRQC; return 0;}
#endif /* ndef EBADRQC */
#ifdef EBADSLT
if (x == EBADSLT)
{*r = Mono_Posix_Errno_EBADSLT; return 0;}
#endif /* ndef EBADSLT */
#ifdef EBFONT
if (x == EBFONT)
{*r = Mono_Posix_Errno_EBFONT; return 0;}
#endif /* ndef EBFONT */
#ifdef EBUSY
if (x == EBUSY)
{*r = Mono_Posix_Errno_EBUSY; return 0;}
#endif /* ndef EBUSY */
#ifdef ECANCELED
if (x == ECANCELED)
{*r = Mono_Posix_Errno_ECANCELED; return 0;}
#endif /* ndef ECANCELED */
#ifdef ECHILD
if (x == ECHILD)
{*r = Mono_Posix_Errno_ECHILD; return 0;}
#endif /* ndef ECHILD */
#ifdef ECHRNG
if (x == ECHRNG)
{*r = Mono_Posix_Errno_ECHRNG; return 0;}
#endif /* ndef ECHRNG */
#ifdef ECOMM
if (x == ECOMM)
{*r = Mono_Posix_Errno_ECOMM; return 0;}
#endif /* ndef ECOMM */
#ifdef ECONNABORTED
if (x == ECONNABORTED)
{*r = Mono_Posix_Errno_ECONNABORTED; return 0;}
#endif /* ndef ECONNABORTED */
#ifdef ECONNREFUSED
if (x == ECONNREFUSED)
{*r = Mono_Posix_Errno_ECONNREFUSED; return 0;}
#endif /* ndef ECONNREFUSED */
#ifdef ECONNRESET
if (x == ECONNRESET)
{*r = Mono_Posix_Errno_ECONNRESET; return 0;}
#endif /* ndef ECONNRESET */
#ifdef EDEADLK
if (x == EDEADLK)
{*r = Mono_Posix_Errno_EDEADLK; return 0;}
#endif /* ndef EDEADLK */
#ifdef EDEADLOCK
if (x == EDEADLOCK)
{*r = Mono_Posix_Errno_EDEADLOCK; return 0;}
#endif /* ndef EDEADLOCK */
#ifdef EDESTADDRREQ
if (x == EDESTADDRREQ)
{*r = Mono_Posix_Errno_EDESTADDRREQ; return 0;}
#endif /* ndef EDESTADDRREQ */
#ifdef EDEVERR
if (x == EDEVERR)
{*r = Mono_Posix_Errno_EDEVERR; return 0;}
#endif /* ndef EDEVERR */
#ifdef EDOM
if (x == EDOM)
{*r = Mono_Posix_Errno_EDOM; return 0;}
#endif /* ndef EDOM */
#ifdef EDOTDOT
if (x == EDOTDOT)
{*r = Mono_Posix_Errno_EDOTDOT; return 0;}
#endif /* ndef EDOTDOT */
#ifdef EDQUOT
if (x == EDQUOT)
{*r = Mono_Posix_Errno_EDQUOT; return 0;}
#endif /* ndef EDQUOT */
#ifdef EEXIST
if (x == EEXIST)
{*r = Mono_Posix_Errno_EEXIST; return 0;}
#endif /* ndef EEXIST */
#ifdef EFAULT
if (x == EFAULT)
{*r = Mono_Posix_Errno_EFAULT; return 0;}
#endif /* ndef EFAULT */
#ifdef EFBIG
if (x == EFBIG)
{*r = Mono_Posix_Errno_EFBIG; return 0;}
#endif /* ndef EFBIG */
#ifdef EFTYPE
if (x == EFTYPE)
{*r = Mono_Posix_Errno_EFTYPE; return 0;}
#endif /* ndef EFTYPE */
#ifdef EHOSTDOWN
if (x == EHOSTDOWN)
{*r = Mono_Posix_Errno_EHOSTDOWN; return 0;}
#endif /* ndef EHOSTDOWN */
#ifdef EHOSTUNREACH
if (x == EHOSTUNREACH)
{*r = Mono_Posix_Errno_EHOSTUNREACH; return 0;}
#endif /* ndef EHOSTUNREACH */
#ifdef EIDRM
if (x == EIDRM)
{*r = Mono_Posix_Errno_EIDRM; return 0;}
#endif /* ndef EIDRM */
#ifdef EILSEQ
if (x == EILSEQ)
{*r = Mono_Posix_Errno_EILSEQ; return 0;}
#endif /* ndef EILSEQ */
#ifdef EINPROGRESS
if (x == EINPROGRESS)
{*r = Mono_Posix_Errno_EINPROGRESS; return 0;}
#endif /* ndef EINPROGRESS */
#ifdef EINTR
if (x == EINTR)
{*r = Mono_Posix_Errno_EINTR; return 0;}
#endif /* ndef EINTR */
#ifdef EINVAL
if (x == EINVAL)
{*r = Mono_Posix_Errno_EINVAL; return 0;}
#endif /* ndef EINVAL */
#ifdef EIO
if (x == EIO)
{*r = Mono_Posix_Errno_EIO; return 0;}
#endif /* ndef EIO */
#ifdef EISCONN
if (x == EISCONN)
{*r = Mono_Posix_Errno_EISCONN; return 0;}
#endif /* ndef EISCONN */
#ifdef EISDIR
if (x == EISDIR)
{*r = Mono_Posix_Errno_EISDIR; return 0;}
#endif /* ndef EISDIR */
#ifdef EISNAM
if (x == EISNAM)
{*r = Mono_Posix_Errno_EISNAM; return 0;}
#endif /* ndef EISNAM */
#ifdef EKEYEXPIRED
if (x == EKEYEXPIRED)
{*r = Mono_Posix_Errno_EKEYEXPIRED; return 0;}
#endif /* ndef EKEYEXPIRED */
#ifdef EKEYREJECTED
if (x == EKEYREJECTED)
{*r = Mono_Posix_Errno_EKEYREJECTED; return 0;}
#endif /* ndef EKEYREJECTED */
#ifdef EKEYREVOKED
if (x == EKEYREVOKED)
{*r = Mono_Posix_Errno_EKEYREVOKED; return 0;}
#endif /* ndef EKEYREVOKED */
#ifdef EL2HLT
if (x == EL2HLT)
{*r = Mono_Posix_Errno_EL2HLT; return 0;}
#endif /* ndef EL2HLT */
#ifdef EL2NSYNC
if (x == EL2NSYNC)
{*r = Mono_Posix_Errno_EL2NSYNC; return 0;}
#endif /* ndef EL2NSYNC */
#ifdef EL3HLT
if (x == EL3HLT)
{*r = Mono_Posix_Errno_EL3HLT; return 0;}
#endif /* ndef EL3HLT */
#ifdef EL3RST
if (x == EL3RST)
{*r = Mono_Posix_Errno_EL3RST; return 0;}
#endif /* ndef EL3RST */
#ifdef ELIBACC
if (x == ELIBACC)
{*r = Mono_Posix_Errno_ELIBACC; return 0;}
#endif /* ndef ELIBACC */
#ifdef ELIBBAD
if (x == ELIBBAD)
{*r = Mono_Posix_Errno_ELIBBAD; return 0;}
#endif /* ndef ELIBBAD */
#ifdef ELIBEXEC
if (x == ELIBEXEC)
{*r = Mono_Posix_Errno_ELIBEXEC; return 0;}
#endif /* ndef ELIBEXEC */
#ifdef ELIBMAX
if (x == ELIBMAX)
{*r = Mono_Posix_Errno_ELIBMAX; return 0;}
#endif /* ndef ELIBMAX */
#ifdef ELIBSCN
if (x == ELIBSCN)
{*r = Mono_Posix_Errno_ELIBSCN; return 0;}
#endif /* ndef ELIBSCN */
#ifdef ELNRNG
if (x == ELNRNG)
{*r = Mono_Posix_Errno_ELNRNG; return 0;}
#endif /* ndef ELNRNG */
#ifdef ELOOP
if (x == ELOOP)
{*r = Mono_Posix_Errno_ELOOP; return 0;}
#endif /* ndef ELOOP */
#ifdef EMEDIUMTYPE
if (x == EMEDIUMTYPE)
{*r = Mono_Posix_Errno_EMEDIUMTYPE; return 0;}
#endif /* ndef EMEDIUMTYPE */
#ifdef EMFILE
if (x == EMFILE)
{*r = Mono_Posix_Errno_EMFILE; return 0;}
#endif /* ndef EMFILE */
#ifdef EMLINK
if (x == EMLINK)
{*r = Mono_Posix_Errno_EMLINK; return 0;}
#endif /* ndef EMLINK */
#ifdef EMSGSIZE
if (x == EMSGSIZE)
{*r = Mono_Posix_Errno_EMSGSIZE; return 0;}
#endif /* ndef EMSGSIZE */
#ifdef EMULTIHOP
if (x == EMULTIHOP)
{*r = Mono_Posix_Errno_EMULTIHOP; return 0;}
#endif /* ndef EMULTIHOP */
#ifdef ENAMETOOLONG
if (x == ENAMETOOLONG)
{*r = Mono_Posix_Errno_ENAMETOOLONG; return 0;}
#endif /* ndef ENAMETOOLONG */
#ifdef ENAVAIL
if (x == ENAVAIL)
{*r = Mono_Posix_Errno_ENAVAIL; return 0;}
#endif /* ndef ENAVAIL */
#ifdef ENEEDAUTH
if (x == ENEEDAUTH)
{*r = Mono_Posix_Errno_ENEEDAUTH; return 0;}
#endif /* ndef ENEEDAUTH */
#ifdef ENETDOWN
if (x == ENETDOWN)
{*r = Mono_Posix_Errno_ENETDOWN; return 0;}
#endif /* ndef ENETDOWN */
#ifdef ENETRESET
if (x == ENETRESET)
{*r = Mono_Posix_Errno_ENETRESET; return 0;}
#endif /* ndef ENETRESET */
#ifdef ENETUNREACH
if (x == ENETUNREACH)
{*r = Mono_Posix_Errno_ENETUNREACH; return 0;}
#endif /* ndef ENETUNREACH */
#ifdef ENFILE
if (x == ENFILE)
{*r = Mono_Posix_Errno_ENFILE; return 0;}
#endif /* ndef ENFILE */
#ifdef ENOANO
if (x == ENOANO)
{*r = Mono_Posix_Errno_ENOANO; return 0;}
#endif /* ndef ENOANO */
#ifdef ENOATTR
if (x == ENOATTR)
{*r = Mono_Posix_Errno_ENOATTR; return 0;}
#endif /* ndef ENOATTR */
#ifdef ENOBUFS
if (x == ENOBUFS)
{*r = Mono_Posix_Errno_ENOBUFS; return 0;}
#endif /* ndef ENOBUFS */
#ifdef ENOCSI
if (x == ENOCSI)
{*r = Mono_Posix_Errno_ENOCSI; return 0;}
#endif /* ndef ENOCSI */
#ifdef ENODATA
if (x == ENODATA)
{*r = Mono_Posix_Errno_ENODATA; return 0;}
#endif /* ndef ENODATA */
#ifdef ENODEV
if (x == ENODEV)
{*r = Mono_Posix_Errno_ENODEV; return 0;}
#endif /* ndef ENODEV */
#ifdef ENOENT
if (x == ENOENT)
{*r = Mono_Posix_Errno_ENOENT; return 0;}
#endif /* ndef ENOENT */
#ifdef ENOEXEC
if (x == ENOEXEC)
{*r = Mono_Posix_Errno_ENOEXEC; return 0;}
#endif /* ndef ENOEXEC */
#ifdef ENOKEY
if (x == ENOKEY)
{*r = Mono_Posix_Errno_ENOKEY; return 0;}
#endif /* ndef ENOKEY */
#ifdef ENOLCK
if (x == ENOLCK)
{*r = Mono_Posix_Errno_ENOLCK; return 0;}
#endif /* ndef ENOLCK */
#ifdef ENOLINK
if (x == ENOLINK)
{*r = Mono_Posix_Errno_ENOLINK; return 0;}
#endif /* ndef ENOLINK */
#ifdef ENOMEDIUM
if (x == ENOMEDIUM)
{*r = Mono_Posix_Errno_ENOMEDIUM; return 0;}
#endif /* ndef ENOMEDIUM */
#ifdef ENOMEM
if (x == ENOMEM)
{*r = Mono_Posix_Errno_ENOMEM; return 0;}
#endif /* ndef ENOMEM */
#ifdef ENOMSG
if (x == ENOMSG)
{*r = Mono_Posix_Errno_ENOMSG; return 0;}
#endif /* ndef ENOMSG */
#ifdef ENONET
if (x == ENONET)
{*r = Mono_Posix_Errno_ENONET; return 0;}
#endif /* ndef ENONET */
#ifdef ENOPKG
if (x == ENOPKG)
{*r = Mono_Posix_Errno_ENOPKG; return 0;}
#endif /* ndef ENOPKG */
#ifdef ENOPOLICY
if (x == ENOPOLICY)
{*r = Mono_Posix_Errno_ENOPOLICY; return 0;}
#endif /* ndef ENOPOLICY */
#ifdef ENOPROTOOPT
if (x == ENOPROTOOPT)
{*r = Mono_Posix_Errno_ENOPROTOOPT; return 0;}
#endif /* ndef ENOPROTOOPT */
#ifdef ENOSPC
if (x == ENOSPC)
{*r = Mono_Posix_Errno_ENOSPC; return 0;}
#endif /* ndef ENOSPC */
#ifdef ENOSR
if (x == ENOSR)
{*r = Mono_Posix_Errno_ENOSR; return 0;}
#endif /* ndef ENOSR */
#ifdef ENOSTR
if (x == ENOSTR)
{*r = Mono_Posix_Errno_ENOSTR; return 0;}
#endif /* ndef ENOSTR */
#ifdef ENOSYS
if (x == ENOSYS)
{*r = Mono_Posix_Errno_ENOSYS; return 0;}
#endif /* ndef ENOSYS */
#ifdef ENOTBLK
if (x == ENOTBLK)
{*r = Mono_Posix_Errno_ENOTBLK; return 0;}
#endif /* ndef ENOTBLK */
#ifdef ENOTCONN
if (x == ENOTCONN)
{*r = Mono_Posix_Errno_ENOTCONN; return 0;}
#endif /* ndef ENOTCONN */
#ifdef ENOTDIR
if (x == ENOTDIR)
{*r = Mono_Posix_Errno_ENOTDIR; return 0;}
#endif /* ndef ENOTDIR */
#ifdef ENOTEMPTY
if (x == ENOTEMPTY)
{*r = Mono_Posix_Errno_ENOTEMPTY; return 0;}
#endif /* ndef ENOTEMPTY */
#ifdef ENOTNAM
if (x == ENOTNAM)
{*r = Mono_Posix_Errno_ENOTNAM; return 0;}
#endif /* ndef ENOTNAM */
#ifdef ENOTRECOVERABLE
if (x == ENOTRECOVERABLE)
{*r = Mono_Posix_Errno_ENOTRECOVERABLE; return 0;}
#endif /* ndef ENOTRECOVERABLE */
#ifdef ENOTSOCK
if (x == ENOTSOCK)
{*r = Mono_Posix_Errno_ENOTSOCK; return 0;}
#endif /* ndef ENOTSOCK */
#ifdef ENOTTY
if (x == ENOTTY)
{*r = Mono_Posix_Errno_ENOTTY; return 0;}
#endif /* ndef ENOTTY */
#ifdef ENOTUNIQ
if (x == ENOTUNIQ)
{*r = Mono_Posix_Errno_ENOTUNIQ; return 0;}
#endif /* ndef ENOTUNIQ */
#ifdef ENXIO
if (x == ENXIO)
{*r = Mono_Posix_Errno_ENXIO; return 0;}
#endif /* ndef ENXIO */
#ifdef EOPNOTSUPP
if (x == EOPNOTSUPP)
{*r = Mono_Posix_Errno_EOPNOTSUPP; return 0;}
#endif /* ndef EOPNOTSUPP */
#ifdef EOVERFLOW
if (x == EOVERFLOW)
{*r = Mono_Posix_Errno_EOVERFLOW; return 0;}
#endif /* ndef EOVERFLOW */
#ifdef EOWNERDEAD
if (x == EOWNERDEAD)
{*r = Mono_Posix_Errno_EOWNERDEAD; return 0;}
#endif /* ndef EOWNERDEAD */
#ifdef EPERM
if (x == EPERM)
{*r = Mono_Posix_Errno_EPERM; return 0;}
#endif /* ndef EPERM */
#ifdef EPFNOSUPPORT
if (x == EPFNOSUPPORT)
{*r = Mono_Posix_Errno_EPFNOSUPPORT; return 0;}
#endif /* ndef EPFNOSUPPORT */
#ifdef EPIPE
if (x == EPIPE)
{*r = Mono_Posix_Errno_EPIPE; return 0;}
#endif /* ndef EPIPE */
#ifdef EPROCLIM
if (x == EPROCLIM)
{*r = Mono_Posix_Errno_EPROCLIM; return 0;}
#endif /* ndef EPROCLIM */
#ifdef EPROCUNAVAIL
if (x == EPROCUNAVAIL)
{*r = Mono_Posix_Errno_EPROCUNAVAIL; return 0;}
#endif /* ndef EPROCUNAVAIL */
#ifdef EPROGMISMATCH
if (x == EPROGMISMATCH)
{*r = Mono_Posix_Errno_EPROGMISMATCH; return 0;}
#endif /* ndef EPROGMISMATCH */
#ifdef EPROGUNAVAIL
if (x == EPROGUNAVAIL)
{*r = Mono_Posix_Errno_EPROGUNAVAIL; return 0;}
#endif /* ndef EPROGUNAVAIL */
#ifdef EPROTO
if (x == EPROTO)
{*r = Mono_Posix_Errno_EPROTO; return 0;}
#endif /* ndef EPROTO */
#ifdef EPROTONOSUPPORT
if (x == EPROTONOSUPPORT)
{*r = Mono_Posix_Errno_EPROTONOSUPPORT; return 0;}
#endif /* ndef EPROTONOSUPPORT */
#ifdef EPROTOTYPE
if (x == EPROTOTYPE)
{*r = Mono_Posix_Errno_EPROTOTYPE; return 0;}
#endif /* ndef EPROTOTYPE */
#ifdef EPWROFF
if (x == EPWROFF)
{*r = Mono_Posix_Errno_EPWROFF; return 0;}
#endif /* ndef EPWROFF */
#ifdef ERANGE
if (x == ERANGE)
{*r = Mono_Posix_Errno_ERANGE; return 0;}
#endif /* ndef ERANGE */
#ifdef EREMCHG
if (x == EREMCHG)
{*r = Mono_Posix_Errno_EREMCHG; return 0;}
#endif /* ndef EREMCHG */
#ifdef EREMOTE
if (x == EREMOTE)
{*r = Mono_Posix_Errno_EREMOTE; return 0;}
#endif /* ndef EREMOTE */
#ifdef EREMOTEIO
if (x == EREMOTEIO)
{*r = Mono_Posix_Errno_EREMOTEIO; return 0;}
#endif /* ndef EREMOTEIO */
#ifdef ERESTART
if (x == ERESTART)
{*r = Mono_Posix_Errno_ERESTART; return 0;}
#endif /* ndef ERESTART */
#ifdef EROFS
if (x == EROFS)
{*r = Mono_Posix_Errno_EROFS; return 0;}
#endif /* ndef EROFS */
#ifdef ERPCMISMATCH
if (x == ERPCMISMATCH)
{*r = Mono_Posix_Errno_ERPCMISMATCH; return 0;}
#endif /* ndef ERPCMISMATCH */
#ifdef ESHLIBVERS
if (x == ESHLIBVERS)
{*r = Mono_Posix_Errno_ESHLIBVERS; return 0;}
#endif /* ndef ESHLIBVERS */
#ifdef ESHUTDOWN
if (x == ESHUTDOWN)
{*r = Mono_Posix_Errno_ESHUTDOWN; return 0;}
#endif /* ndef ESHUTDOWN */
#ifdef ESOCKTNOSUPPORT
if (x == ESOCKTNOSUPPORT)
{*r = Mono_Posix_Errno_ESOCKTNOSUPPORT; return 0;}
#endif /* ndef ESOCKTNOSUPPORT */
#ifdef ESPIPE
if (x == ESPIPE)
{*r = Mono_Posix_Errno_ESPIPE; return 0;}
#endif /* ndef ESPIPE */
#ifdef ESRCH
if (x == ESRCH)
{*r = Mono_Posix_Errno_ESRCH; return 0;}
#endif /* ndef ESRCH */
#ifdef ESRMNT
if (x == ESRMNT)
{*r = Mono_Posix_Errno_ESRMNT; return 0;}
#endif /* ndef ESRMNT */
#ifdef ESTALE
if (x == ESTALE)
{*r = Mono_Posix_Errno_ESTALE; return 0;}
#endif /* ndef ESTALE */
#ifdef ESTRPIPE
if (x == ESTRPIPE)
{*r = Mono_Posix_Errno_ESTRPIPE; return 0;}
#endif /* ndef ESTRPIPE */
#ifdef ETIME
if (x == ETIME)
{*r = Mono_Posix_Errno_ETIME; return 0;}
#endif /* ndef ETIME */
#ifdef ETIMEDOUT
if (x == ETIMEDOUT)
{*r = Mono_Posix_Errno_ETIMEDOUT; return 0;}
#endif /* ndef ETIMEDOUT */
#ifdef ETOOMANYREFS
if (x == ETOOMANYREFS)
{*r = Mono_Posix_Errno_ETOOMANYREFS; return 0;}
#endif /* ndef ETOOMANYREFS */
#ifdef ETXTBSY
if (x == ETXTBSY)
{*r = Mono_Posix_Errno_ETXTBSY; return 0;}
#endif /* ndef ETXTBSY */
#ifdef EUCLEAN
if (x == EUCLEAN)
{*r = Mono_Posix_Errno_EUCLEAN; return 0;}
#endif /* ndef EUCLEAN */
#ifdef EUNATCH
if (x == EUNATCH)
{*r = Mono_Posix_Errno_EUNATCH; return 0;}
#endif /* ndef EUNATCH */
#ifdef EUSERS
if (x == EUSERS)
{*r = Mono_Posix_Errno_EUSERS; return 0;}
#endif /* ndef EUSERS */
#ifdef EWOULDBLOCK
if (x == EWOULDBLOCK)
{*r = Mono_Posix_Errno_EWOULDBLOCK; return 0;}
#endif /* ndef EWOULDBLOCK */
#ifdef EXDEV
if (x == EXDEV)
{*r = Mono_Posix_Errno_EXDEV; return 0;}
#endif /* ndef EXDEV */
#ifdef EXFULL
if (x == EXFULL)
{*r = Mono_Posix_Errno_EXFULL; return 0;}
#endif /* ndef EXFULL */
errno = EINVAL; return -1;
}
int Mono_Posix_FromFcntlCommand (int x, int *r)
{
*r = 0;
if (x == Mono_Posix_FcntlCommand_F_DUPFD)
#ifdef F_DUPFD
{*r = F_DUPFD; return 0;}
#else /* def F_DUPFD */
{errno = EINVAL; return -1;}
#endif /* ndef F_DUPFD */
if (x == Mono_Posix_FcntlCommand_F_GETFD)
#ifdef F_GETFD
{*r = F_GETFD; return 0;}
#else /* def F_GETFD */
{errno = EINVAL; return -1;}
#endif /* ndef F_GETFD */
if (x == Mono_Posix_FcntlCommand_F_GETFL)
#ifdef F_GETFL
{*r = F_GETFL; return 0;}
#else /* def F_GETFL */
{errno = EINVAL; return -1;}
#endif /* ndef F_GETFL */
if (x == Mono_Posix_FcntlCommand_F_GETLEASE)
#ifdef F_GETLEASE
{*r = F_GETLEASE; return 0;}
#else /* def F_GETLEASE */
{errno = EINVAL; return -1;}
#endif /* ndef F_GETLEASE */
if (x == Mono_Posix_FcntlCommand_F_GETLK)
#ifdef F_GETLK
{*r = F_GETLK; return 0;}
#else /* def F_GETLK */
{errno = EINVAL; return -1;}
#endif /* ndef F_GETLK */
if (x == Mono_Posix_FcntlCommand_F_GETOWN)
#ifdef F_GETOWN
{*r = F_GETOWN; return 0;}
#else /* def F_GETOWN */
{errno = EINVAL; return -1;}
#endif /* ndef F_GETOWN */
if (x == Mono_Posix_FcntlCommand_F_GETSIG)
#ifdef F_GETSIG
{*r = F_GETSIG; return 0;}
#else /* def F_GETSIG */
{errno = EINVAL; return -1;}
#endif /* ndef F_GETSIG */
if (x == Mono_Posix_FcntlCommand_F_NOCACHE)
#ifdef F_NOCACHE
{*r = F_NOCACHE; return 0;}
#else /* def F_NOCACHE */
{errno = EINVAL; return -1;}
#endif /* ndef F_NOCACHE */
if (x == Mono_Posix_FcntlCommand_F_NOTIFY)
#ifdef F_NOTIFY
{*r = F_NOTIFY; return 0;}
#else /* def F_NOTIFY */
{errno = EINVAL; return -1;}
#endif /* ndef F_NOTIFY */
if (x == Mono_Posix_FcntlCommand_F_SETFD)
#ifdef F_SETFD
{*r = F_SETFD; return 0;}
#else /* def F_SETFD */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETFD */
if (x == Mono_Posix_FcntlCommand_F_SETFL)
#ifdef F_SETFL
{*r = F_SETFL; return 0;}
#else /* def F_SETFL */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETFL */
if (x == Mono_Posix_FcntlCommand_F_SETLEASE)
#ifdef F_SETLEASE
{*r = F_SETLEASE; return 0;}
#else /* def F_SETLEASE */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETLEASE */
if (x == Mono_Posix_FcntlCommand_F_SETLK)
#ifdef F_SETLK
{*r = F_SETLK; return 0;}
#else /* def F_SETLK */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETLK */
if (x == Mono_Posix_FcntlCommand_F_SETLKW)
#ifdef F_SETLKW
{*r = F_SETLKW; return 0;}
#else /* def F_SETLKW */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETLKW */
if (x == Mono_Posix_FcntlCommand_F_SETOWN)
#ifdef F_SETOWN
{*r = F_SETOWN; return 0;}
#else /* def F_SETOWN */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETOWN */
if (x == Mono_Posix_FcntlCommand_F_SETSIG)
#ifdef F_SETSIG
{*r = F_SETSIG; return 0;}
#else /* def F_SETSIG */
{errno = EINVAL; return -1;}
#endif /* ndef F_SETSIG */
if (x == 0)
return 0;
errno = EINVAL; return -1;
}
int Mono_Posix_ToFcntlCommand (int x, int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef F_DUPFD
if (x == F_DUPFD)
{*r = Mono_Posix_FcntlCommand_F_DUPFD; return 0;}
#endif /* ndef F_DUPFD */
#ifdef F_GETFD
if (x == F_GETFD)
{*r = Mono_Posix_FcntlCommand_F_GETFD; return 0;}
#endif /* ndef F_GETFD */
#ifdef F_GETFL
if (x == F_GETFL)
{*r = Mono_Posix_FcntlCommand_F_GETFL; return 0;}
#endif /* ndef F_GETFL */
#ifdef F_GETLEASE
if (x == F_GETLEASE)
{*r = Mono_Posix_FcntlCommand_F_GETLEASE; return 0;}
#endif /* ndef F_GETLEASE */
#ifdef F_GETLK
if (x == F_GETLK)
{*r = Mono_Posix_FcntlCommand_F_GETLK; return 0;}
#endif /* ndef F_GETLK */
#ifdef F_GETOWN
if (x == F_GETOWN)
{*r = Mono_Posix_FcntlCommand_F_GETOWN; return 0;}
#endif /* ndef F_GETOWN */
#ifdef F_GETSIG
if (x == F_GETSIG)
{*r = Mono_Posix_FcntlCommand_F_GETSIG; return 0;}
#endif /* ndef F_GETSIG */
#ifdef F_NOCACHE
if (x == F_NOCACHE)
{*r = Mono_Posix_FcntlCommand_F_NOCACHE; return 0;}
#endif /* ndef F_NOCACHE */
#ifdef F_NOTIFY
if (x == F_NOTIFY)
{*r = Mono_Posix_FcntlCommand_F_NOTIFY; return 0;}
#endif /* ndef F_NOTIFY */
#ifdef F_SETFD
if (x == F_SETFD)
{*r = Mono_Posix_FcntlCommand_F_SETFD; return 0;}
#endif /* ndef F_SETFD */
#ifdef F_SETFL
if (x == F_SETFL)
{*r = Mono_Posix_FcntlCommand_F_SETFL; return 0;}
#endif /* ndef F_SETFL */
#ifdef F_SETLEASE
if (x == F_SETLEASE)
{*r = Mono_Posix_FcntlCommand_F_SETLEASE; return 0;}
#endif /* ndef F_SETLEASE */
#ifdef F_SETLK
if (x == F_SETLK)
{*r = Mono_Posix_FcntlCommand_F_SETLK; return 0;}
#endif /* ndef F_SETLK */
#ifdef F_SETLKW
if (x == F_SETLKW)
{*r = Mono_Posix_FcntlCommand_F_SETLKW; return 0;}
#endif /* ndef F_SETLKW */
#ifdef F_SETOWN
if (x == F_SETOWN)
{*r = Mono_Posix_FcntlCommand_F_SETOWN; return 0;}
#endif /* ndef F_SETOWN */
#ifdef F_SETSIG
if (x == F_SETSIG)
{*r = Mono_Posix_FcntlCommand_F_SETSIG; return 0;}
#endif /* ndef F_SETSIG */
errno = EINVAL; return -1;
}
int Mono_Posix_FromFilePermissions (unsigned int x, unsigned int *r)
{
*r = 0;
if ((x & Mono_Posix_FilePermissions_ACCESSPERMS) == Mono_Posix_FilePermissions_ACCESSPERMS)
#ifdef ACCESSPERMS
*r |= ACCESSPERMS;
#else /* def ACCESSPERMS */
{/* Ignoring Mono_Posix_FilePermissions_ACCESSPERMS, as it is constructed from other values */}
#endif /* ndef ACCESSPERMS */
if ((x & Mono_Posix_FilePermissions_ALLPERMS) == Mono_Posix_FilePermissions_ALLPERMS)
#ifdef ALLPERMS
*r |= ALLPERMS;
#else /* def ALLPERMS */
{/* Ignoring Mono_Posix_FilePermissions_ALLPERMS, as it is constructed from other values */}
#endif /* ndef ALLPERMS */
if ((x & Mono_Posix_FilePermissions_DEFFILEMODE) == Mono_Posix_FilePermissions_DEFFILEMODE)
#ifdef DEFFILEMODE
*r |= DEFFILEMODE;
#else /* def DEFFILEMODE */
{/* Ignoring Mono_Posix_FilePermissions_DEFFILEMODE, as it is constructed from other values */}
#endif /* ndef DEFFILEMODE */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFBLK)
#ifdef S_IFBLK
*r |= S_IFBLK;
#else /* def S_IFBLK */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFBLK */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFCHR)
#ifdef S_IFCHR
*r |= S_IFCHR;
#else /* def S_IFCHR */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFCHR */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFDIR)
#ifdef S_IFDIR
*r |= S_IFDIR;
#else /* def S_IFDIR */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFDIR */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFIFO)
#ifdef S_IFIFO
*r |= S_IFIFO;
#else /* def S_IFIFO */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFIFO */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFLNK)
#ifdef S_IFLNK
*r |= S_IFLNK;
#else /* def S_IFLNK */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFLNK */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFMT)
#ifdef S_IFMT
*r |= S_IFMT;
#else /* def S_IFMT */
{/* Ignoring Mono_Posix_FilePermissions_S_IFMT, as it is constructed from other values */}
#endif /* ndef S_IFMT */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFREG)
#ifdef S_IFREG
*r |= S_IFREG;
#else /* def S_IFREG */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFREG */
if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFSOCK)
#ifdef S_IFSOCK
*r |= S_IFSOCK;
#else /* def S_IFSOCK */
{errno = EINVAL; return -1;}
#endif /* ndef S_IFSOCK */
if ((x & Mono_Posix_FilePermissions_S_IRGRP) == Mono_Posix_FilePermissions_S_IRGRP)
#ifdef S_IRGRP
*r |= S_IRGRP;
#else /* def S_IRGRP */
{errno = EINVAL; return -1;}
#endif /* ndef S_IRGRP */
if ((x & Mono_Posix_FilePermissions_S_IROTH) == Mono_Posix_FilePermissions_S_IROTH)
#ifdef S_IROTH
*r |= S_IROTH;
#else /* def S_IROTH */
{errno = EINVAL; return -1;}
#endif /* ndef S_IROTH */
if ((x & Mono_Posix_FilePermissions_S_IRUSR) == Mono_Posix_FilePermissions_S_IRUSR)
#ifdef S_IRUSR
*r |= S_IRUSR;
#else /* def S_IRUSR */
{errno = EINVAL; return -1;}
#endif /* ndef S_IRUSR */
if ((x & Mono_Posix_FilePermissions_S_IRWXG) == Mono_Posix_FilePermissions_S_IRWXG)
#ifdef S_IRWXG
*r |= S_IRWXG;
#else /* def S_IRWXG */
{/* Ignoring Mono_Posix_FilePermissions_S_IRWXG, as it is constructed from other values */}
#endif /* ndef S_IRWXG */
if ((x & Mono_Posix_FilePermissions_S_IRWXO) == Mono_Posix_FilePermissions_S_IRWXO)
#ifdef S_IRWXO
*r |= S_IRWXO;
#else /* def S_IRWXO */
{/* Ignoring Mono_Posix_FilePermissions_S_IRWXO, as it is constructed from other values */}
#endif /* ndef S_IRWXO */
if ((x & Mono_Posix_FilePermissions_S_IRWXU) == Mono_Posix_FilePermissions_S_IRWXU)
#ifdef S_IRWXU
*r |= S_IRWXU;
#else /* def S_IRWXU */
{/* Ignoring Mono_Posix_FilePermissions_S_IRWXU, as it is constructed from other values */}
#endif /* ndef S_IRWXU */
if ((x & Mono_Posix_FilePermissions_S_ISGID) == Mono_Posix_FilePermissions_S_ISGID)
#ifdef S_ISGID
*r |= S_ISGID;
#else /* def S_ISGID */
{errno = EINVAL; return -1;}
#endif /* ndef S_ISGID */
if ((x & Mono_Posix_FilePermissions_S_ISUID) == Mono_Posix_FilePermissions_S_ISUID)
#ifdef S_ISUID
*r |= S_ISUID;
#else /* def S_ISUID */
{errno = EINVAL; return -1;}
#endif /* ndef S_ISUID */
if ((x & Mono_Posix_FilePermissions_S_ISVTX) == Mono_Posix_FilePermissions_S_ISVTX)
#ifdef S_ISVTX
*r |= S_ISVTX;
#else /* def S_ISVTX */
{errno = EINVAL; return -1;}
#endif /* ndef S_ISVTX */
if ((x & Mono_Posix_FilePermissions_S_IWGRP) == Mono_Posix_FilePermissions_S_IWGRP)
#ifdef S_IWGRP
*r |= S_IWGRP;
#else /* def S_IWGRP */
{errno = EINVAL; return -1;}
#endif /* ndef S_IWGRP */
if ((x & Mono_Posix_FilePermissions_S_IWOTH) == Mono_Posix_FilePermissions_S_IWOTH)
#ifdef S_IWOTH
*r |= S_IWOTH;
#else /* def S_IWOTH */
{errno = EINVAL; return -1;}
#endif /* ndef S_IWOTH */
if ((x & Mono_Posix_FilePermissions_S_IWUSR) == Mono_Posix_FilePermissions_S_IWUSR)
#ifdef S_IWUSR
*r |= S_IWUSR;
#else /* def S_IWUSR */
{errno = EINVAL; return -1;}
#endif /* ndef S_IWUSR */
if ((x & Mono_Posix_FilePermissions_S_IXGRP) == Mono_Posix_FilePermissions_S_IXGRP)
#ifdef S_IXGRP
*r |= S_IXGRP;
#else /* def S_IXGRP */
{errno = EINVAL; return -1;}
#endif /* ndef S_IXGRP */
if ((x & Mono_Posix_FilePermissions_S_IXOTH) == Mono_Posix_FilePermissions_S_IXOTH)
#ifdef S_IXOTH
*r |= S_IXOTH;
#else /* def S_IXOTH */
{errno = EINVAL; return -1;}
#endif /* ndef S_IXOTH */
if ((x & Mono_Posix_FilePermissions_S_IXUSR) == Mono_Posix_FilePermissions_S_IXUSR)
#ifdef S_IXUSR
*r |= S_IXUSR;
#else /* def S_IXUSR */
{errno = EINVAL; return -1;}
#endif /* ndef S_IXUSR */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToFilePermissions (unsigned int x, unsigned int *r)
{
*r = 0;
if (x == 0)
return 0;
#ifdef ACCESSPERMS
if ((x & ACCESSPERMS) == ACCESSPERMS)
*r |= Mono_Posix_FilePermissions_ACCESSPERMS;
#endif /* ndef ACCESSPERMS */
#ifdef ALLPERMS
if ((x & ALLPERMS) == ALLPERMS)
*r |= Mono_Posix_FilePermissions_ALLPERMS;
#endif /* ndef ALLPERMS */
#ifdef DEFFILEMODE
if ((x & DEFFILEMODE) == DEFFILEMODE)
*r |= Mono_Posix_FilePermissions_DEFFILEMODE;
#endif /* ndef DEFFILEMODE */
#ifdef S_IFBLK
if ((x & S_IFMT) == S_IFBLK)
*r |= Mono_Posix_FilePermissions_S_IFBLK;
#endif /* ndef S_IFBLK */
#ifdef S_IFCHR
if ((x & S_IFMT) == S_IFCHR)
*r |= Mono_Posix_FilePermissions_S_IFCHR;
#endif /* ndef S_IFCHR */
#ifdef S_IFDIR
if ((x & S_IFMT) == S_IFDIR)
*r |= Mono_Posix_FilePermissions_S_IFDIR;
#endif /* ndef S_IFDIR */
#ifdef S_IFIFO
if ((x & S_IFMT) == S_IFIFO)
*r |= Mono_Posix_FilePermissions_S_IFIFO;
#endif /* ndef S_IFIFO */
#ifdef S_IFLNK
if ((x & S_IFMT) == S_IFLNK)
*r |= Mono_Posix_FilePermissions_S_IFLNK;
#endif /* ndef S_IFLNK */
#ifdef S_IFMT
if ((x & S_IFMT) == S_IFMT)
*r |= Mono_Posix_FilePermissions_S_IFMT;
#endif /* ndef S_IFMT */
#ifdef S_IFREG
if ((x & S_IFMT) == S_IFREG)
*r |= Mono_Posix_FilePermissions_S_IFREG;
#endif /* ndef S_IFREG */
#ifdef S_IFSOCK
if ((x & S_IFMT) == S_IFSOCK)
*r |= Mono_Posix_FilePermissions_S_IFSOCK;
#endif /* ndef S_IFSOCK */
#ifdef S_IRGRP
if ((x & S_IRGRP) == S_IRGRP)
*r |= Mono_Posix_FilePermissions_S_IRGRP;
#endif /* ndef S_IRGRP */
#ifdef S_IROTH
if ((x & S_IROTH) == S_IROTH)
*r |= Mono_Posix_FilePermissions_S_IROTH;
#endif /* ndef S_IROTH */
#ifdef S_IRUSR
if ((x & S_IRUSR) == S_IRUSR)
*r |= Mono_Posix_FilePermissions_S_IRUSR;
#endif /* ndef S_IRUSR */
#ifdef S_IRWXG
if ((x & S_IRWXG) == S_IRWXG)
*r |= Mono_Posix_FilePermissions_S_IRWXG;
#endif /* ndef S_IRWXG */
#ifdef S_IRWXO
if ((x & S_IRWXO) == S_IRWXO)
*r |= Mono_Posix_FilePermissions_S_IRWXO;
#endif /* ndef S_IRWXO */
#ifdef S_IRWXU
if ((x & S_IRWXU) == S_IRWXU)
*r |= Mono_Posix_FilePermissions_S_IRWXU;
#endif /* ndef S_IRWXU */
#ifdef S_ISGID
if ((x & S_ISGID) == S_ISGID)
*r |= Mono_Posix_FilePermissions_S_ISGID;
#endif /* ndef S_ISGID */
#ifdef S_ISUID
if ((x & S_ISUID) == S_ISUID)
*r |= Mono_Posix_FilePermissions_S_ISUID;
#endif /* ndef S_ISUID */
#ifdef S_ISVTX
if ((x & S_ISVTX) == S_ISVTX)
*r |= Mono_Posix_FilePermissions_S_ISVTX;
#endif /* ndef S_ISVTX */
#ifdef S_IWGRP
if ((x & S_IWGRP) == S_IWGRP)
*r |= Mono_Posix_FilePermissions_S_IWGRP;
#endif /* ndef S_IWGRP */
#ifdef S_IWOTH
if ((x & S_IWOTH) == S_IWOTH)
*r |= Mono_Posix_FilePermissions_S_IWOTH;
#endif /* ndef S_IWOTH */
#ifdef S_IWUSR
if ((x & S_IWUSR) == S_IWUSR)
*r |= Mono_Posix_FilePermissions_S_IWUSR;
#endif /* ndef S_IWUSR */
#ifdef S_IXGRP
if ((x & S_IXGRP) == S_IXGRP)
*r |= Mono_Posix_FilePermissions_S_IXGRP;
#endif /* ndef S_IXGRP */
#ifdef S_IXOTH
if ((x & S_IXOTH) == S_IXOTH)
*r |= Mono_Posix_FilePermissions_S_IXOTH;
#endif /* ndef S_IXOTH */
#ifdef S_IXUSR
if ((x & S_IXUSR) == S_IXUSR)
*r |= Mono_Posix_FilePermissions_S_IXUSR;
#endif /* ndef S_IXUSR */
return 0;
}
#ifdef HAVE_STRUCT_FLOCK
int
Mono_Posix_FromFlock (struct Mono_Posix_Flock *from, struct flock *to)
{
_cnm_return_val_if_overflow (off_t, from->l_start, -1);
_cnm_return_val_if_overflow (off_t, from->l_len, -1);
_cnm_return_val_if_overflow (pid_t, from->l_pid, -1);
memset (to, 0, sizeof(*to));
if (Mono_Posix_FromLockType (from->l_type, &to->l_type) != 0) {
return -1;
}
if (Mono_Posix_FromSeekFlags (from->l_whence, &to->l_whence) != 0) {
return -1;
}
to->l_start = from->l_start;
to->l_len = from->l_len;
to->l_pid = from->l_pid;
return 0;
}
#endif /* ndef HAVE_STRUCT_FLOCK */
#ifdef HAVE_STRUCT_FLOCK
int
Mono_Posix_ToFlock (struct flock *from, struct Mono_Posix_Flock *to)
{
_cnm_return_val_if_overflow (gint64, from->l_start, -1);
_cnm_return_val_if_overflow (gint64, from->l_len, -1);
_cnm_return_val_if_overflow (int, from->l_pid, -1);
memset (to, 0, sizeof(*to));
if (Mono_Posix_ToLockType (from->l_type, &to->l_type) != 0) {
return -1;
}
if (Mono_Posix_ToSeekFlags (from->l_whence, &to->l_whence) != 0) {