aboutsummaryrefslogtreecommitdiffstats
path: root/lib/buffer.c
AgeCommit message (Collapse)AuthorLines
2023-01-28Install a the configure_file (config.h) and use in headersBernd Schubert-1/+1
This addresses: https://github.com/libfuse/libfuse/issues/724 HAVE_LIBC_VERSIONED_SYMBOLS configures the library if to use versioned symbols and is set at meson configuration time. External filesystems (the main target, actually) include fuse headers and the preprocessor then acts on HAVE_LIBC_VERSIONED_SYMBOLS. Problem was now that 'config.h' was not distributed with libfuse and so HAVE_LIBC_VERSIONED_SYMBOLS was never defined with external tools and the preprocessor did the wrong decision. This commit also increases the the minimal meson version, as this depends on meson feature only available in 0.50 <quote 'meson' > WARNING: Project specifies a minimum meson_ version '>= 0.42' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'} </quote> Additionally the config file has been renamed to "fuse_config.h" to avoid clashes - 'config.h' is not very specific.
2020-11-11buffer.c: correct return value when buf is NULLZhiqiang Liu-1/+1
In commit d614415a ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func"), if fuse_bufvec_current func returns NULL, it returns 1 directly. Actually, we should return 0 when buf is NULL. Fixes: d614415a ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func") Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06buffer.c: check whether buf is NULL in fuse_bufvec_advance funcZhiqiang Liu-0/+3
In fuse_bufvec_advance func, calling fuse_bufvec_current func may return NULL, so we should check whether buf is NULL before using it. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Liu <lihaotian9@huawei.com>
2019-06-06Avoid pointer arithmetic with `void *`Michael Forney-6/+6
The pointer operand to the binary `+` operator must be to a complete object type. Since we are working with byte sizes, use `char *` instead.
2016-10-02Extended per-file comments.Nikolaus Rath-0/+3
This should make more clear what file contains code for what purpose.
2012-08-24Fix missing config.h in buffer.cMiklos Szeredi-0/+1
Due to an oversight, splice will never actually be used for i/o. Someone forgot to #include "config.h" in lib/buffer.c (in fact almost no files include that header). As a result, even though configure detects splice support and puts HAVE_SPLICE in config.h, buffer.c is always compiled as if there is no splice support. Also add #include "config.h" to fuse.c and fuse_lowlevel.c. These currently include it indirectly through fuse_misc.h, but we don't want to depend on that. Reported by Matthew Gabeler-Lee
2011-05-27Check if splice/vmsplice are supportedMiklos Szeredi-0/+11
2010-11-10fuse_buf_copy: check if buffers are the sameMiklos Szeredi-1/+13
When copying fuse buffers, check if the source and destination are the same and omit the copy as appropriate. Also check if the source and destination memory regions overlap and use memmove in that case.
2010-11-08Fix fuse_buf_copy() if already at the end of the buffersMiklos Szeredi-4/+14
2010-07-12libfuse: add buffer interfaceMiklos Szeredi-0/+284
Add a generic buffer interface for use with I/O. Buffer vectors are supplied and each buffer in the vector may be a memory pointer or a file descriptor. The fuse_reply_fd() interface is converted to using buffers.