netatalk 4.4.3
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
compat.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1996 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
4 */
5
6#ifdef HAVE_CONFIG_H
7#include "config.h"
8#endif
9
10#include <signal.h>
11
12/* OpenBSD */
13#if defined(__OpenBSD__) && !defined(ENOTSUP)
14#define ENOTSUP EOPNOTSUPP
15#endif
16
17#if !defined(HAVE_PSELECT) || defined(__OpenBSD__)
18 extern int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *,
19 const sigset_t *);
20#endif
21
22#ifndef HAVE_STRNLEN
23 extern size_t strnlen(const char *s, size_t n);
24#endif
25
26#ifndef HAVE_STRLCPY
27 extern size_t strlcpy(char *, const char *, size_t);
28#endif
29
30#ifndef HAVE_STRLCAT
31 extern size_t strlcat(char *, const char *, size_t);
32#endif
33
34#ifndef HAVE_VASPRINTF
35#include <stdio.h>
36#include <stdarg.h>
37 extern int vasprintf(char **ret, const char *fmt, va_list ap);
38#endif
39
40/* Secure memory clearing - prefer memset_explicit (C23) over explicit_bzero */
41#if !defined(HAVE_MEMSET_EXPLICIT) && !defined(HAVE_EXPLICIT_BZERO)
42#include <stddef.h>
43 extern void explicit_bzero(void *s, size_t n);
44#elif defined(HAVE_MEMSET_EXPLICIT) && !defined(HAVE_EXPLICIT_BZERO)
45#include <string.h>
46#define explicit_bzero(s, n) memset_explicit((s), 0, (n))
47#endif
explicit_bzero
void explicit_bzero(void *s, size_t n)
Definition explicit_bzero.c:32
vasprintf
int vasprintf(char **ret, const char *fmt, va_list ap)
Definition misc.c:34
strlcat
size_t strlcat(char *, const char *, size_t)
Definition strlcpy.c:59
strlcpy
size_t strlcpy(char *, const char *, size_t)
Definition strlcpy.c:36
strnlen
size_t strnlen(const char *s, size_t n)
Definition misc.c:19
pselect
int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *)
config.h