I'd like to reserve space for a file being downloaded, like posix_fallocate()
does.
Is there an asynchronous API as well, or do I need to sacrifice a background thread?
There isn't an asynchronous version of posix_fallocate
.
You do need to invoke this function in another thread to avoid blocking the current thread.