mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8242356
: (se) epoll Selector should use epoll_create1 instead of epoll_create
Reviewed-by: alanb, stuefe
This commit is contained in:
parent
343f7603e7
commit
59684e10d1
1 changed files 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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue