[RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
[DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)]
- private static extern IntPtr LoadFromStream(IntPtr ptrNativeAssemblyLoadContext, IntPtr ptrAssemblyArray, int iAssemblyArrayLen, IntPtr ptrSymbols, int iSymbolArrayLen, ObjectHandleOnStack retAssembly);
+ private static extern void LoadFromStream(IntPtr ptrNativeAssemblyLoadContext, IntPtr ptrAssemblyArray, int iAssemblyArrayLen, IntPtr ptrSymbols, int iSymbolArrayLen, ObjectHandleOnStack retAssembly);
[DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)]
internal static extern void InternalSetProfileRoot(string directoryPath);
#cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP
#cmakedefine01 HAVE_CLOCK_THREAD_CPUTIME
#cmakedefine01 HAVE_PTHREAD_CONDATTR_SETCLOCK
-#cmakedefine01 HAVE_MMAP_DEV_ZERO
#cmakedefine01 MMAP_ANON_IGNORES_PROTECTION
#cmakedefine01 ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS
#cmakedefine01 PTHREAD_CREATE_MODIFIES_ERRNO
set(CMAKE_REQUIRED_LIBRARIES)
check_cxx_source_runs("
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-
-int main(void) {
- int devzero;
- void *retval;
-
- devzero = open(\"/dev/zero\", O_RDWR);
- if (-1 == devzero) {
- exit(1);
- }
- retval = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, devzero, 0);
- if (retval == (void *)-1) {
- exit(1);
- }
- exit(0);
-}" HAVE_MMAP_DEV_ZERO)
-check_cxx_source_runs("
#include <sys/types.h>
#include <sys/mman.h>
#include <signal.h>
LPVOID *ppvBaseAddress
);
-#if !HAVE_MMAP_DEV_ZERO
/* We need MAP_ANON. However on some platforms like HP-UX, it is defined as MAP_ANONYMOUS */
#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
#define MAP_ANON MAP_ANONYMOUS
#endif
-#endif
void
FileMappingCleanupRoutine(
goto ExitInternalCreateFileMapping;
}
-#if HAVE_MMAP_DEV_ZERO
-
- UnixFd = InternalOpen(pImmutableData->lpFileName, O_RDWR | O_CLOEXEC);
- if ( -1 == UnixFd )
- {
- ERROR( "Unable to open the file.\n");
- palError = ERROR_INTERNAL_ERROR;
- goto ExitInternalCreateFileMapping;
- }
-
-#else //!HAVE_MMAP_DEV_ZERO
-
UnixFd = -1; /* will pass MAP_ANON to mmap() instead */
-
-#endif //!HAVE_MMAP_DEV_ZERO
-
}
else
{
if (FILE_MAP_COPY == dwDesiredAccess)
{
int flags = MAP_PRIVATE;
-
-#if !HAVE_MMAP_DEV_ZERO
if (pProcessLocalData->UnixFd == -1)
{
flags |= MAP_ANON;
}
-#endif
+
pvBaseAddress = mmap(
NULL,
dwNumberOfBytesToMap,
if (prot != -1)
{
int flags = MAP_SHARED;
-
-#if !HAVE_MMAP_DEV_ZERO
if (pProcessLocalData->UnixFd == -1)
{
flags |= MAP_ANON;
}
-#endif
pvBaseAddress = mmap(
NULL,