You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[core] add path_util.h, make hugetlb_path.h use it
This carves out the internal utility functions `walk_path_suffix`
and `path_append` from `monad_hugetlbfs_open_dir_fd` so that they
can be re-used elsewhere in the project.
They are now called `monad_path_open_subdir` (enhanced form of the
old `walk_path_suffix`) and `monad_path_append` (old `path_append`).
`monad_hugetlbfs_open_dir_fd` is also rewritten to use these, and
`monad_path_open_subdir` gets a unit test. `monad_path_append` is
more robust and more useful than it was before.
`monad_path_open_subdir` is used when you want to open a path to
a subdirectory underneath some known existing directory hierarchy,
but you do not know if the intermediate path components exist or
not. You may want to do `mkdir -p` programatically to create them,
or even if not, you'll want a better error message than open(2)
would give you (just a mysterious ENOENT with no hint about what
is wrong).
"Known" existing directory is used losely here, since init_dirfd
can be the special value AT_FDCWD to use the current working
directory, and if `path_suffix` is absolute (contains a leading '/'),
it will relative to root in any case -- both of which are the defined
POSIX behavior of openat(2).
`monad_path_open_subdir` is reused outside of the hugetblfs path
calculation in a later event SDK commit.
0 commit comments