diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/Epoll.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/Epoll.java index d413957985..0ec4fd99f5 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/Epoll.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/Epoll.java @@ -16,6 +16,7 @@ package io.netty.channel.epoll; import io.netty.channel.unix.FileDescriptor; +import io.netty.util.internal.PlatformDependent; /** * Tells if {@code netty-transport-native-epoll} is supported. @@ -53,7 +54,8 @@ public final class Epoll { if (cause != null) { UNAVAILABILITY_CAUSE = cause; } else { - UNAVAILABILITY_CAUSE = null; + UNAVAILABILITY_CAUSE = PlatformDependent.hasUnsafe() ? null : + new IllegalStateException("sun.misc.Unsafe not available"); } }