save_errno();
/* XXX: The findutils tests check for ENOENT if pathname is empty.
* We need to specialcase this, as passing an existing directory
* including trailing slash to mkdirat needs to fail with EEXIST.
*/
if (pathname && pathname[0] == '\0') {
errno = ENOENT;
return false;
}
/* Expand the dirfd path first */
switch (resolve_dirfd_path(dirfd, pathname, dirfd_path, sizeof(dirfd_path))) {
case -1: