mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-01-08 10:27:49 +08:00
Bug 5514725: Modify the socket folder for systems that have GCC < 8 by default such as SLES
This commit is contained in:
parent
320c7e6392
commit
0fae54dcd6
@ -52,12 +52,22 @@
|
||||
#include <memory.h>
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
#include <filesystem>
|
||||
#include <vector>
|
||||
|
||||
inline std::string getSocketFolder() {
|
||||
return std::filesystem::temp_directory_path().string();
|
||||
}
|
||||
// Simple filesystem compatibility for GCC 7.x
|
||||
#if defined(__GNUC__) && __GNUC__ < 8
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
inline std::string getSocketFolder() {
|
||||
const char* tmpdir = std::getenv("TMPDIR");
|
||||
return tmpdir ? std::string(tmpdir) : "/tmp";
|
||||
}
|
||||
#else
|
||||
#include <filesystem>
|
||||
inline std::string getSocketFolder() {
|
||||
return std::filesystem::temp_directory_path().string();
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef struct sharedMemoryInfo_st {
|
||||
void *addr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user