summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/include
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/include')
-rw-r--r--util/libreboot-utils/include/common.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h
index 6d6d8d09..1bef0d50 100644
--- a/util/libreboot-utils/include/common.h
+++ b/util/libreboot-utils/include/common.h
@@ -22,6 +22,10 @@
#include <sys/syscall.h>
#endif
+#ifdef __OpenBSD__ /* for pledge */
+#include <unistd.h>
+#endif
+
#define items(x) (sizeof((x)) / sizeof((x)[0]))
/* system prototypes
@@ -83,7 +87,7 @@ int fchmod(int fd, mode_t mode);
#endif
#ifndef REAL_POS_IO
-#define REAL_POS_IO 0
+#define REAL_POS_IO 1
#endif
#ifndef LOOP_EAGAIN
@@ -369,12 +373,16 @@ void write_mac_part(size_t partnum);
/* string functions
*/
+int xunveilx(const char *path, const char *permissions);
+int xpledgex(const char *promises, const char *execpromises);
int slen(const char *scmp, size_t maxlen,
size_t *rval);
int scmp(const char *a, const char *b,
size_t maxlen, int *rval);
int sdup(const char *s,
size_t n, char **dest);
+int scatn(ssize_t sc, const char **sv,
+ size_t max, char **rval);
int scat(const char *s1, const char *s2,
size_t n, char **dest);
int dcat(const char *s, size_t n,
@@ -385,9 +393,11 @@ int dcat(const char *s, size_t n,
unsigned short hextonum(char ch_s);
void *mkrbuf(size_t n);
+void *rmalloc(size_t *size); /* don't ever use this */
void rset(void *buf, size_t n);
void *mkrbuf(size_t n);
char *mkrstr(size_t n);
+size_t rsize(size_t n);
/* Helper functions for command: dump
*/
@@ -469,11 +479,8 @@ int io_args(int fd, void *mem, size_t nrw,
off_t off, int rw_type);
int check_file(int fd, struct stat *st);
ssize_t rw_over_nrw(ssize_t r, size_t nrw);
-#if !defined(REAL_POS_IO) || \
- REAL_POS_IO < 1
off_t lseek_on_eintr(int fd, off_t off,
int whence, int loop_eagain, int loop_eintr);
-#endif
int try_err(int loop_err, int errval);
/* Error handling and cleanup