diff options
Diffstat (limited to 'manual')
-rw-r--r-- | manual/stdio.texi | 26 | ||||
-rw-r--r-- | manual/time.texi | 3 | ||||
-rw-r--r-- | manual/tunables.texi | 2 |
3 files changed, 18 insertions, 13 deletions
diff --git a/manual/stdio.texi b/manual/stdio.texi index 01b9f47..29ed720 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -1231,17 +1231,18 @@ convenient to have functions to read a line of text from a stream. Standard C has functions to do this, but they aren't very safe: null characters and even (for @code{gets}) long lines can confuse them. So -@theglibc{} provides the nonstandard @code{getline} function that -makes it easy to read lines reliably. +@theglibc{} provides the @code{getline} function that makes it easy to +read lines reliably. -Another GNU extension, @code{getdelim}, generalizes @code{getline}. It -reads a delimited record, defined as everything through the next -occurrence of a specified delimiter character. +The @code{getdelim} function is a generalized version of @code{getline}. +It reads a delimited record, defined as everything through the next +occurrence of a specified delimiter character. These functions were +both GNU extensions until standardized by POSIX.1-2008. All these functions are declared in @file{stdio.h}. -@deftypefun ssize_t getline (char **@var{lineptr}, size_t *@var{n}, FILE *@var{stream}) -@standards{GNU, stdio.h} +@deftypefun ssize_t getline (char **restrict @var{lineptr}, size_t *restrict @var{n}, FILE *restrict @var{stream}) +@standards{POSIX.1-2008, stdio.h} @safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@aculock{} @acucorrupt{} @acsmem{}}} @c Besides the usual possibility of getting an inconsistent stream in a @c signal handler or leaving it inconsistent in case of cancellation, @@ -1274,15 +1275,15 @@ read (including the newline, but not including the terminating null). This value enables you to distinguish null characters that are part of the line from the null character inserted as a terminator. -This function is a GNU extension, but it is the recommended way to read -lines from a stream. The alternative standard functions are unreliable. +This function was originally a GNU extension, but was added in +POSIX.1-2008. If an error occurs or end of file is reached without any bytes read, @code{getline} returns @code{-1}. @end deftypefun -@deftypefun ssize_t getdelim (char **@var{lineptr}, size_t *@var{n}, int @var{delimiter}, FILE *@var{stream}) -@standards{GNU, stdio.h} +@deftypefun ssize_t getdelim (char **restrict @var{lineptr}, size_t *restrict @var{n}, int @var{delimiter}, FILE *restrict @var{stream}) +@standards{POSIX.1-2008, stdio.h} @safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@aculock{} @acucorrupt{} @acsmem{}}} @c See the getline @acucorrupt note. This function is like @code{getline} except that the character which @@ -1294,6 +1295,9 @@ The text is stored in @var{lineptr}, including the delimiter character and a terminating null. Like @code{getline}, @code{getdelim} makes @var{lineptr} bigger if it isn't big enough. +This function was originally a GNU extension, but was added in +POSIX.1-2008. + @code{getline} is in fact implemented in terms of @code{getdelim}, just like this: diff --git a/manual/time.texi b/manual/time.texi index 04c97f5..6b89b85 100644 --- a/manual/time.texi +++ b/manual/time.texi @@ -148,7 +148,8 @@ and pass them to the functions that convert them to broken-down time On POSIX-conformant systems, @code{time_t} is an integer type and its values represent the number of seconds elapsed since the @dfn{POSIX Epoch}, which is January 1, 1970, at 00:00:00 Coordinated Universal Time (UTC)@. -The count of seconds ignores leap seconds. +The count of seconds ignores leap seconds. Additionally, POSIX.1-2024 +added the requirement that @code{time_t} be at least 64 bits wide. @Theglibc{} additionally guarantees that @code{time_t} is a signed type, and that all of its functions operate correctly on negative diff --git a/manual/tunables.texi b/manual/tunables.texi index 67064f5..d11ca7e 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -367,7 +367,7 @@ stack is allowed from the main program. Setting the value to @code{0} disables the ABI auto-negotiation (meaning no executable stacks even if the ABI or ELF header requires it), @code{1} enables auto-negotiation (although the program might not need an executable stack), while @code{2} forces an executable -stack at process start. Tthis is provided for compatibility reasons, when +stack at process start. This is provided for compatibility reasons, when the program dynamically loads modules with @code{dlopen} which require an executable stack. |