]> git.proxmox.com Git - wasi-libc.git/blame - libc-bottom-half/cloudlibc/src/libc/fcntl/posix_fallocate.c
Wasi snapshot preview1 (#140)
[wasi-libc.git] / libc-bottom-half / cloudlibc / src / libc / fcntl / posix_fallocate.c
CommitLineData
320054e8
DG
1// Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
2//
3// SPDX-License-Identifier: BSD-2-Clause
4
446cb3f1 5#include <wasi/api.h>
320054e8
DG
6#include <errno.h>
7#include <fcntl.h>
8
9int posix_fallocate(int fd, off_t offset, off_t len) {
10 if (offset < 0 || len < 0)
11 return EINVAL;
12#ifdef __wasilibc_unmodified_upstream
13 return __wasi_file_allocate(fd, offset, len);
14#else
15 return __wasi_fd_allocate(fd, offset, len);
16#endif
17}