From 3f5e3f5d066dcffb80af48ae2cf35a01a85a8f10 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 6 Jul 2018 16:53:48 +0200 Subject: 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. --- libio/ftello64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libio/ftello64.c') diff --git a/libio/ftello64.c b/libio/ftello64.c index 281667fee2..d5546e1fb0 100644 --- a/libio/ftello64.c +++ b/libio/ftello64.c @@ -32,7 +32,7 @@ #ifndef __OFF_T_MATCHES_OFF64_T off64_t -ftello64 (FILE *fp) +__ftello64 (FILE *fp) { off64_t pos; CHECK_FILE (fp, -1L); @@ -52,5 +52,6 @@ ftello64 (FILE *fp) } return pos; } - +libc_hidden_def (__ftello64) +weak_alias (__ftello64, ftello64) #endif -- cgit 1.4.1