1 #ifndef _LIB_OPENBSD_H_
2 #define _LIB_OPENBSD_H_
7 #include "readpassphrase.h"
9 /* API definitions lifted from OpenBSD src/include */
12 #define _PW_NAME_LEN 63
15 #ifndef HAVE_REALLOCARRAY
16 void * reallocarray(void *optr, size_t nmemb, size_t size);
17 #endif /* HAVE_REALLOCARRAY */
19 long long strtonum(const char *numstr, long long minval,
20 long long maxval, const char **errstrp);
21 #endif /* !HAVE_STRTONUM */
24 #ifndef HAVE_EXPLICIT_BZERO
25 void explicit_bzero(void *, size_t);
28 size_t strlcat(char *dst, const char *src, size_t dsize);
29 #endif /* !HAVE_STRLCAT */
31 size_t strlcpy(char *dst, const char *src, size_t dsize);
32 #endif /* !HAVE_STRLCPY */
36 int execvpe(const char *, char *const *, char *const *);
37 #endif /* !HAVE_EXECVPE */
38 #ifndef HAVE_SETRESUID
39 int setresuid(uid_t, uid_t, uid_t);
40 #endif /* !HAVE_SETRESUID */
42 int pledge(const char *promises, const char *paths[]);
43 #endif /* !HAVE_PLEDGE */
47 void verrc(int eval, int code, const char *fmt, va_list ap);
48 #endif /* !HAVE_VERRC */
50 void errc(int eval, int code, const char *fmt, ...);
51 #endif /* !HAVE_ERRC */
53 #ifndef HAVE_SETPROGNAME
54 const char * getprogname(void);
55 void setprogname(const char *progname);
56 #endif /* !HAVE_SETPROGNAME */
58 #endif /* _LIB_OPENBSD_H_ */