libio: Implement internal function __libc_readline_unlocked
authorFlorian Weimer <fweimer@redhat.com>
Fri, 6 Jul 2018 14:53:48 +0000 (16:53 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 6 Jul 2018 15:52:54 +0000 (17:52 +0200)
commit3f5e3f5d066dcffb80af48ae2cf35a01a85a8f10
tree2eb99509fbdfb5f61ee40bdf634c63f092b85ae2
parent397c54c1afa531242602fe3ac7bb47eff0e909f9
libio: Implement internal function __libc_readline_unlocked

This is a variant of fgets which fails with ERANGE if the
buffer is too small, and the buffer length is given as an
argument of type size_t.

This function will be useful for implementing NSS file reading
operations.  Compared to a direct implementation using the public API,
it avoids an lseek system call in case the line terminator can be
found in the internal read buffer.
ChangeLog
include/stdio.h
libio/Makefile
libio/Versions
libio/fseeko.c
libio/fseeko64.c
libio/ftello.c
libio/ftello64.c
libio/readline.c [new file with mode: 0644]
libio/tst-readline.c [new file with mode: 0644]