27 #define flock(fd, op) (0)
33 #define __dead __attribute__ ((__noreturn__))
37 #define pledge(s, p) (0)
38 #define unveil(s, p) (0)
46 #include <uuid/uuid.h>
48 #define uuid_s_bad_version 1
49 #define uuid_s_invalid_string_uuid 2
50 #define uuid_s_no_memory 3
52 /* Length of a node address (an IEEE 802 address). */
53 #define _UUID_NODE_LEN 6
58 uint16_t time_hi_and_version;
59 uint8_t clock_seq_hi_and_reserved;
60 uint8_t clock_seq_low;
61 uint8_t node[_UUID_NODE_LEN];
64 int32_t uuid_equal(struct uuid *, struct uuid *, uint32_t *);
65 int32_t uuid_is_nil(struct uuid *, uint32_t *);
66 void uuid_create(uuid_t *, uint32_t *);
67 void uuid_create_nil(struct uuid *, uint32_t *);
68 void uuid_from_string(const char *, uuid_t *, uint32_t *);
69 void uuid_to_string(uuid_t *, char **, uint32_t *);
79 #include <sys/queue.h>
81 #include "compat/queue.h"
87 #include "compat/tree.h"
100 #include "compat/imsg.h"
103 #ifndef HAVE_ASPRINTF
105 int asprintf(char **, const char *, ...);
106 int vasprintf(char **, const char *, va_list);
109 #ifndef HAVE_EXPLICIT_BZERO
110 /* explicit_bzero.c */
111 void explicit_bzero(void *, size_t);
114 #ifndef HAVE_GETDTABLECOUNT
115 /* getdtablecount.c */
116 int getdtablecount(void);
119 #ifndef HAVE_CLOSEFROM
121 //void closefrom(int);
122 #define closefrom(fd) (closefrom(fd), 0)
127 char *strsep(char **, const char *);
130 #ifndef HAVE_STRTONUM
132 long long strtonum(const char *, long long, long long, const char **);
137 size_t strlcpy(char *, const char *, size_t);
142 size_t strlcat(char *, const char *, size_t);
147 size_t strnlen(const char *, size_t);
152 char *strndup(const char *, size_t);
155 #ifndef HAVE_GETPROGNAME
157 const char *getprogname(void);
162 ssize_t getline(char **, size_t *, FILE *);
165 #ifndef HAVE_FREEZERO
167 void freezero(void *, size_t);
170 #ifndef HAVE_GETDTABLECOUNT
171 /* getdtablecount.c */
172 int getdtablecount(void);
175 #ifndef HAVE_REALLOCARRAY
177 void *reallocarray(void *, size_t, size_t);
180 #ifndef HAVE_RECALLOCARRAY
181 /* recallocarray.c */
182 void *recallocarray(void *, size_t, size_t, size_t);
185 #ifndef HAVE_FMT_SCALED
187 int fmt_scaled(long long, char *);
188 int scan_scaled(char *, long long *);
189 #define FMT_SCALED_STRSIZE 7 /* minus sign, 4 digits, suffix, null byte */
195 extern int BSDopterr;
196 extern int BSDoptind;
197 extern int BSDoptopt;
198 extern int BSDoptreset;
199 extern char *BSDoptarg;
200 int BSDgetopt(int, char *const *, const char *);
201 #define getopt(ac, av, o) BSDgetopt(ac, av, o)
202 #define opterr BSDopterr
203 #define optind BSDoptind
204 #define optopt BSDoptopt
205 #define optreset BSDoptreset
206 #define optarg BSDoptarg
210 #ifndef HAVE_BSD_MERGESORT
212 int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));