diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:34:50 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:34:50 +0300 |
commit | 44311f4235463a8d4d3c4128242bbd7c9d2a203b (patch) | |
tree | 61cf649234696840338a76e6c83a8d5b8f45460f /src/util.h | |
parent | 4499fc92189905fde71139822d784ab7819b181c (diff) | |
download | rspamd-44311f4235463a8d4d3c4128242bbd7c9d2a203b.tar.gz rspamd-44311f4235463a8d4d3c4128242bbd7c9d2a203b.zip |
Detect and use fallocate/posix_fallocate.
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 165b84334..c4fcc80f4 100644 --- a/src/util.h +++ b/src/util.h @@ -241,4 +241,13 @@ gboolean rspamd_strtol (const gchar *s, gsize len, glong *value); */ gboolean rspamd_strtoul (const gchar *s, gsize len, gulong *value); +/** + * Try to allocate a file on filesystem (using fallocate or posix_fallocate) + * @param fd descriptor + * @param offset offset of file + * @param len length to allocate + * @return -1 in case of failure + */ +gint rspamd_fallocate (gint fd, off_t offset, off_t len); + #endif |