src/funopen.c


Log

Author Commit Date CI Message
Guillem Jover bc65806c 2023-04-06T23:05:27 build: Select whether to include funopen() in the build system This makes sure we include it when expected, alongside the man pages, and the test cases, and do not accidentally break the ABI if the system starts providing such interface.
Khem Raj ec88b7bb 2022-12-15T09:02:22 funopen: Replace off64_t with off_t in funopen_seek() AC_SYS_LARGEFILE in configure.ac is setting needed defines to make 64bit off_t on relevant platforms. Fixes build on musl: | src/funopen.c:68:28: error: unknown type name 'off64_t'; did you mean 'off_t'? | funopen_seek(void *cookie, off64_t *offset, int whence) | ^~~~~~~ | off_t Closes: !24 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover e5089628 2022-11-23T23:31:54 build: Do not require funopen() to be ported This function cannot be easily and (more importantly) correctly ported without cooperation from the libc stdio layer. We already document that users should be prepared to have the function not available on some platforms and that they should ideally switch their code to other more portable and better interfaces. Instead of making the build fail, and requiring porters to add exceptions for something that most probably cannot be ported correctly anyway, simply print a warning and let it build. This will not be a regression because on those systems libbsd would have never been built before. Prompted-by: Jens Finkhaeuser <jens@finkhaeuser.de>
Guillem Jover d54ceb37 2021-02-07T00:09:45 Update copyright claims
Guillem Jover cfeafeab 2020-08-16T21:58:04 funopen: Fix memory leak in funopen_close() when closefn is NULL We need to free the cookiewrap even when the closefn method is NULL. Warned-by: gcc ASAN
Guillem Jover d6c35f61 2017-01-10T04:33:15 Do not provide funopen() on musl Fixes: https://bugs.debian.org/818246
Guillem Jover f41fdcf1 2013-10-21T05:07:56 Add funopen() function This is a wrapper over the glibc fopencookie() function. We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations, because seekfn() there wrongly uses fpos_t, assuming it's an integral type, and any code using that on a system where fpos_t is a struct (such as GNU-based systems or NetBSD) will fail to build. In which case, as the code has to be modified anyway, we might just as well use the correct declaration.