mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 17:00:19 +02:00
19 lines
374 B
C++
19 lines
374 B
C++
// SPDX-License-Identifier: MIT
|
|
#pragma once
|
|
|
|
#include <FEXCore/fextl/fmt.h>
|
|
|
|
#include <fcntl.h>
|
|
#include <linux/limits.h>
|
|
#include <unistd.h>
|
|
|
|
namespace FEX {
|
|
|
|
[[nodiscard]]
|
|
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);
|
|
}
|
|
|
|
} // namespace FEX
|