Adjust strlcpy() and strlcat() per glibc adoption

These functions were added in glibc 2.38, in anticipation of POSIX
adopting them too.

Closes: #26
This commit is contained in:
Guillem Jover 2024-01-07 17:43:12 +01:00
parent ecb44e1655
commit df116b5597
3 changed files with 11 additions and 4 deletions

View File

@ -267,6 +267,11 @@ need_id_from_name=yes
need_fpurge=yes
need_funopen=yes
AS_CASE([$host_os],
[*-gnu*], [
# On glibc >= 2.38, strlcpy() and strlcat() got added,
# so these could then be dropped on the next SOVERSION bump.
#need_strl=no
],
[*-musl*], [
# On musl >= 0.5.0, strlcpy() and strlcat() were already implemented,
# so these can then be dropped on the next SOVERSION bump.

View File

@ -41,7 +41,8 @@
#include <sys/types.h>
__BEGIN_DECLS
#ifndef __APPLE__
#if !defined(__APPLE__) && \
(!defined(__GLIBC__) || !__GLIBC_PREREQ(2, 38) || !defined(_DEFAULT_SOURCE))
size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz);
#endif

View File

@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: May 31 2007 $
.Dd $Mdocdate: January 7 2024 $
.Dt strlcpy 3bsd
.Os
.Sh NAME
@ -192,6 +192,7 @@ and
functions first appeared in
.Ox 2.4 ,
and made their appearance in
.Nx 1.4.3
.Nx 1.4.3 ,
.Fx 3.3
and
.Fx 3.3 .
glibc 2.38.