net/SocketDescriptor: make eventfd() and signalfd() mandatory on Linux

This commit is contained in:
Max Kellermann 2018-08-20 17:16:07 +02:00
parent 13b3e9e7b3
commit 7ad440ca1c
4 changed files with 9 additions and 29 deletions

View File

@ -18,7 +18,7 @@
*/
#include "config.h"
#ifdef USE_EVENTFD
#ifdef __linux__
#include "EventFD.hxx"
#include "system/Error.hxx"
#include "util/Compiler.h"

View File

@ -37,15 +37,9 @@
#include <poll.h>
#endif
#ifdef USE_EVENTFD
#include <sys/eventfd.h>
#endif
#ifdef USE_SIGNALFD
#include <sys/signalfd.h>
#endif
#ifdef __linux__
#include <sys/eventfd.h>
#include <sys/signalfd.h>
#include <sys/inotify.h>
#endif
@ -222,7 +216,7 @@ FileDescriptor::CheckDuplicate(int new_fd) noexcept
#endif
#ifdef USE_EVENTFD
#ifdef __linux__
bool
FileDescriptor::CreateEventFD(unsigned initval) noexcept
@ -231,10 +225,6 @@ FileDescriptor::CreateEventFD(unsigned initval) noexcept
return fd >= 0;
}
#endif
#ifdef USE_SIGNALFD
bool
FileDescriptor::CreateSignalFD(const sigset_t *mask) noexcept
{
@ -246,10 +236,6 @@ FileDescriptor::CreateSignalFD(const sigset_t *mask) noexcept
return true;
}
#endif
#ifdef __linux__
bool
FileDescriptor::CreateInotify() noexcept
{

View File

@ -39,7 +39,7 @@
#include <unistd.h>
#include <sys/types.h>
#ifdef USE_SIGNALFD
#ifdef __linux__
#include <signal.h>
#endif
@ -181,15 +181,9 @@ public:
bool CheckDuplicate(int new_fd) noexcept;
#endif
#ifdef USE_EVENTFD
bool CreateEventFD(unsigned initval=0) noexcept;
#endif
#ifdef USE_SIGNALFD
bool CreateSignalFD(const sigset_t *mask) noexcept;
#endif
#ifdef __linux__
bool CreateEventFD(unsigned initval=0) noexcept;
bool CreateSignalFD(const sigset_t *mask) noexcept;
bool CreateInotify() noexcept;
#endif

View File

@ -18,7 +18,7 @@
*/
#include "config.h"
#ifdef USE_SIGNALFD
#ifdef __linux__
#include "SignalFD.hxx"
#include "Error.hxx"
@ -43,4 +43,4 @@ SignalFD::Read() noexcept
: -1;
}
#endif /* USE_SIGNALFD */
#endif /* __linux__ */