AimRT/_deps/boost-src/libs/filesystem/config/has_fdopendir_nofollow.cpp
2025-01-12 20:40:08 +08:00

21 lines
456 B
C++

// Copyright 2022 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// See library home page at http://www.boost.org/libs/filesystem
#include "platform_config.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <fcntl.h>
int main()
{
int fd = open(".", O_DIRECTORY | O_RDONLY | O_NOFOLLOW);
DIR* dir = fdopendir(fd);
return dir != 0;
}