assert(length < sizeof workdir);
memcpy(workdir, name, 1 + length);
workdirfd = fd;
assert(length < sizeof workdir);
memcpy(workdir, name, 1 + length);
workdirfd = fd;
/* opens the directory */
dirfd = openat(AT_FDCWD, name, O_PATH|O_DIRECTORY|O_RDONLY);
if (dirfd < 0) {
/* opens the directory */
dirfd = openat(AT_FDCWD, name, O_PATH|O_DIRECTORY|O_RDONLY);
if (dirfd < 0) {