]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Handle several functions now being provided by glibc
authorGuillem Jover <guillem@hadrons.org>
Sat, 2 Sep 2017 17:55:50 +0000 (19:55 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sun, 3 Dec 2017 15:43:28 +0000 (16:43 +0100)
We mention that these are now superseded by the glibc implementations,
make the headers cope with already declared functions on glibc-based
systems, and document this in the man pages.

include/bsd/stdlib.h
include/bsd/string.h
man/explicit_bzero.3bsd
man/libbsd.7
man/reallocarray.3bsd

index 46a009ecb92701ae3add3ca87e7a9e348287f97d..ebc9638d0b2444b96e4ef1bb6b5316dc346fbbdc 100644 (file)
@@ -67,7 +67,9 @@ int sradixsort(const unsigned char **base, int nmemb,
                const unsigned char *table, unsigned endbyte);
 
 void *reallocf(void *ptr, size_t size);
+#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
 void *reallocarray(void *ptr, size_t nmemb, size_t size);
+#endif
 
 long long strtonum(const char *nptr, long long minval, long long maxval,
                    const char **errstr);
index ee2f95361b22cc918e6188e7a10a6b558590525b..6798bf65cbe377dfa8c0b1fe372e34f0b966ae8b 100644 (file)
@@ -42,7 +42,9 @@ size_t strlcat(char *dst, const char *src, size_t siz);
 char *strnstr(const char *str, const char *find, size_t str_len);
 void strmode(mode_t mode, char *str);
 
+#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
 void explicit_bzero(void *buf, size_t len);
+#endif
 __END_DECLS
 
 #endif
index b40929e704217e73fb1a85a83146f5b09bd2a83f..cf67c560ba3123f917ef6cdd08b62da1339bbe6a 100644 (file)
@@ -72,4 +72,5 @@ pass, making it useful for clearing sensitive memory such as a password.
 The
 .Fn explicit_bzero
 function first appeared in
-.Ox 5.5 .
+.Ox 5.5 ,
+glibc 2.25.
index 19af0aaf05a7a78a88e1e22e52209b81486a21fc..ea2d2816096b1e2a74f8e3a2ca68816f0ccd82df 100644 (file)
@@ -150,13 +150,36 @@ function can be used.
 Otherwise the code needs to be prepared for neither of these functions being
 available.
 .El
+.Sh SUPERSEDED
+Some functions have been superseded by implementations in other system
+libraries, and might disappear on the next SONAME bump, assuming those
+other implementation have widespread deployment, or the implementations
+are present in all major
+.Nm libc
+for example.
 .Pp
-In addition, the MD5 set of digest funtions are now provided by the
+.Bl -tag -width 4m -compact
+.It Fn MD5Init
+.It Fn MD5Update
+.It Fn MD5Pad
+.It Fn MD5Final
+.It Fn MD5Transform
+.It Fn MD5End
+.It Fn MD5File
+.It Fn MD5FileChunk
+.It Fn MD5Data
+The set of MD5 digest functions are now provided by the
 .Nm libmd
-companion library, so it is advised to use that instead, as the ones
-provided in
-.Nm libbsd
-might disappear on the next SONAME bump.
+companion library, so it is advised to use that instead.
+.It Fn explicit_bzero
+This function is provided by
+.Nm glibc
+2.25.
+.It Fn reallocarray
+This function is provided by
+.Nm glibc
+2.26.
+.El
 .Sh SEE ALSO
 .Xr arc4random 3bsd ,
 .Xr bitstring 3bsd ,
index b1aff9c5b923ec609f0c65b439c43d92c15fed23..96563eaa9f5f87923339987ab9331d4b05c6ced4 100644 (file)
@@ -102,4 +102,5 @@ is set to
 .Sh HISTORY
 .Fn reallocarray
 appeared in
-.Ox 5.6 .
+.Ox 5.6 ,
+glibc 2.26.