musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/fopencookie.c
AgeCommit message (Collapse)AuthorLines
2018年04月18日minor cleanup in fopencookie Rich Felker-5/+2
assign entire struct rather than member-at-a-time. don't repeat buffer sizes; always use sizeof to ensure consistency.
2017年12月06日implement the fopencookie extension to stdio William Pitcock-0/+138
notes added by maintainer: this function is a GNU extension. it was chosen over the similar BSD function funopen because the latter depends on fpos_t being an arithmetic type as part of its public API, conflicting with our definition of fpos_t and with the intent that it be an opaque type. it was accepted for inclusion because, despite not being widely used, it is usually very difficult to extricate software using it from the dependency on it. calling pattern for the read and write callbacks is not likely to match glibc or other implementations, but should work with any reasonable callbacks. in particular the read function is never called without at least one byte being needed to satisfy its caller, so that spurious blocking is not introduced. contracts for what callbacks called from inside libc/stdio can do are always complicated, and at some point still need to be specified explicitly. at the very least, the callbacks must return or block indefinitely (they cannot perform nonlocal exits) and they should not make calls to stdio using their own FILE as an argument.
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月07日 04:29:46 +0000

AltStyle によって変換されたページ (->オリジナル) /