Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -184,6 +184,48 @@ Mono_Posix_Syscall_remap_file_pages (void *start, mph_size_t size,
}
#endif /* def HAVE_REMAP_FILE_PAGES */
// This has to be kept in sync with Syscall.cs
enum Mono_Posix_MremapFlags {
Mono_Posix_MremapFlags_MREMAP_MAYMOVE = 0x0000000000000001,
};
// Mono_Posix_FromMremapFlags() and Mono_Posix_ToMremapFlags() are not in map.c because NetBSD needs special treatment for MREMAP_MAYMOVE
int Mono_Posix_FromMremapFlags (guint64 x, guint64 *r)
{
*r = 0;
#ifndef __NetBSD__
if ((x & Mono_Posix_MremapFlags_MREMAP_MAYMOVE) == Mono_Posix_MremapFlags_MREMAP_MAYMOVE)
#ifdef MREMAP_MAYMOVE
*r |= MREMAP_MAYMOVE;
#else /* def MREMAP_MAYMOVE */
{errno = EINVAL; return -1;}
#endif /* ndef MREMAP_MAYMOVE */
#else /* def __NetBSD__ */
if ((x & Mono_Posix_MremapFlags_MREMAP_MAYMOVE) != Mono_Posix_MremapFlags_MREMAP_MAYMOVE)
*r = MAP_FIXED;
#endif /* def __NetBSD__ */
if (x == 0)
return 0;
return 0;
}
int Mono_Posix_ToMremapFlags (guint64 x, guint64 *r)
{
*r = 0;
#ifndef __NetBSD__
if (x == 0)
return 0;
#ifdef MREMAP_MAYMOVE
if ((x & MREMAP_MAYMOVE) == MREMAP_MAYMOVE)
*r |= Mono_Posix_MremapFlags_MREMAP_MAYMOVE;
#endif /* ndef MREMAP_MAYMOVE */
#else /* def __NetBSD__ */
if ((x & MAP_FIXED) != MAP_FIXED)
*r |= Mono_Posix_MremapFlags_MREMAP_MAYMOVE;
#endif
return 0;
}
G_END_DECLS
/*