]> git.armaanb.net Git - opendoas.git/blobdiff - libopenbsd/openbsd.h
Handle empty argv
[opendoas.git] / libopenbsd / openbsd.h
index 793d9bf39363668845867b3cd35e827993e8eea4..1572b9c1c42f82517c7e4a6ddc599b8ce15e3bde 100644 (file)
@@ -4,10 +4,15 @@
 #include <stdarg.h>
 #include <sys/types.h>
 
-/* API definitions lifted from OpenBSD src/include */
+#ifndef __UNUSED
+# define __UNUSED __attribute__ ((unused))
+#endif
 
-/* pwd.h */
-#define _PW_NAME_LEN 63
+#ifndef __dead
+# define __dead __attribute__ ((noreturn))
+#endif
+
+/* API definitions lifted from OpenBSD src/include */
 
 /* stdlib.h */
 #ifndef HAVE_REALLOCARRAY
@@ -45,10 +50,10 @@ void closefrom(int);
 
 /* err.h */
 #ifndef HAVE_VERRC
-void verrc(int eval, int code, const char *fmt, va_list ap);
+void __dead verrc(int eval, int code, const char *fmt, va_list ap);
 #endif /* !HAVE_VERRC */
 #ifndef HAVE_ERRC
-void errc(int eval, int code, const char *fmt, ...);
+__dead void errc(int eval, int code, const char *fmt, ...);
 #endif /* !HAVE_ERRC */
 
 #ifndef HAVE_SETPROGNAME
@@ -56,4 +61,11 @@ const char * getprogname(void);
 void setprogname(const char *progname);
 #endif /* !HAVE_SETPROGNAME */
 
+#ifndef HAVE_SETRESGID
+int    setresgid(gid_t, gid_t, gid_t);
+#endif
+#ifndef HAVE_SETRESUID
+int    setresuid(uid_t, uid_t, uid_t);
+#endif
+
 #endif /* _LIB_OPENBSD_H_ */