1 babf5d5a 2021-05-11 martijn /* $Id: openbsd-compat.h,v 1.51 2010/10/07 10:25:29 djm Exp $ */
4 babf5d5a 2021-05-11 martijn * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
5 babf5d5a 2021-05-11 martijn * Copyright (c) 2003 Ben Lindstrom. All rights reserved.
6 babf5d5a 2021-05-11 martijn * Copyright (c) 2002 Tim Rice. All rights reserved.
8 babf5d5a 2021-05-11 martijn * Redistribution and use in source and binary forms, with or without
9 babf5d5a 2021-05-11 martijn * modification, are permitted provided that the following conditions
10 babf5d5a 2021-05-11 martijn * are met:
11 babf5d5a 2021-05-11 martijn * 1. Redistributions of source code must retain the above copyright
12 babf5d5a 2021-05-11 martijn * notice, this list of conditions and the following disclaimer.
13 babf5d5a 2021-05-11 martijn * 2. Redistributions in binary form must reproduce the above copyright
14 babf5d5a 2021-05-11 martijn * notice, this list of conditions and the following disclaimer in the
15 babf5d5a 2021-05-11 martijn * documentation and/or other materials provided with the distribution.
17 babf5d5a 2021-05-11 martijn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 babf5d5a 2021-05-11 martijn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 babf5d5a 2021-05-11 martijn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 babf5d5a 2021-05-11 martijn * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 babf5d5a 2021-05-11 martijn * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 babf5d5a 2021-05-11 martijn * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 babf5d5a 2021-05-11 martijn * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 babf5d5a 2021-05-11 martijn * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 babf5d5a 2021-05-11 martijn * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 babf5d5a 2021-05-11 martijn * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 babf5d5a 2021-05-11 martijn #include <stdlib.h>
30 babf5d5a 2021-05-11 martijn #ifdef NEED_EXPLICIT_BZERO
31 babf5d5a 2021-05-11 martijn void explicit_bzero(void *p, size_t n);
33 babf5d5a 2021-05-11 martijn #ifdef NEED_RECALLOCARRAY
34 babf5d5a 2021-05-11 martijn void *recallocarray(void *, size_t, size_t, size_t);
36 babf5d5a 2021-05-11 martijn #ifdef NEED_REALLOCARRAY
37 babf5d5a 2021-05-11 martijn void *reallocarray(void *, size_t, size_t);
39 babf5d5a 2021-05-11 martijn #ifdef NEED_STRLCAT
40 babf5d5a 2021-05-11 martijn size_t strlcat(char *dst, const char *src, size_t size);
42 babf5d5a 2021-05-11 martijn #ifdef NEED_STRLCPY
43 babf5d5a 2021-05-11 martijn size_t strlcpy(char *dst, const char *src, size_t size);
45 babf5d5a 2021-05-11 martijn #ifdef NEED_STRTONUM
46 babf5d5a 2021-05-11 martijn long long strtonum(const char *nptr, long long minval, long long maxval, const char **errstr);
48 babf5d5a 2021-05-11 martijn #ifdef NEED_PLEDGE
49 babf5d5a 2021-05-11 martijn static inline int
50 babf5d5a 2021-05-11 martijn pledge(const char *promises, const char *execpromises)
52 babf5d5a 2021-05-11 martijn return 0;