diff options
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 147 |
1 files changed, 121 insertions, 26 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 76862cc8a..852948c54 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h | |||
@@ -1,5 +1,9 @@ | |||
1 | /* $Id: openbsd-compat.h,v 1.24 2003/08/29 16:59:52 mouring Exp $ */ | ||
2 | |||
1 | /* | 3 | /* |
2 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. | 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. | ||
3 | * | 7 | * |
4 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
@@ -22,45 +26,136 @@ | |||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 27 | */ |
24 | 28 | ||
25 | /* $Id: openbsd-compat.h,v 1.23 2003/06/11 12:51:32 djm Exp $ */ | 29 | #ifndef _OPENBSD_COMPAT_H |
26 | 30 | #define _OPENBSD_COMPAT_H | |
27 | #ifndef _OPENBSD_H | ||
28 | #define _OPENBSD_H | ||
29 | 31 | ||
30 | #include "config.h" | 32 | #include "includes.h" |
31 | 33 | ||
32 | /* OpenBSD function replacements */ | 34 | /* OpenBSD function replacements */ |
33 | #include "basename.h" | ||
34 | #include "bindresvport.h" | ||
35 | #include "getcwd.h" | ||
36 | #include "realpath.h" | ||
37 | #include "rresvport.h" | ||
38 | #include "strlcpy.h" | ||
39 | #include "strlcat.h" | ||
40 | #include "strmode.h" | ||
41 | #include "mktemp.h" | ||
42 | #include "daemon.h" | ||
43 | #include "dirname.h" | ||
44 | #include "base64.h" | 35 | #include "base64.h" |
45 | #include "sigact.h" | 36 | #include "sigact.h" |
46 | #include "inet_ntoa.h" | ||
47 | #include "inet_ntop.h" | ||
48 | #include "strsep.h" | ||
49 | #include "setproctitle.h" | ||
50 | #include "getgrouplist.h" | ||
51 | #include "glob.h" | 37 | #include "glob.h" |
52 | #include "readpassphrase.h" | 38 | #include "readpassphrase.h" |
53 | #include "getopt.h" | ||
54 | #include "vis.h" | 39 | #include "vis.h" |
55 | #include "getrrsetbyname.h" | 40 | #include "getrrsetbyname.h" |
56 | 41 | ||
42 | |||
43 | #ifndef HAVE_BASENAME | ||
44 | char *basename(const char *path); | ||
45 | #endif | ||
46 | |||
47 | #ifndef HAVE_BINDRESVPORT_SA | ||
48 | int bindresvport_sa(int sd, struct sockaddr *sa); | ||
49 | #endif | ||
50 | |||
51 | #ifndef HAVE_GETCWD | ||
52 | char *getcwd(char *pt, size_t size); | ||
53 | #endif | ||
54 | |||
55 | #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) | ||
56 | char *realpath(const char *path, char *resolved); | ||
57 | #endif | ||
58 | |||
59 | #ifndef HAVE_RRESVPORT_AF | ||
60 | int rresvport_af(int *alport, sa_family_t af); | ||
61 | #endif | ||
62 | |||
63 | #ifndef HAVE_STRLCPY | ||
64 | /* #include <sys/types.h> XXX Still needed? */ | ||
65 | size_t strlcpy(char *dst, const char *src, size_t siz); | ||
66 | #endif | ||
67 | |||
68 | #ifndef HAVE_STRLCAT | ||
69 | /* #include <sys/types.h> XXX Still needed? */ | ||
70 | size_t strlcat(char *dst, const char *src, size_t siz); | ||
71 | #endif | ||
72 | |||
73 | #ifndef HAVE_SETENV | ||
74 | int setenv(register const char *name, register const char *value, int rewrite); | ||
75 | #endif | ||
76 | |||
77 | #ifndef HAVE_STRMODE | ||
78 | void strmode(int mode, char *p); | ||
79 | #endif | ||
80 | |||
81 | #if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) | ||
82 | int mkstemps(char *path, int slen); | ||
83 | int mkstemp(char *path); | ||
84 | char *mkdtemp(char *path); | ||
85 | #endif | ||
86 | |||
87 | #ifndef HAVE_DAEMON | ||
88 | int daemon(int nochdir, int noclose); | ||
89 | #endif | ||
90 | |||
91 | #ifndef HAVE_DIRNAME | ||
92 | char *dirname(const char *path); | ||
93 | #endif | ||
94 | |||
95 | #if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA) | ||
96 | char *inet_ntoa(struct in_addr in); | ||
97 | #endif | ||
98 | |||
99 | #ifndef HAVE_INET_NTOP | ||
100 | const char *inet_ntop(int af, const void *src, char *dst, size_t size); | ||
101 | #endif | ||
102 | |||
103 | #ifndef HAVE_INET_ATON | ||
104 | int inet_aton(const char *cp, struct in_addr *addr); | ||
105 | #endif | ||
106 | |||
107 | #ifndef HAVE_STRSEP | ||
108 | char *strsep(char **stringp, const char *delim); | ||
109 | #endif | ||
110 | |||
111 | #ifndef HAVE_SETPROCTITLE | ||
112 | void setproctitle(const char *fmt, ...); | ||
113 | void compat_init_setproctitle(int argc, char *argv[]); | ||
114 | #endif | ||
115 | |||
116 | #ifndef HAVE_GETGROUPLIST | ||
117 | /* #include <grp.h> XXXX Still needed ? */ | ||
118 | int getgrouplist(const char *, gid_t, gid_t *, int *); | ||
119 | #endif | ||
120 | |||
121 | #if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET) | ||
122 | int BSDgetopt(int argc, char * const *argv, const char *opts); | ||
123 | #endif | ||
124 | |||
125 | |||
57 | /* Home grown routines */ | 126 | /* Home grown routines */ |
58 | #include "bsd-arc4random.h" | ||
59 | #include "bsd-getpeereid.h" | ||
60 | #include "bsd-misc.h" | 127 | #include "bsd-misc.h" |
61 | #include "bsd-snprintf.h" | ||
62 | #include "bsd-waitpid.h" | 128 | #include "bsd-waitpid.h" |
63 | 129 | ||
130 | /*#include <sys/types.h> XXX Still needed? * For uid_t, gid_t * */ | ||
131 | |||
132 | #ifndef HAVE_GETPEEREID | ||
133 | int getpeereid(int , uid_t *, gid_t *); | ||
134 | #endif | ||
135 | |||
136 | #ifndef HAVE_ARC4RANDOM | ||
137 | unsigned int arc4random(void); | ||
138 | void arc4random_stir(void); | ||
139 | #endif /* !HAVE_ARC4RANDOM */ | ||
140 | |||
141 | |||
142 | |||
143 | |||
144 | /* #include <sys/types.h> XXX needed? For size_t */ | ||
145 | |||
146 | #ifndef HAVE_SNPRINTF | ||
147 | int snprintf(char *, size_t, const char *, ...); | ||
148 | #endif | ||
149 | |||
150 | #ifndef HAVE_VSNPRINTF | ||
151 | int vsnprintf(char *, size_t, const char *, va_list); | ||
152 | #endif | ||
153 | |||
154 | void *xmmap(size_t size); | ||
155 | char *xcrypt(const char *password, const char *salt); | ||
156 | char *shadow_pw(struct passwd *pw); | ||
157 | |||
158 | |||
64 | /* rfc2553 socket API replacements */ | 159 | /* rfc2553 socket API replacements */ |
65 | #include "fake-rfc2553.h" | 160 | #include "fake-rfc2553.h" |
66 | 161 | ||
@@ -70,4 +165,4 @@ | |||
70 | #include "port-irix.h" | 165 | #include "port-irix.h" |
71 | #include "port-aix.h" | 166 | #include "port-aix.h" |
72 | 167 | ||
73 | #endif /* _OPENBSD_H */ | 168 | #endif /* _OPENBSD_COMPAT_H */ |