diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-15 16:29:03 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-15 16:29:03 +0000 |
commit | 2575a3dc952f1875037029fbeaadf3f724902611 (patch) | |
tree | 1b9457746b50822112f2a78da8228eb1a8bfc54f /src/libutil/util.h | |
parent | 4f3a539f03893f0ddff60ff2b529a8fb1d22fab6 (diff) | |
download | rspamd-2575a3dc952f1875037029fbeaadf3f724902611.tar.gz rspamd-2575a3dc952f1875037029fbeaadf3f724902611.zip |
Add common routine to map a file
Diffstat (limited to 'src/libutil/util.h')
-rw-r--r-- | src/libutil/util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/util.h b/src/libutil/util.h index 06b6f7d42..43b0eb01b 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -441,4 +441,14 @@ struct event_base * event_get_base (struct event *ev); */ int rspamd_file_xopen (const char *fname, int oflags, guint mode); +/** + * Map file without following symlinks or special stuff + * @param fname filename + * @param mode mode to open + * @param size target size (must NOT be NULL) + * @return pointer to memory (should be freed using munmap) or NULL in case of error + */ +gpointer rspamd_file_xmap (const char *fname, guint mode, + gsize *size); + #endif |