/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "mmap-util.h"
{
return MAP_FAILED;
#if OFF_T_MAX > SSIZE_T_MAX
/* too large file to map into memory */
return MAP_FAILED;
}
#endif
if (*length == 0)
return NULL;
}
{
}
{
}
int advice ATTR_UNUSED)
{
#ifdef HAVE_MADVISE
/* Ignore ENOSYS errors, which happen if the kernel hasn't implemented
the syscall even if libc has. */
return -1;
#endif
return 0;
}
{
if (size != 0)
return size;
size = getpagesize();
return size;
}