diff options
author | Colin Walters <walters@verbum.org> | 2016-06-03 11:00:10 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2016-06-09 14:39:09 +0000 |
commit | 70e548925809f3727e9e6ecff32a9cdf5bdb7185 (patch) | |
tree | 4874249db32713b884b8047b671c0e4ac19e7c85 /src/libotutil/ot-fs-utils.h | |
parent | 3a03a35071f9ac56de2345f5f496c662e04d8029 (diff) | |
download | ostree-70e548925809f3727e9e6ecff32a9cdf5bdb7185.tar.gz |
lib: Add a helper for mmap->bytes with openat(), use it in repo
This kills another GSystem consumer...I think down the line I'd like
to do something like "detect whether file is > 1k if so, mmap,
otherwise just readall()" so we can use this helper in more places.
Closes: #319
Approved by: jlebon
Diffstat (limited to 'src/libotutil/ot-fs-utils.h')
-rw-r--r-- | src/libotutil/ot-fs-utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libotutil/ot-fs-utils.h b/src/libotutil/ot-fs-utils.h index cfeea74d..27f0f38e 100644 --- a/src/libotutil/ot-fs-utils.h +++ b/src/libotutil/ot-fs-utils.h @@ -66,4 +66,8 @@ gboolean ot_openat_ignore_enoent (int dfd, int *out_fd, GError **error); +GBytes *ot_file_mapat_bytes (int dfd, + const char *path, + GError **error); + G_END_DECLS |