1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

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.
This commit is contained in:
Florian Weimer
2018-07-06 16:53:48 +02:00
parent 397c54c1af
commit 3f5e3f5d06
10 changed files with 471 additions and 9 deletions

View File

@ -32,7 +32,7 @@
#ifndef __OFF_T_MATCHES_OFF64_T
int
fseeko64 (FILE *fp, off64_t offset, int whence)
__fseeko64 (FILE *fp, off64_t offset, int whence)
{
int result;
CHECK_FILE (fp, -1);
@ -41,5 +41,6 @@ fseeko64 (FILE *fp, off64_t offset, int whence)
_IO_release_lock (fp);
return result;
}
libc_hidden_def (__fseeko64)
weak_alias (__fseeko64, fseeko64)
#endif