ntdll: Report a failed executable mmap on nonexec filesystems.

oldstable
Marcus Meissner 2010-12-10 15:51:43 +01:00 committed by Alexandre Julliard
parent a2af7ccd99
commit e7cb2d35f0
1 changed files with 3 additions and 0 deletions

View File

@ -877,6 +877,9 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start
if (mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != (void *)-1)
goto done;
if ((errno == EPERM) && (prot & PROT_EXEC))
ERR( "failed to set %08x protection on file map, noexec filesystem?\n", prot );
/* mmap() failed; if this is because the file offset is not */
/* page-aligned (EINVAL), or because the underlying filesystem */
/* does not support mmap() (ENOEXEC,ENODEV), we do it by hand. */