mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-04-02 01:31:42 +00:00
24 lines
494 B
C++
24 lines
494 B
C++
// SPDX-License-Identifier: MIT
|
|
#pragma once
|
|
|
|
#include <FEXCore/Utils/Allocator.h>
|
|
#include <FEXCore/Utils/LogManager.h>
|
|
#include <FEXCore/fextl/fmt.h>
|
|
#include <FEXCore/fextl/string.h>
|
|
|
|
#include <fcntl.h>
|
|
#include <filesystem>
|
|
#include <linux/limits.h>
|
|
#include <optional>
|
|
#include <unistd.h>
|
|
|
|
namespace FEX {
|
|
|
|
inline
|
|
int get_fdpath(int fd, char *SymlinkPath) {
|
|
auto Path = fextl::fmt::format("/proc/self/fd/{}", fd);
|
|
return readlinkat(AT_FDCWD, Path.c_str(), SymlinkPath, PATH_MAX);
|
|
}
|
|
|
|
}
|