]> git.armaanb.net Git - opendoas.git/blob - libopenbsd/openbsd.h
793d9bf39363668845867b3cd35e827993e8eea4
[opendoas.git] / libopenbsd / openbsd.h
1 #ifndef _LIB_OPENBSD_H_
2 #define _LIB_OPENBSD_H_
3
4 #include <stdarg.h>
5 #include <sys/types.h>
6
7 /* API definitions lifted from OpenBSD src/include */
8
9 /* pwd.h */
10 #define _PW_NAME_LEN 63
11
12 /* stdlib.h */
13 #ifndef HAVE_REALLOCARRAY
14 void * reallocarray(void *optr, size_t nmemb, size_t size);
15 #endif /* HAVE_REALLOCARRAY */
16 #ifndef HAVE_STRTONUM
17 long long strtonum(const char *numstr, long long minval,
18                 long long maxval, const char **errstrp);
19 #endif /* !HAVE_STRTONUM */
20
21 /* string.h */
22 #ifndef HAVE_EXPLICIT_BZERO
23 void explicit_bzero(void *, size_t);
24 #endif
25 #ifndef HAVE_STRLCAT
26 size_t strlcat(char *dst, const char *src, size_t dsize);
27 #endif /* !HAVE_STRLCAT */
28 #ifndef HAVE_STRLCPY
29 size_t strlcpy(char *dst, const char *src, size_t dsize);
30 #endif /* !HAVE_STRLCPY */
31
32 /* unistd.h */
33 #ifndef HAVE_EXECVPE
34 int execvpe(const char *, char *const *, char *const *);
35 #endif /* !HAVE_EXECVPE */
36 #ifndef HAVE_SETRESUID
37 int setresuid(uid_t, uid_t, uid_t);
38 #endif /* !HAVE_SETRESUID */
39 #ifndef HAVE_PLEDGE
40 int pledge(const char *promises, const char *paths[]);
41 #endif /* !HAVE_PLEDGE */
42 #ifndef HAVE_CLOSEFROM
43 void closefrom(int);
44 #endif /* !HAVE_CLOSEFROM */
45
46 /* err.h */
47 #ifndef HAVE_VERRC
48 void verrc(int eval, int code, const char *fmt, va_list ap);
49 #endif /* !HAVE_VERRC */
50 #ifndef HAVE_ERRC
51 void errc(int eval, int code, const char *fmt, ...);
52 #endif /* !HAVE_ERRC */
53
54 #ifndef HAVE_SETPROGNAME
55 const char * getprogname(void);
56 void setprogname(const char *progname);
57 #endif /* !HAVE_SETPROGNAME */
58
59 #endif /* _LIB_OPENBSD_H_ */