// SPDX-License-Identifier: EUPL-1.2+ // SPDX-FileCopyrightText: 2022 Alyssa Ross #include #include #include #include int openat_path_resolve_in_root(int dirfd, const char *pathname) { struct open_how how = { 0 }; how.flags = O_PATH | O_CLOEXEC; how.resolve = RESOLVE_IN_ROOT | RESOLVE_NO_MAGICLINKS | RESOLVE_NO_XDEV; return syscall(SYS_openat2, dirfd, pathname, &how, sizeof how); }