summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.h
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-17 22:14:48 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-17 22:21:16 +0000
commit6fe909f9f770dd9459c1673eda01247ad08e7a5e (patch)
tree6ceb9b9b582f40ed2d911a7ca6e73765ce907926 /util/nvmutil/nvmutil.h
parent9573d872f3ad3664e182110c7415f3633e07595c (diff)
util/nvmutil: tighter pledge and unveil
call it sooner. set new_state afterward. i had to uncouple nv from some functions for this, and i also added some extra checks especially at exit, about whether to touch nv (whether it is initialised) Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.h')
-rw-r--r--util/nvmutil/nvmutil.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.h b/util/nvmutil/nvmutil.h
index 831c161a..c278481e 100644
--- a/util/nvmutil/nvmutil.h
+++ b/util/nvmutil/nvmutil.h
@@ -66,6 +66,10 @@
#define EXIT_SUCCESS 0
#endif
+#ifndef O_ACCMODE
+#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
+#endif
+
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -311,7 +315,7 @@ int xstrxcmp(const char *a, const char *b, unsigned long maxlen);
* Prep files for reading
*/
void open_gbe_file(void);
-int lock_file(int fd);
+int lock_file(int fd, int flags);
void xopen(int *fd, const char *path, int flags, struct stat *st);
/*