equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
25 |
25 |
26 #include <jni.h> |
26 #include <jni.h> |
27 #include <string.h> |
27 #include <string.h> |
28 |
28 |
29 #include "net_util.h" |
29 #include "net_util.h" |
|
30 #include "java_net_SocketCleanable.h" |
30 |
31 |
31 JNIEXPORT jboolean JNICALL |
32 JNIEXPORT jboolean JNICALL |
32 Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0(JNIEnv* env, jclass c1) |
33 Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0(JNIEnv* env, jclass c1) |
33 { |
34 { |
34 return (reuseport_available()) ? JNI_TRUE : JNI_FALSE; |
35 return (reuseport_available()) ? JNI_TRUE : JNI_FALSE; |
43 JNIEXPORT jboolean JNICALL |
44 JNIEXPORT jboolean JNICALL |
44 Java_jdk_net_Sockets_isReusePortAvailable0(JNIEnv* env, jclass c1) |
45 Java_jdk_net_Sockets_isReusePortAvailable0(JNIEnv* env, jclass c1) |
45 { |
46 { |
46 return (reuseport_available()) ? JNI_TRUE : JNI_FALSE; |
47 return (reuseport_available()) ? JNI_TRUE : JNI_FALSE; |
47 } |
48 } |
|
49 |
|
50 /* |
|
51 * Class: java_net_SocketCleanable |
|
52 * Method: cleanupClose0 |
|
53 * Signature: (I)V |
|
54 */ |
|
55 JNIEXPORT void JNICALL |
|
56 Java_java_net_SocketCleanable_cleanupClose0(JNIEnv *env, jclass c1, jint fd) |
|
57 { |
|
58 NET_SocketClose(fd); |
|
59 } |
|
60 |