diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-04 19:59:20 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-05 16:28:05 +0100 |
commit | c4722873502111366ed24689d2ae1b2047831903 (patch) | |
tree | 7163233787a45fd3c80a89389911ba91d9d6c077 /include/sys | |
parent | abb3a37a503110e0818b2d933ff7e80b62f3f3b7 (diff) | |
download | barebox-c4722873502111366ed24689d2ae1b2047831903.tar.gz barebox-c4722873502111366ed24689d2ae1b2047831903.tar.xz |
fs: implement openat and friends
The EFI file system API takes as handle an arbitrary file within the
volume. Directory iteration should happen relative to that file, which
lends itself well to mapping this to openat and friends.
Add support for these to barebox in preparation.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-36-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/stat.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/sys/stat.h b/include/sys/stat.h index 0dd43d1f02..7af49a1d3c 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -5,7 +5,13 @@ #include <linux/types.h> #include <linux/stat.h> +#include <fcntl.h> -int mkdir (const char *pathname, mode_t mode); +int mkdirat(int dirfd, const char *pathname, mode_t mode); + +static inline int mkdir(const char *pathname, mode_t mode) +{ + return mkdirat(AT_FDCWD, pathname, mode); +} #endif /* __STAT_H */ |