summaryrefslogtreecommitdiffstats
path: root/man3/getline.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--man3/getline.321
1 files changed, 10 insertions, 11 deletions
diff --git a/man3/getline.3 b/man3/getline.3
index 2b9d74a..991993e 100644
--- a/man3/getline.3
+++ b/man3/getline.3
@@ -4,7 +4,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH getline 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH getline 3 2023-10-31 "Linux man-pages 6.7"
.SH NAME
getline, getdelim \- delimited string input
.SH LIBRARY
@@ -13,18 +13,18 @@ Standard C library
.SH SYNOPSIS
.nf
.B #include <stdio.h>
-.PP
+.P
.BI "ssize_t getline(char **restrict " lineptr ", size_t *restrict " n ,
.BI " FILE *restrict " stream );
.BI "ssize_t getdelim(char **restrict " lineptr ", size_t *restrict " n ,
.BI " int " delim ", FILE *restrict " stream );
.fi
-.PP
+.P
.RS -4
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.RE
-.PP
+.P
.BR getline (),
.BR getdelim ():
.nf
@@ -40,7 +40,7 @@ storing the address of the buffer containing the text into
.IR *lineptr .
The buffer is null-terminated and includes the newline character, if
one was found.
-.PP
+.P
If
.I *lineptr
is set to NULL before the call, then
@@ -50,7 +50,7 @@ This buffer should be freed by the user program
even if
.BR getline ()
failed.
-.PP
+.P
Alternatively, before calling
.BR getline (),
.I *lineptr
@@ -68,13 +68,13 @@ updating
and
.I *n
as necessary.
-.PP
+.P
In either case, on a successful call,
.I *lineptr
and
.I *n
will be updated to reflect the buffer address and allocated size respectively.
-.PP
+.P
.BR getdelim ()
works like
.BR getline (),
@@ -94,13 +94,13 @@ return the number of characters read, including the delimiter character,
but not including the terminating null byte (\[aq]\e0\[aq]).
This value can be used
to handle embedded null bytes in the line read.
-.PP
+.P
Both functions return \-1 on failure to read a line (including end-of-file
condition).
In the event of a failure,
.I errno
is set to indicate the error.
-.PP
+.P
If
.I *lineptr
was set to NULL before the call, then the buffer should be freed by the
@@ -133,7 +133,6 @@ T{
.BR getdelim ()
T} Thread safety MT-Safe
.TE
-.sp 1
.SH STANDARDS
POSIX.1-2008.
.SH HISTORY