From c87e425442f17a70651e05d1deab2a9e50f7625e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 23 Mar 2026 00:27:05 +0000 Subject: WIP dir support (also demons) Signed-off-by: Leah Rowe --- util/nvmutil/include/common.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'util/nvmutil/include') diff --git a/util/nvmutil/include/common.h b/util/nvmutil/include/common.h index 0fedeedd..67969832 100644 --- a/util/nvmutil/include/common.h +++ b/util/nvmutil/include/common.h @@ -36,6 +36,13 @@ int fchmod(int fd, mode_t mode); +#define MKHTEMP_RETRY_MAX 512 +#define MKHTEMP_SPIN_THRESHOLD 32 + +#define MKHTEMP_FILE 0 +#define MKHTEMP_DIR 1 + + /* if 1: on operations that * check ownership, always * permit root to access even @@ -493,10 +500,11 @@ static int mkhtemp_try_create(int dirfd, char *p, size_t xc, int *fd, - struct stat *st); + struct stat *st, + int type); int mkhtemp(int *fd, struct stat *st, char *template, int dirfd, const char *fname, - struct stat *st_dir_initial); + struct stat *st_dir_initial, int type); int mkhtemp_fill_random(char *p, size_t xc); int world_writeable_and_sticky(const char *s, int sticky_allowed, int always_sticky); @@ -529,6 +537,8 @@ int fs_dirname_basename(const char *path, char **dir, char **base, int allow_relative); int openat2p(int dirfd, const char *path, int flags, mode_t mode); +int mkdirat_on_eintr(int dirfd, + const char *pathname, mode_t mode); /* asserts */ -- cgit v1.2.1