mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-20 05:49:08 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0b61c5ffed | ||
![]() |
9ceac74e91 | ||
![]() |
9afc7100a1 | ||
![]() |
22fbd62368 | ||
![]() |
b4f7c065ba | ||
![]() |
bbf90ac3cd | ||
![]() |
2a8514d8a5 | ||
![]() |
3b2b7938f7 |
@@ -13,7 +13,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
|
|||||||
|
|
||||||
LIBBSD_ABI_MAJOR=0
|
LIBBSD_ABI_MAJOR=0
|
||||||
LIBBSD_ABI_MINOR=8
|
LIBBSD_ABI_MINOR=8
|
||||||
LIBBSD_ABI_PATCH=5
|
LIBBSD_ABI_PATCH=7
|
||||||
|
|
||||||
LIBBSD_ABI="$LIBBSD_ABI_MAJOR:$LIBBSD_ABI_MINOR:$LIBBSD_ABI_PATCH"
|
LIBBSD_ABI="$LIBBSD_ABI_MAJOR:$LIBBSD_ABI_MINOR:$LIBBSD_ABI_PATCH"
|
||||||
AC_SUBST([LIBBSD_ABI])
|
AC_SUBST([LIBBSD_ABI])
|
||||||
|
@@ -67,7 +67,9 @@ int sradixsort(const unsigned char **base, int nmemb,
|
|||||||
const unsigned char *table, unsigned endbyte);
|
const unsigned char *table, unsigned endbyte);
|
||||||
|
|
||||||
void *reallocf(void *ptr, size_t size);
|
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);
|
void *reallocarray(void *ptr, size_t nmemb, size_t size);
|
||||||
|
#endif
|
||||||
|
|
||||||
long long strtonum(const char *nptr, long long minval, long long maxval,
|
long long strtonum(const char *nptr, long long minval, long long maxval,
|
||||||
const char **errstr);
|
const char **errstr);
|
||||||
|
@@ -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);
|
char *strnstr(const char *str, const char *find, size_t str_len);
|
||||||
void strmode(mode_t mode, char *str);
|
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);
|
void explicit_bzero(void *buf, size_t len);
|
||||||
|
#endif
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -25,10 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __has_include
|
#ifndef __has_include
|
||||||
#define __has_include 1
|
#define __has_include(x) 1
|
||||||
#endif
|
#endif
|
||||||
#ifndef __has_include_next
|
#ifndef __has_include_next
|
||||||
#define __has_include_next 1
|
#define __has_include_next(x) 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
|
@@ -129,7 +129,11 @@ reserved to indicate an error.
|
|||||||
.Xr random 3
|
.Xr random 3
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
These functions first appeared in
|
These functions first appeared in
|
||||||
.Ox 2.1 .
|
.Ox 2.1 ,
|
||||||
|
.Fx 3.0 ,
|
||||||
|
.Nx 1.6 ,
|
||||||
|
and
|
||||||
|
.Dx 1.0 .
|
||||||
.Pp
|
.Pp
|
||||||
The original version of this random number generator used the
|
The original version of this random number generator used the
|
||||||
RC4 (also known as ARC4) algorithm.
|
RC4 (also known as ARC4) algorithm.
|
||||||
|
@@ -72,4 +72,5 @@ pass, making it useful for clearing sensitive memory such as a password.
|
|||||||
The
|
The
|
||||||
.Fn explicit_bzero
|
.Fn explicit_bzero
|
||||||
function first appeared in
|
function first appeared in
|
||||||
.Ox 5.5 .
|
.Ox 5.5 ,
|
||||||
|
glibc 2.25.
|
||||||
|
33
man/libbsd.7
33
man/libbsd.7
@@ -150,13 +150,36 @@ function can be used.
|
|||||||
Otherwise the code needs to be prepared for neither of these functions being
|
Otherwise the code needs to be prepared for neither of these functions being
|
||||||
available.
|
available.
|
||||||
.El
|
.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
|
.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
|
.Nm libmd
|
||||||
companion library, so it is advised to use that instead, as the ones
|
companion library, so it is advised to use that instead.
|
||||||
provided in
|
.It Fn explicit_bzero
|
||||||
.Nm libbsd
|
This function is provided by
|
||||||
might disappear on the next SONAME bump.
|
.Nm glibc
|
||||||
|
2.25.
|
||||||
|
.It Fn reallocarray
|
||||||
|
This function is provided by
|
||||||
|
.Nm glibc
|
||||||
|
2.26.
|
||||||
|
.El
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr arc4random 3bsd ,
|
.Xr arc4random 3bsd ,
|
||||||
.Xr bitstring 3bsd ,
|
.Xr bitstring 3bsd ,
|
||||||
|
@@ -102,4 +102,5 @@ is set to
|
|||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
.Fn reallocarray
|
.Fn reallocarray
|
||||||
appeared in
|
appeared in
|
||||||
.Ox 5.6 .
|
.Ox 5.6 ,
|
||||||
|
glibc 2.26.
|
||||||
|
@@ -173,14 +173,14 @@ setproctitle_init(int argc, char *argv[], char *envp[])
|
|||||||
end = nul + 1;
|
end = nul + 1;
|
||||||
|
|
||||||
for (i = 0; i < argc || (i >= argc && argv[i]); i++) {
|
for (i = 0; i < argc || (i >= argc && argv[i]); i++) {
|
||||||
if (argv[i] == NULL || argv[i] < end)
|
if (argv[i] == NULL || argv[i] != end)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
end = argv[i] + strlen(argv[i]) + 1;
|
end = argv[i] + strlen(argv[i]) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; envp[i]; i++) {
|
for (i = 0; envp[i]; i++) {
|
||||||
if (envp[i] < end)
|
if (envp[i] != end)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
end = envp[i] + strlen(envp[i]) + 1;
|
end = envp[i] + strlen(envp[i]) + 1;
|
||||||
|
@@ -69,8 +69,17 @@ main(int argc, char **argv)
|
|||||||
rc = nlist(argv[0], nl);
|
rc = nlist(argv[0], nl);
|
||||||
assert(rc == 0);
|
assert(rc == 0);
|
||||||
|
|
||||||
|
#if defined(__powerpc64__) && _CALL_ELF == 1
|
||||||
|
/* On PowerPC 64-bit ELFv1, the functions are stored in
|
||||||
|
* the .text sections but they are accessed through a function
|
||||||
|
* descriptor stored in a data section, for example for PowerPC
|
||||||
|
* 64-bit that section is called .opd. */
|
||||||
|
assert(nl[0].n_type == (N_DATA | N_EXT));
|
||||||
|
assert(nl[1].n_type == (N_DATA | N_EXT));
|
||||||
|
#else
|
||||||
assert(nl[0].n_type == (N_TEXT | N_EXT));
|
assert(nl[0].n_type == (N_TEXT | N_EXT));
|
||||||
assert(nl[1].n_type == (N_TEXT | N_EXT));
|
assert(nl[1].n_type == (N_TEXT | N_EXT));
|
||||||
|
#endif
|
||||||
assert(nl[2].n_type == (N_BSS | N_EXT));
|
assert(nl[2].n_type == (N_BSS | N_EXT));
|
||||||
assert(nl[3].n_type == (N_DATA | N_EXT));
|
assert(nl[3].n_type == (N_DATA | N_EXT));
|
||||||
assert(nl[4].n_type == (N_DATA));
|
assert(nl[4].n_type == (N_DATA));
|
||||||
|
Reference in New Issue
Block a user