system/FileDescriptor: add method IsReadyForWriting()
This commit is contained in:
parent
d310f3e9b7
commit
33bd9e80bb
|
@ -222,4 +222,10 @@ FileDescriptor::WaitWritable(int timeout) const noexcept
|
|||
return Poll(POLLOUT, timeout);
|
||||
}
|
||||
|
||||
bool
|
||||
FileDescriptor::IsReadyForWriting() const noexcept
|
||||
{
|
||||
return WaitWritable(0) > 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -180,6 +180,9 @@ public:
|
|||
|
||||
int WaitReadable(int timeout) const noexcept;
|
||||
int WaitWritable(int timeout) const noexcept;
|
||||
|
||||
gcc_pure
|
||||
bool IsReadyForWriting() const noexcept;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue