Hash :
af7386f1
Author :
Date :
2024-11-05T15:57:20
doc: improve documentation for malloc, realloc etc
@node strdup
@subsection @code{strdup}
@findex strdup
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/strdup.html}
Gnulib module: strdup or strdup-posix
@mindex strdup
@mindex strdup-posix
Portability problems fixed by either Gnulib module @code{strdup} or @code{strdup-posix}:
@itemize
@item
This function has no prototype in @code{<string.h>} on some old platforms.
@end itemize
Portability problems fixed by Gnulib module @code{strdup-posix}:
@itemize
@item
On some platforms, when the function fails it does not set @code{errno}:
mingw, MSVC 14.
@item
On some platforms, when the function fails it might set @code{errno}
to @code{EAGAIN} instead of to @code{ENOMEM}. Although POSIX allows
@code{EAGAIN}, the @code{strdup-posix} module insists on @code{ENOMEM}
which also conforms to POSIX and is GNU-compatible:
Solaris 11.4.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize