diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2024-03-07 11:32:03 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2024-03-07 11:32:03 +0000 |
commit | 9eb461aa4b61ab47855b2cee9e5b626a76888b5e (patch) | |
tree | 17240d083c051abd781ba10291171f50f411e52a /compat/include |
Diffstat (limited to 'compat/include')
-rw-r--r-- | compat/include/stdlib.h | 20 | ||||
-rw-r--r-- | compat/include/string.h | 16 | ||||
-rw-r--r-- | compat/include/sys/types.h | 15 |
3 files changed, 51 insertions, 0 deletions
diff --git a/compat/include/stdlib.h b/compat/include/stdlib.h new file mode 100644 index 000000000000..75b18881a7b7 --- /dev/null +++ b/compat/include/stdlib.h @@ -0,0 +1,20 @@ +/* + * stdlib.h compatibility shim + * Public domain + */ + +#include_next <stdlib.h> + +#ifndef DIFFCOMPAT_STDLIB_H +#define DIFFCOMPAT_STDLIB_H + +#include <sys/types.h> +#include <stdint.h> + +const char * getprogname(void); + +void *reallocarray(void *, size_t, size_t); +void *recallocarray(void *, size_t, size_t, size_t); +int mergesort(void *, size_t, size_t, int (*cmp)(const void *, const void *)); + +#endif diff --git a/compat/include/string.h b/compat/include/string.h new file mode 100644 index 000000000000..75190903aba8 --- /dev/null +++ b/compat/include/string.h @@ -0,0 +1,16 @@ +/* + * string.h compatibility shim + * Public domain + */ + +#include_next <string.h> + +#ifndef DIFFCOMPAT_STRING_H +#define DIFFCOMPAT_STRING_H + +#include <sys/types.h> + +size_t strlcpy(char *dst, const char *src, size_t dstsize); +size_t strlcat(char *dst, const char *src, size_t dstsize); + +#endif diff --git a/compat/include/sys/types.h b/compat/include/sys/types.h new file mode 100644 index 000000000000..f580c7c593a8 --- /dev/null +++ b/compat/include/sys/types.h @@ -0,0 +1,15 @@ +/* + * Public domain + * sys/types.h compatibility shim + */ + +#include_next <sys/types.h> + +#ifndef DIFFCOMPAT_SYS_TYPES_H +#define DIFFCOMPAT_SYS_TYPES_H + +#if !defined(__dead) +#define __dead __attribute__((__noreturn__)) +#endif + +#endif |