MCPcopy Create free account
hub / github.com/apple/foundationdb / monitor_fd

Function monitor_fd

fdbmonitor/fdbmonitor.cpp:94–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92#define CANONICAL_PATH_SEPARATOR '/'
93
94void monitor_fd(fdb_fd_set list, int fd, int* maxfd, void* cmd) {
95#ifdef __linux__
96 FD_SET(fd, list);
97 if (fd > *maxfd)
98 *maxfd = fd;
99#elif defined(__APPLE__) || defined(__FreeBSD__)
100 /* ignore maxfd */
101 struct kevent ev;
102 EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, cmd);
103 kevent(list, &ev, 1, nullptr, 0, nullptr); // FIXME: check?
104#endif
105}
106
107void unmonitor_fd(fdb_fd_set list, int fd) {
108#ifdef __linux__

Callers 1

CommandMethod · 0.85

Calls 1

keventClass · 0.85

Tested by

no test coverage detected