POSIX: add posix_fallocate and a preallocate syscall

the preallocate syscall will call the preallocate filesystem hook, if available.

fix #6285

Change-Id: Ifff4595548610c8e009d4e5ffb64c37e0884e62d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3382
Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
Jérôme Duval
2020-11-12 10:41:21 +00:00
parent 1f7ac2962b
commit fe357eb9c9
7 changed files with 72 additions and 0 deletions
+1
View File
@@ -99,6 +99,7 @@ extern int openat(int fd, const char *path, int openMode, ...);
extern int fcntl(int fd, int op, ...);
extern int posix_fadvise(int fd, off_t offset, off_t len, int advice);
extern int posix_fallocate(int fd, off_t offset, off_t len);
#ifdef __cplusplus
}
+1
View File
@@ -252,6 +252,7 @@ int _user_dup(int fd);
int _user_dup2(int ofd, int nfd);
status_t _user_lock_node(int fd);
status_t _user_unlock_node(int fd);
status_t _user_preallocate(int fd, off_t offset, off_t length);
/* socket user prototypes (implementation in socket.cpp) */
int _user_socket(int family, int type, int protocol);
+1
View File
@@ -338,6 +338,7 @@ extern status_t _kern_lock_node(int fd);
extern status_t _kern_unlock_node(int fd);
extern status_t _kern_get_next_fd_info(team_id team, uint32 *_cookie,
struct fd_info *info, size_t infoSize);
extern status_t _kern_preallocate(int fd, off_t offset, off_t length);
// socket functions
extern int _kern_socket(int family, int type, int protocol);