Skip to content
Permalink
Browse files
8242356: (se) epoll Selector should use epoll_create1 instead of epol…
…l_create

Reviewed-by: alanb, stuefe
  • Loading branch information
dmlloyd authored and Alan Bateman committed Apr 8, 2020
1 parent 343f760 commit 59684e10d11bfc7c9c89abd97900142a240ed22d
Showing 1 changed file with 3 additions and 4 deletions.
@@ -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 @@ Java_sun_nio_ch_EPoll_dataOffset(JNIEnv* env, jclass clazz)

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;
}

0 comments on commit 59684e1

Please sign in to comment.