From 7754455c48c50764ad7291ea508109c53b60517f Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Fri, 27 Mar 2020 14:40:33 +0200 Subject: cache I/O implementation and fixes. Signed-off-by: Gediminas Jakutis --- src/io.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index 9fdad38..688ec35 100644 --- a/src/io.c +++ b/src/io.c @@ -45,7 +45,7 @@ int stream_close(struct stream * const in) try(!in || in->fd < 0, early_err, EINVAL, "invalid argunent"); - if (!in->out) { + if (in->out != 1) { goto out; } @@ -135,9 +135,15 @@ static int stream_open_special(struct stream * const in) int ret = 0; try(stat(in->name, &st), err, errno, "stat failed: %s", strerror(ret)); - in->fd = open(in->name, O_RDONLY | O_NOATIME); + in->fd = open(in->name, O_RDONLY); try(in->fd < 0, err, errno, "failed opening input file: %s", strerror(ret)); err: return ret; } + +int direct_get_array(struct stream * const restrict in, ssize_t idx, struct entry_l * const data); +int direct_get_list(struct stream * const restrict in, ssize_t idx, struct entry_l * const data); + +int direct_put_array(struct stream * const restrict in, ssize_t idx, const struct entry_l * const data); +int direct_put_list(struct stream * const restrict in, ssize_t idx, const struct entry_l * const data); -- cgit v1.2.3