ffmpeg-6: fix COMPONENT_REVISION
[oi-userland.git] / components / runtime / openjdk-23 / patches / illumos-port-02.patch
blob7e3980a8f5c74f49a55782903b689b86d56d8cc3
1 --- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c Thu May 28 11:43:30 2020
2 +++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c Wed May 20 19:29:11 2020
3 @@ -468,7 +468,41 @@
4 return (jint)res;
7 +JNIEXPORT jlong JNICALL
8 +Java_sun_nio_fs_UnixNativeDispatcher_fopen0(JNIEnv* env, jclass this,
9 + jlong pathAddress, jlong modeAddress)
11 + FILE* fp = NULL;
12 + const char* path = (const char*)jlong_to_ptr(pathAddress);
13 + const char* mode = (const char*)jlong_to_ptr(modeAddress);
15 + do {
16 + fp = fopen(path, mode);
17 + } while (fp == NULL && errno == EINTR);
19 + if (fp == NULL) {
20 + throwUnixException(env, errno);
21 + }
23 + return ptr_to_jlong(fp);
26 JNIEXPORT void JNICALL
27 +Java_sun_nio_fs_UnixNativeDispatcher_fclose(JNIEnv* env, jclass this, jlong stream)
29 + FILE* fp = jlong_to_ptr(stream);
31 + /* NOTE: fclose() wrapper is only used with read-only streams.
32 + * If it ever is used with write streams, it might be better to add
33 + * RESTARTABLE(fflush(fp)) before closing, to make sure the stream
34 + * is completely written even if fclose() failed.
35 + */
36 + if (fclose(fp) == EOF && errno != EINTR) {
37 + throwUnixException(env, errno);
38 + }
41 +JNIEXPORT void JNICALL
42 Java_sun_nio_fs_UnixNativeDispatcher_rewind(JNIEnv* env, jclass this, jlong stream)
44 FILE* fp = jlong_to_ptr(stream);
45 @@ -1222,6 +1256,33 @@
49 +JNIEXPORT jlong JNICALL
50 +Java_sun_nio_fs_UnixNativeDispatcher_pathconf0(JNIEnv* env, jclass this,
51 + jlong pathAddress, jint name)
53 + long err;
54 + const char* path = (const char*)jlong_to_ptr(pathAddress);
56 + err = pathconf(path, (int)name);
57 + if (err == -1) {
58 + throwUnixException(env, errno);
59 + }
60 + return (jlong)err;
63 +JNIEXPORT jlong JNICALL
64 +Java_sun_nio_fs_UnixNativeDispatcher_fpathconf(JNIEnv* env, jclass this,
65 + jint fd, jint name)
67 + long err;
69 + err = fpathconf((int)fd, (int)name);
70 + if (err == -1) {
71 + throwUnixException(env, errno);
72 + }
73 + return (jlong)err;
76 JNIEXPORT void JNICALL
77 Java_sun_nio_fs_UnixNativeDispatcher_mknod0(JNIEnv* env, jclass this,
78 jlong pathAddress, jint mode, jlong dev)