]> git.armaanb.net Git - opendoas.git/blob - libopenbsd/openbsd.h
open pam sessions with right user and remove setusercontext shim
[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 #include "readpassphrase.h"
8
9 /* API definitions lifted from OpenBSD src/include */
10
11 /* pwd.h */
12 #define _PW_NAME_LEN 63
13
14 /* stdlib.h */
15 #ifndef HAVE_REALLOCARRAY
16 void * reallocarray(void *optr, size_t nmemb, size_t size);
17 #endif /* HAVE_REALLOCARRAY */
18 #ifndef HAVE_STRTONUM
19 long long strtonum(const char *numstr, long long minval,
20                 long long maxval, const char **errstrp);
21 #endif /* !HAVE_STRTONUM */
22
23 /* string.h */
24 #ifndef HAVE_EXPLICIT_BZERO
25 void explicit_bzero(void *, size_t);
26 #endif
27 #ifndef HAVE_STRLCAT
28 size_t strlcat(char *dst, const char *src, size_t dsize);
29 #endif /* !HAVE_STRLCAT */
30 #ifndef HAVE_STRLCPY
31 size_t strlcpy(char *dst, const char *src, size_t dsize);
32 #endif /* !HAVE_STRLCPY */
33
34 /* unistd.h */
35 #ifndef HAVE_EXECVPE
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 */
41 #ifndef HAVE_PLEDGE
42 int pledge(const char *promises, const char *paths[]);
43 #endif /* !HAVE_PLEDGE */
44
45 /* err.h */
46 #ifndef HAVE_VERRC
47 void verrc(int eval, int code, const char *fmt, va_list ap);
48 #endif /* !HAVE_VERRC */
49 #ifndef HAVE_ERRC
50 void errc(int eval, int code, const char *fmt, ...);
51 #endif /* !HAVE_ERRC */
52
53 #ifndef HAVE_SETPROGNAME
54 const char * getprogname(void);
55 void setprogname(const char *progname);
56 #endif /* !HAVE_SETPROGNAME */
57
58 #endif /* _LIB_OPENBSD_H_ */