mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibC: Implement pselect
pselect() is similar() to select(), but it takes its timeout as timespec instead of as timeval, and it takes an additional sigmask parameter. Change the sys$select parameters to match pselect() and implement select() in terms of pselect().
This commit is contained in:
parent
29f509a2a0
commit
d23e655c83
Notes:
sideshowbarker
2024-07-19 05:27:20 +09:00
Author: https://github.com/nico
Commit: d23e655c83
Pull-request: https://github.com/SerenityOS/serenity/pull/2609
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
6 changed files with 46 additions and 19 deletions
|
@ -219,12 +219,12 @@ public:
|
|||
class SelectBlocker final : public Blocker {
|
||||
public:
|
||||
typedef Vector<int, FD_SETSIZE> FDVector;
|
||||
SelectBlocker(const timeval& tv, bool select_has_timeout, const FDVector& read_fds, const FDVector& write_fds, const FDVector& except_fds);
|
||||
SelectBlocker(const timespec& ts, bool select_has_timeout, const FDVector& read_fds, const FDVector& write_fds, const FDVector& except_fds);
|
||||
virtual bool should_unblock(Thread&, time_t, long) override;
|
||||
virtual const char* state_string() const override { return "Selecting"; }
|
||||
|
||||
private:
|
||||
timeval m_select_timeout;
|
||||
timespec m_select_timeout;
|
||||
bool m_select_has_timeout { false };
|
||||
const FDVector& m_select_read_fds;
|
||||
const FDVector& m_select_write_fds;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue