block: move fcntl_setfl()

It is only used by block/file-posix.c, move it there.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Marc-André Lureau
2022-03-29 15:27:12 +04:00
parent 4d14cb0cd7
commit ad24b679d2
3 changed files with 15 additions and 17 deletions
-15
View File
@@ -897,21 +897,6 @@ size_t qemu_get_host_physmem(void)
return 0;
}
/* Sets a specific flag */
int fcntl_setfl(int fd, int flag)
{
int flags;
flags = fcntl(fd, F_GETFL);
if (flags == -1) {
return -errno;
}
if (fcntl(fd, F_SETFL, flags | flag) == -1) {
return -errno;
}
return 0;
}
int qemu_msync(void *addr, size_t length, int fd)
{
size_t align_mask = ~(qemu_real_host_page_size() - 1);