.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH GETLINE 3 2010-06-12 "GNU" "Linux Programmer's Manual"
+.TH GETLINE 3 2014-04-06 "GNU" "Linux Programmer's Manual"
.SH NAME
getline, getdelim \- delimited string input
.SH SYNOPSIS
If
.I "*lineptr"
-is NULL, then
-.BR getline ()
-will allocate a buffer for storing the line,
-which should be freed by the user program.
-(In this case, the value in
+is set to NULL and
.I *n
-is ignored.)
+is set 0 before the call, then
+.BR getline ()
+will allocate a buffer for storing the line.
+This buffer should be freed by the user program
+even if
+.BR getline ()
+failed.
Alternatively, before calling
.BR getline (),
and
.BR getdelim ()
return the number of characters read, including the delimiter character,
-but not including the terminating null byte.
+but not including the terminating null byte (\(aq\\0\(aq).
This value can be used
to handle embedded null bytes in the line read.
Both functions return \-1 on failure to read a line (including end-of-file
condition).
+In the event of an error,
+.I errno
+is set to indicate the cause.
.SH ERRORS
.TP
.B EINVAL
.BR fgets (3),
.BR fopen (3),
.BR fread (3),
-.BR gets (3),
.BR scanf (3)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.