Hi all, Based on a discussion on #musl about the merits of fgetln as an efficient (probably optimal) way to do line-based stdio processing if the implementation is good, I got to wondering if it's viable to use the interface in programs intended to be portable, i.e. if it could be written portably for use on any stdio implementation or at least any POSIX one. Here's the result -- a sample portable implementation that keeps a separate buffer for each fd, or for each FILE* when the stream lacks an associated fd. It has some limitations, but it seems to meet the interface contract and avoids using a single static buffer that would render if non-thread-safe. Rich