Add support for mlockall() and munlockall(). These two functions comprise the _POSIX_MEMLOCK Option which is required by PSE51, PSE52, PSE53, and PSE54. Zephyr's on-demand paging API does not yet support pinning and unpinning *all* virtual memory regions, so these functions are expected to fail, setting errno to ENOSYS. Any other usage is currently categorized as undefined behaviour. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
26 lines
324 B
C
26 lines
324 B
C
/*
|
|
* Copyright (c) 2024, Tenstorrent AI ULC
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <errno.h>
|
|
#include <stddef.h>
|
|
#include <sys/types.h>
|
|
|
|
#include <zephyr/posix/sys/mman.h>
|
|
|
|
int mlockall(int flags)
|
|
{
|
|
ARG_UNUSED(flags);
|
|
|
|
errno = ENOSYS;
|
|
return -1;
|
|
}
|
|
|
|
int munlockall(void)
|
|
{
|
|
errno = ENOSYS;
|
|
return -1;
|
|
}
|