#include #include #include #include #include #include #include #include #include #include #define RESOLVE_CACHED 0x20 static int io_openat2(const char *path, int dfd) { struct open_how how; int ret; memset(&how, 0, sizeof(how)); how.flags = O_RDONLY; how.resolve = RESOLVE_CACHED; ret = syscall(437, dfd, path, &how, sizeof(how)); if (ret == -1) return -errno; return ret; } int main(int argc, char *argv[]) { mkdir("/proc2", 0644); mount("none", "/proc2", "proc", 0, NULL); io_openat2("/proc2/self/comm", -1); umount("/proc2"); return 0; }