diff options
Diffstat (limited to 'libc-bottom-half/cloudlibc/src/libc/fcntl/posix_fallocate.c')
-rw-r--r-- | libc-bottom-half/cloudlibc/src/libc/fcntl/posix_fallocate.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libc-bottom-half/cloudlibc/src/libc/fcntl/posix_fallocate.c b/libc-bottom-half/cloudlibc/src/libc/fcntl/posix_fallocate.c new file mode 100644 index 0000000..4b41c4b --- /dev/null +++ b/libc-bottom-half/cloudlibc/src/libc/fcntl/posix_fallocate.c @@ -0,0 +1,13 @@ +// Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/ +// +// SPDX-License-Identifier: BSD-2-Clause + +#include <wasi/api.h> +#include <errno.h> +#include <fcntl.h> + +int posix_fallocate(int fd, off_t offset, off_t len) { + if (offset < 0 || len < 0) + return EINVAL; + return __wasi_fd_allocate(fd, offset, len); +} |