Branch
Hash :
3ac88aeb
Author :
Date :
2025-10-09T20:41:09
getline: Work around a glibc bug. * m4/getline.m4 (gl_FUNC_GETLINE): Check that the buffer is terminated with a NUL character when the first character read is EOF. Guess that the function does not work on glibc. * doc/posix-functions/getline.texi: Mention the bug.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
@node getline
@subsection @code{getline}
@findex getline
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/getline.html}
Gnulib module: getline
@mindex getline
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, Solaris 10, mingw, MSVC 14, Android 4.2.
@item
This function is missing a declaration on some platforms:
AIX 7.1.
@item
Some platforms provide a function by this name but with the wrong
signature, for example in -linet.
@item
This function crashes when passed a pointer to a NULL buffer together with a
pointer to a non-zero buffer size on some platforms:
FreeBSD 8.0.
@item
This function does not NUL terminate the buffer when the first
character read is EOF on some platforms:
@c https://sourceware.org/PR28038
glibc 2.42.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
This function has quadratic running time for long lines on some platforms:
uClibc 0.9.31.
@end itemize