-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventNotifier.cpp
More file actions
26 lines (20 loc) · 840 Bytes
/
EventNotifier.cpp
File metadata and controls
26 lines (20 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*******************************************************************************
* libunix++: C++ wrapper for Linux system calls
* Event notifier operations
*
* © 2019—2023, Sauron <libunixpp@saur0n.science>
******************************************************************************/
#include "EventNotifier.hpp"
#include "exception.hppi"
using namespace upp;
/******************************************************************************/
EventNotifier::EventNotifier(unsigned int initval, int flags) :
Stream(eventfd(initval, flags)) {}
eventfd_t EventNotifier::readCounter() {
eventfd_t result;
THROW_SYSTEM_ERROR_STD(eventfd_read(getDescriptor(), &result));
return result;
}
void EventNotifier::writeCounter(eventfd_t off) {
THROW_SYSTEM_ERROR_STD(eventfd_write(getDescriptor(), off));
}