]> git.armaanb.net Git - opendoas.git/blob - libopenbsd/openbsd.h
Add configure script
[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 #include <sys/cdefs.h>
7
8 #include "readpassphrase.h"
9
10 /* API definitions lifted from OpenBSD src/include */
11
12 /* bsd_auth.h */
13 #ifndef HAVE_BSD_AUTH_H
14 int auth_userokay(char *, char *, char *, char *);
15 #endif /* !HAVE_BSD_AUTH_H */
16
17 /* login_cap.h */
18 #ifndef HAVE_LOGIN_CAP_H
19 #define        LOGIN_SETGROUP          0x0001  /* Set group */
20 #define        LOGIN_SETLOGIN          0x0002  /* Set login */
21 #define        LOGIN_SETPATH           0x0004  /* Set path */
22 #define        LOGIN_SETPRIORITY       0x0008  /* Set priority */
23 #define        LOGIN_SETRESOURCES      0x0010  /* Set resource limits */
24 #define        LOGIN_SETUMASK          0x0020  /* Set umask */
25 #define        LOGIN_SETUSER           0x0040  /* Set user */
26 #define        LOGIN_SETENV            0x0080  /* Set environment */
27 #define        LOGIN_SETALL            0x00ff  /* Set all. */
28
29 typedef struct login_cap login_cap_t;
30 struct passwd;
31 int setusercontext(login_cap_t *, struct passwd *, uid_t, unsigned int);
32 #endif /* !HAVE_LOGIN_CAP_H */
33
34 /* pwd.h */
35 #define _PW_NAME_LEN 63
36
37 /* stdlib.h */
38 #ifndef HAVE_REALLOCARRAY
39 void * reallocarray(void *optr, size_t nmemb, size_t size);
40 #endif /* HAVE_REALLOCARRAY */
41 #ifndef HAVE_STRTONUM
42 long long strtonum(const char *numstr, long long minval,
43                 long long maxval, const char **errstrp);
44 #endif /* !HAVE_STRTONUM */
45
46 /* string.h */
47 #ifndef HAVE_EXPLICIT_BZERO
48 void explicit_bzero(void *, size_t);
49 #endif
50 #ifndef HAVE_STRLCAT
51 size_t strlcat(char *dst, const char *src, size_t dsize);
52 #endif /* !HAVE_STRLCAT */
53 #ifndef HAVE_STRLCPY
54 size_t strlcpy(char *dst, const char *src, size_t dsize);
55 #endif /* !HAVE_STRLCPY */
56
57 /* unistd.h */
58 #ifndef HAVE_EXECVPE
59 int execvpe(const char *, char *const *, char *const *);
60 #endif /* !HAVE_EXECVPE */
61 #ifndef HAVE_SETRESUID
62 int setresuid(uid_t, uid_t, uid_t);
63 #endif /* !HAVE_SETRESUID */
64 #ifndef HAVE_PLEDGE
65 int pledge(const char *promises, const char *paths[]);
66 #endif /* !HAVE_PLEDGE */
67
68 /* err.h */
69 #ifndef HAVE_VERRC
70 void verrc(int eval, int code, const char *fmt, va_list ap);
71 #endif /* !HAVE_VERRC */
72 #ifndef HAVE_ERRC
73 void errc(int eval, int code, const char *fmt, ...);
74 #endif /* !HAVE_ERRC */
75
76 #ifndef HAVE_SETPROGNAME
77 const char * getprogname(void);
78 void setprogname(const char *progname);
79 #endif /* !HAVE_SETPROGNAME */
80
81 #endif /* _LIB_OPENBSD_H_ */