Added sharedPage::exists() call

This commit is contained in:
Thulinma 2018-02-09 13:44:53 +01:00
parent 12d18bd7c5
commit bea8678df9
2 changed files with 14 additions and 0 deletions

View file

@ -348,6 +348,18 @@ namespace IPC {
close();
}
/// Returns true if the open file still exists.
/// Not implemented under Windows.
bool sharedPage::exists(){
#ifdef SHM_ENABLED
struct stat sb;
if (fstat(handle, &sb)){return false;}
return (sb.st_nlink > 0);
#else
return true;
#endif
}
#ifdef SHM_ENABLED
///\brief Unmaps a shared page if allowed
void sharedPage::unmap() {