Index: boost/interprocess/detail/os_file_functions.hpp =================================================================== --- boost/interprocess/detail/os_file_functions.hpp (revision 52581) +++ boost/interprocess/detail/os_file_functions.hpp (working copy) @@ -311,12 +311,13 @@ inline const char *get_temporary_path() { + struct stat data; const char *dir = std::getenv("TMPDIR"); - if(!dir){ + if(!dir || ::stat(dir, &data) != 0){ dir = std::getenv("TMP"); - if(!dir){ + if(!dir || ::stat(dir, &data) != 0){ dir = std::getenv("TEMP"); - if(!dir){ + if(!dir || ::stat(dir, &data) != 0){ dir = "/tmp"; } }