Subversion Repositories public

Compare Revisions

Ignore whitespace Rev 38 → Rev 39

/inotify-cxx/trunk/inotify-cxx.cpp
546,6 → 546,36
IN_WRITE_END
}
 
void Inotify::SetCloseOnExec(bool fClOnEx) throw (InotifyException)
{
IN_WRITE_BEGIN
if (m_fd == -1) {
IN_WRITE_END_NOTHROW
throw InotifyException(IN_EXC_MSG("invalid file descriptor"), EBUSY, this);
}
int res = fcntl(m_fd, F_GETFD);
if (res == -1) {
IN_WRITE_END_NOTHROW
throw InotifyException(IN_EXC_MSG("cannot get inotify flags"), errno, this);
}
if (fClOnEx) {
res |= FD_CLOEXEC;
}
else {
res &= ~FD_CLOEXEC;
}
if (fcntl(m_fd, F_SETFD, res) == -1) {
IN_WRITE_END_NOTHROW
throw InotifyException(IN_EXC_MSG("cannot set inotify flags"), errno, this);
}
IN_WRITE_END
}
 
uint32_t Inotify::GetCapability(InotifyCapability_t cap) throw (InotifyException)
{
FILE* f = fopen(GetCapabilityPath(cap).c_str(), "r");
/inotify-cxx/trunk/CHANGELOG
1,3 → 1,7
0.7.0 2007-01-13
* added Inotify::SetCloseOnExec() for simple setting this feature
 
 
0.6.3 2007-01-06
* incorrect behavior for IN_IGNORED fixed (#0000124)
 
/inotify-cxx/trunk/inotify-cxx.h
743,14 → 743,32
* (acquired thru GetDescriptor()) in functions such as
* poll(), select() etc.
*
* Non-blocking mode is disabled by default.
*
* \param[in] fNonBlock enable/disable non-blocking mode
*
* \throw InotifyException thrown if setting mode failed
*
* \sa GetDescriptor()
* \sa GetDescriptor(), SetCloseOnExec()
*/
void SetNonBlock(bool fNonBlock) throw (InotifyException);
/// Enables/disables closing on exec.
/**
* Enable this if you want to close the descriptor when
* executing another program. Otherwise, the descriptor
* will be inherited.
*
* Closing on exec is disabled by default.
*
* \param[in] fClOnEx enable/disable closing on exec
*
* \throw InotifyException thrown if setting failed
*
* \sa GetDescriptor(), SetNonBlock()
*/
void SetCloseOnExec(bool fClOnEx) throw (InotifyException);
/// Acquires a particular inotify capability/limit.
/**
* \param[in] cap capability/limit identifier