Commit 33bd9e80 authored by Max Kellermann's avatar Max Kellermann

system/FileDescriptor: add method IsReadyForWriting()

parent d310f3e9
......@@ -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
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment