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/fgetln.c
AgeCommit message (Collapse)AuthorLines
2018年09月16日fix null pointer subtraction and comparison in stdio Rich Felker-1/+1
morally, for null pointers a and b, a-b, a<b, and a>b should all be defined as 0; however, C does not define any of them. the stdio implementation makes heavy use of such pointer comparison and subtraction for buffer logic, and also uses null pos/base/end pointers to indicate that the FILE is not in the corresponding (read or write) mode ready for accesses through the buffer. all of the comparisons are fixed trivially by using != in place of the relational operators, since the opposite relation (e.g. pos>end) is logically impossible. the subtractions have been reviewed to check that they are conditional the stream being in the appropriate reading- or writing-through-buffer mode, with checks added where needed. in fgets and getdelim, the checks added should improve performance for unbuffered streams by avoiding a do-nothing call to memchr, and should be negligible for buffered streams.
2013年12月12日include cleanups: remove unused headers and add feature test macros Szabolcs Nagy-0/+1
2012年11月08日clean up stdio_impl.h Rich Felker-0/+1
this header evolved to facilitate the extremely lazy practice of omitting explicit includes of the necessary headers in individual stdio source files; not only was this sloppy, but it also increased build time. now, stdio_impl.h is only including the headers it needs for its own use; any further headers needed by source files are included directly where needed.
2012年08月11日add bsd fgetln function Rich Felker-0/+19
optimized to avoid allocation and return lines directly out of the stream buffer whenever possible.
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月10日 04:15:21 +0000

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