Skip to contentSkip to conversation

getline(3) was added to POSIX 2008

PATCH In review Mike Frysinger 3 participants 4 messages Nov 4, 2009 – Dec 5, 2009 2 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getline(3) was added to POSIX 2008

---
 man3/getline.3 |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
man3/getline.3 +1 -3
index 2687809..622b5c8 100644
@@ -26,7 +26,6 @@
 getline, getdelim \- delimited string input
 .SH SYNOPSIS
 .nf
-.B #define _GNU_SOURCE
 .B #include <stdio.h>
 .sp
 .BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream );
@@ -113,11 +112,10 @@ Both
 .BR getline ()
 and
 .BR getdelim ()
-are GNU extensions.
+were added in POSIX.1-2008.
 They are available since libc 4.6.27.
 .SH "EXAMPLE"
 .nf
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 
Signature · 6 lines
1.6.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1257370830-12899-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org

#2 lore raw
Quoted 10 lines · Mike Frysinger
---
 man3/getline.3 |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
man3/getline.3 +0 -0
index 2687809..622b5c8 100644

man3/getline.3 line 29

Quoted 5 lines
man3/getline.3 +0 -1
@@ -26,7 +26,6 @@
 getline, getdelim \- delimited string input
 .SH SYNOPSIS
 .nf
-.B #define _GNU_SOURCE
 .B #include <stdio.h>

Dropping the symbol wouldn't work on any older libc.

-Andi

Signature · 6 lines
ak-VuQAYsv1563Yd54FQh9/[email protected] -- Speaking for myself only.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 87fx8t89aa.fsf-3rXA9MLqAseW/qJFnhkgxti2O/[email protected]

#4 lore raw
Quoted 6 lines · On Thursday 05 November 2009 07:07:25 Andi Kleen wrote:
Quoted 5 lines · Mike Frysinger

Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org> ---

 man3/getline.3 |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Quoted 12 lines

man3/getline.3 line 29

Quoted 10 lines
man3/getline.3 +0 -1
index 2687809..622b5c8 100644
@@ -26,7 +26,6 @@
 getline, getdelim \- delimited string input
 .SH SYNOPSIS
 .nf
-.B #define _GNU_SOURCE
 .B #include <stdio.h>

Dropping the symbol wouldn't work on any older libc.

the description section needs a feature_test_macros section added to it -mike

#5 lore raw
In reply to a message not in the archive

Hi Mike, Andi

Quoted 23 lines · Mike Frysinger

---
 man3/getline.3 |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)
man3/getline.3 +0 -0
index 2687809..622b5c8 100644
@@ -26,7 +26,6 @@

 getline, getdelim \- delimited string input
 .SH SYNOPSIS
 .nf
-.B #define _GNU_SOURCE
 .B #include <stdio.h>
 .sp
 .BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream );

man3/getline.3 +0 -0
@@ -113,11 +112,10 @@ Both
  .BR getline ()

 and
 .BR getdelim ()

man3/getline.3 +1 -1
-are GNU extensions.
+were added in POSIX.1-2008.
Quoted 6 lines

 They are available since libc 4.6.27.
 .SH "EXAMPLE"
 .nf
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>

As pointed out in the follow-ups, this wouldn't be sufficient. I applied the following for 2.34. Okay?

Cheers,

Michael

man3/getline.3 +22 -4
@@ -21,12 +21,11 @@
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" License.
-.TH GETLINE 3  2006-05-17 "GNU" "Linux Programmer's Manual"
+.TH GETLINE 3  2009-12-05 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getline, getdelim \- delimited string input
 .SH SYNOPSIS
 .nf
-.B #define _GNU_SOURCE
 .B #include <stdio.h>
 .sp
 .BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream );
@@ -34,6 +33,23 @@ getline, getdelim \- delimited string input
 .BI "ssize_t getdelim(char **" lineptr ", size_t *" n ", int " delim \
 ", FILE *" stream );
 .fi
+.sp
+.in -4n
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.in
+
+Before glibc 2.10:
+.br
+.BR getline (),
+.BR getdelim ():
+_GNU_SOURCE
+
+Since glibc 2.10:
+.br
+.BR getline (),
+.BR getdelim ():
+_POSIX_C_SOURCE >= 200809 || _XOPEN_SOURCE >= 700
 .SH DESCRIPTION
 .BR getline ()
 reads an entire line from \fIstream\fP,
@@ -108,13 +124,15 @@ or
 is NULL, or
 .I stream
 is not valid).
+.SH VERSIONS
+These functions are available since libc 4.6.27.
 .SH "CONFORMING TO"
 Both
 .BR getline ()
 and
 .BR getdelim ()
-are GNU extensions.
-They are available since libc 4.6.27.
+were originally GNU extensions.
+They were standardized in POSIX.1-2008.
 .SH "EXAMPLE"
 .nf
 #define _GNU_SOURCE
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface" http://blog.man7.org/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html