tdb: Use posix_fallocate
authorVolker Lendecke <vl@samba.org>
Wed, 23 Aug 2017 11:02:57 +0000 (13:02 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 24 Aug 2017 03:38:49 +0000 (05:38 +0200)
commita475e1c4b0009987a818faa953d1be3ee9b68894
treeeadb700ebafde41dcd93ca8a9c11a9c0dcc36152
parenta05debc113847ca3fd46ea63ec05a3fa357aa8e5
tdb: Use posix_fallocate

This should be significantly faster than pwriting.

openbsd doesn't have posix_fallocate, so we do need the fallback. Also, it
might have weird failure modes, so we keep the old code in place except for
posix_fallocate returning success or ENOSPC.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 24 05:38:49 CEST 2017 on sn-devel-144
lib/tdb/common/io.c