[PATCH] <stdio.h>: Remove comment about getline(3) not being in POSIX

Philip Kaludercic philipk@posteo.net
Sun Jun 9 15:08:04 GMT 2024


Sam James <sam@gentoo.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Sam James <sam@gentoo.org> writes:
>>
>>> Philip Kaludercic <philipk@posteo.net> writes:
>>>
>>>> Hi,
>>>>
>>>> The current comment stems from 2003[0, 2c008571c3a], and unless I am
>>>> missing something should have been removed with the addition of getline
>>>> in POSIX.1-2008.
>>>
>>> Please include this commentary in the commit message.
>>
>> Sure, here is the updated version:
>
> Thanks.
>
>>
>> [2. text/x-diff; 0001-stdio.h-Remove-comment-about-getline-3-not-being-in-.patch]
>> From 6502738a3df65a6e929d11963ff2c0cd1952f7a3 Mon Sep 17 00:00:00 2001
>> From: Philip Kaludercic <philipk@posteo.net>
>> Date: Sun, 9 Jun 2024 13:14:59 +0200
>> Subject: [PATCH] <stdio.h>: Remove comment about getline(3) not being in POSIX
>>
>> The comment was written in 2003 (added in 2c008571c3a), predating the
>> addition of getline(3) in POSIX.1-2008.
>> ---
>>  libio/stdio.h | 7 +------
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> Reviewed-by: Sam James <sam@gentoo.org>

Should I add this to the commit as well? 

> (I don't see the need to keep the old comment given it's now
> standardised; anyone can look up that it's (not) a cancellation point
> now, as it's not a glibc decision.)

What change are you suggesting?  Also, I just noticed there is a similar
comment a few lines above wrt. getdelim that should also be updated:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-stdio.h-Acknowledge-that-getdelim-getline-are-in-POS.patch
Type: text/x-diff
Size: 2224 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20240609/27325c45/attachment.bin>
-------------- next part --------------

>>
>> diff --git a/libio/stdio.h b/libio/stdio.h
>> index cbecabe1d9..a9dfd38c70 100644
>> --- a/libio/stdio.h
>> +++ b/libio/stdio.h
>> @@ -698,12 +698,7 @@ extern __ssize_t getdelim (char **__restrict __lineptr,
>>                             size_t *__restrict __n, int __delimiter,
>>                             FILE *__restrict __stream) __wur __nonnull ((4));
>>  
>> -/* Like `getdelim', but reads up to a newline.
>> -
>> -   This function is not part of POSIX and therefore no official
>> -   cancellation point.  But due to similarity with an POSIX interface
>> -   or due to the implementation it is a cancellation point and
>> -   therefore not marked with __THROW.  */
>> +/* Like `getdelim', but reads up to a newline.  */
>>  extern __ssize_t getline (char **__restrict __lineptr,
>>                            size_t *__restrict __n,
>>                            FILE *__restrict __stream) __wur __nonnull ((3));
>> -- 
>> 2.39.2
>>
>>
>>>
>>>>
>>>> [2. [PATCH] <stdio.h>: Remove comment about getline(3) not being in
>>>> POSIX --- text/x-patch;
>>>> 0001-stdio-h---Remove-comment-about-getline-3--not-bei.patch]...
>>>>
>>>>
>>>> [0] https://sourceware.org/git/?p=glibc.git;a=commit;h=2c008571c3a
>>>
>

-- 
	Philip Kaludercic on icterid


More information about the Libc-alpha mailing list