Blob


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