changeset 60819:fcbb67d1ebeb

8242356: (se) epoll Selector should use epoll_create1 instead of epoll_create Reviewed-by: alanb, stuefe Contributed-by: david.lloyd@redhat.com
author alanb
date Wed, 08 Apr 2020 10:31:58 +0100
parents e466454d7cfc
children 55db80785046
files src/java.base/linux/native/libnio/ch/EPoll.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/linux/native/libnio/ch/EPoll.c	Wed Apr 08 11:26:49 2020 +0200
+++ b/src/java.base/linux/native/libnio/ch/EPoll.c	Wed Apr 08 10:31:58 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,10 +57,9 @@
 
 JNIEXPORT jint JNICALL
 Java_sun_nio_ch_EPoll_create(JNIEnv *env, jclass clazz) {
-    /* size hint not used in modern kernels */
-    int epfd = epoll_create(256);
+    int epfd = epoll_create1(EPOLL_CLOEXEC);
     if (epfd < 0) {
-        JNU_ThrowIOExceptionWithLastError(env, "epoll_create failed");
+        JNU_ThrowIOExceptionWithLastError(env, "epoll_create1 failed");
     }
     return epfd;
 }