1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 05:01:48 +02:00

Put some file descriptor functions in unix and windows namespaces

It is misleading when platform-specific functions are in the overall
`nix` namespace. More namespaces also makes for nicer doxygen.
This commit is contained in:
John Ericson 2024-06-13 10:34:44 -04:00
parent afdd12be5e
commit ff87c1a318
7 changed files with 19 additions and 15 deletions

View file

@ -140,6 +140,7 @@ public:
};
#ifndef _WIN32 // Not needed on Windows, where we don't fork
namespace unix {
/**
* Close all file descriptors except those listed in the given set.
@ -152,13 +153,16 @@ void closeMostFDs(const std::set<Descriptor> & exceptions);
*/
void closeOnExec(Descriptor fd);
} // namespace unix
#endif
#ifdef _WIN32
# if _WIN32_WINNT >= 0x0600
#if defined(_WIN32) && _WIN32_WINNT >= 0x0600
namespace windows (
Path handleToPath(Descriptor handle);
std::wstring handleToFileName(Descriptor handle);
# endif
} // namespace windows
#endif
MakeError(EndOfFile, Error);