fn ensure_dir_and_openat(
dirfd: impl AsFd,
filename: &str,
flags: OFlags,
) -> Result<OwnedFd>Expand description
Call openat() on the named subdirectory of “dirfd”, possibly creating it first.
We assume that the directory will probably exist (ie: we try the open first), and on ENOENT, we mkdirat() and retry.