#6285: Implement posix_fallocate() ---------------------------+------------------------------------------------ Reporter: korli | Owner: nobody Type: enhancement | Status: new Priority: low | Milestone: R1 Component: System/POSIX | Version: R1/alpha2 Resolution: | Keywords: Blocked By: | Has a Patch: 0 Platform: All | Blocking: ---------------------------+------------------------------------------------ Comment (by bonefish): Replying to [comment:4 korli]: > I'm in the process of adding the following call to struct fs_vnode_ops in headers/os/drivers/fs_interface.h (just after write_stat()): > {{{ > status_t fallocate(fs_volume* volume, fs_vnode* vnode, off_t offset, off_t len); > }}} > > Some objections? Nope, but don't forget add the call also to the fs_shell and userlandfs. Replying to [comment:5 axeld]: > Yes - the name is awful. I would just call it preallocate(). +1 > Beyond that, it might not always be simple to implement, and I am unsure if we would need to return "ok" in that case anyway. Then the function wouldn't make much sense. The whole point is that after a successful call of the function, writes cannot fail due to lack of disk space. If the file system can't ensure that, it has to fail, returning a suitable error code (`ENOSYS` or `ENOTSUP`). -- Ticket URL: <http://dev.haiku-os.org/ticket/6285#comment:6> Haiku <http://dev.haiku-os.org> Haiku - the operating system.