forked from LWJGL/lwjgl3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(liburing): add liburing bindings
This is a work-in-progress, even though the liburing/io_uring bindings are complete. A lot more Linux APIs will be added in the future in order for io_uring to be fully usable.
- Loading branch information
Showing
76 changed files
with
23,348 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2020 Jens Axboe | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
64 changes: 64 additions & 0 deletions
64
modules/lwjgl/core/src/generated/c/linux/org_lwjgl_system_linux_FCNTL.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
#include "common_tools.h" | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
|
||
EXTERN_C_ENTER | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_FCNTL_nopen(JNIEnv *__env, jclass clazz, jlong pathnameAddress, jint flags, jint mode) { | ||
char const *pathname = (char const *)(intptr_t)pathnameAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)open(pathname, flags, (mode_t)mode); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_FCNTL_nopenat(JNIEnv *__env, jclass clazz, jint dirfd, jlong pathnameAddress, jint flags, jint mode) { | ||
char const *pathname = (char const *)(intptr_t)pathnameAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)openat(dirfd, pathname, flags, (mode_t)mode); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_FCNTL_ncreat(JNIEnv *__env, jclass clazz, jlong pathnameAddress, jint mode) { | ||
char const *pathname = (char const *)(intptr_t)pathnameAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)creat(pathname, (mode_t)mode); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_FCNTL_fcntl(JNIEnv *__env, jclass clazz, jint fd, jint cmd) { | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)fcntl(fd, cmd); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_FCNTL_nfcntli(JNIEnv *__env, jclass clazz, jint fd, jint cmd, jint arg) { | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)fcntl(fd, cmd, arg); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_FCNTL_nfcntlp(JNIEnv *__env, jclass clazz, jint fd, jint cmd, jlong argAddress) { | ||
void *arg = (void *)(intptr_t)argAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)fcntl(fd, cmd, arg); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
EXTERN_C_EXIT |
30 changes: 30 additions & 0 deletions
30
modules/lwjgl/core/src/generated/c/linux/org_lwjgl_system_linux_MMAN.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
#include "common_tools.h" | ||
#include <sys/mman.h> | ||
#include <errno.h> | ||
|
||
EXTERN_C_ENTER | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_MMAN_mmap(JNIEnv *__env, jclass clazz, jlong addrAddress, jlong length, jint prot, jint flags, jint fd, jlong offset) { | ||
void *addr = (void *)(intptr_t)addrAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)(intptr_t)mmap(addr, (size_t)length, prot, flags, fd, (off_t)offset); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_MMAN_nmunmap(JNIEnv *__env, jclass clazz, jlong addrAddress, jlong length) { | ||
void *addr = (void *)(intptr_t)addrAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)munmap(addr, (size_t)length); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
EXTERN_C_EXIT |
20 changes: 20 additions & 0 deletions
20
modules/lwjgl/core/src/generated/c/linux/org_lwjgl_system_linux_Socket.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
#include "common_tools.h" | ||
#include <sys/socket.h> | ||
#include <errno.h> | ||
|
||
EXTERN_C_ENTER | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_Socket_socket(JNIEnv *__env, jclass clazz, jint __domain, jint __type, jint __protocol) { | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)socket(__domain, __type, __protocol); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
EXTERN_C_EXIT |
31 changes: 31 additions & 0 deletions
31
modules/lwjgl/core/src/generated/c/linux/org_lwjgl_system_linux_Stat.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
#include "common_tools.h" | ||
#include <sys/stat.h> | ||
#include <errno.h> | ||
|
||
EXTERN_C_ENTER | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_Stat_nstat(JNIEnv *__env, jclass clazz, jlong __fileAddress, jlong __bufAddress) { | ||
char const *__file = (char const *)(intptr_t)__fileAddress; | ||
struct stat *__buf = (struct stat *)(intptr_t)__bufAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)stat(__file, __buf); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_Stat_nfstat(JNIEnv *__env, jclass clazz, jint __fd, jlong __bufAddress) { | ||
struct stat *__buf = (struct stat *)(intptr_t)__bufAddress; | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)fstat(__fd, __buf); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
EXTERN_C_EXIT |
86 changes: 86 additions & 0 deletions
86
modules/lwjgl/core/src/generated/c/linux/org_lwjgl_system_linux_UIO.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
#include "common_tools.h" | ||
#include <sys/uio.h> | ||
#include <errno.h> | ||
|
||
EXTERN_C_ENTER | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_nreadv(JNIEnv *__env, jclass clazz, jint __fd, jlong __iovecAddress, jint __count) { | ||
struct iovec const *__iovec = (struct iovec const *)(intptr_t)__iovecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)readv(__fd, __iovec, __count); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_nwritev(JNIEnv *__env, jclass clazz, jint __fd, jlong __iovecAddress, jint __count) { | ||
struct iovec const *__iovec = (struct iovec const *)(intptr_t)__iovecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)writev(__fd, __iovec, __count); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_npreadv(JNIEnv *__env, jclass clazz, jint __fd, jlong __iovecAddress, jint __count, jlong __offset) { | ||
struct iovec const *__iovec = (struct iovec const *)(intptr_t)__iovecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)preadv(__fd, __iovec, __count, (off_t)__offset); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_npwritev(JNIEnv *__env, jclass clazz, jint __fd, jlong __iovecAddress, jint __count, jlong __offset) { | ||
struct iovec const *__iovec = (struct iovec const *)(intptr_t)__iovecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)pwritev(__fd, __iovec, __count, (off_t)__offset); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_npreadv2(JNIEnv *__env, jclass clazz, jint __fd, jlong __iovecAddress, jint __count, jlong __offset, jint __flags) { | ||
struct iovec const *__iovec = (struct iovec const *)(intptr_t)__iovecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)preadv2(__fd, __iovec, __count, (off_t)__offset, __flags); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_npwritev2(JNIEnv *__env, jclass clazz, jint __fd, jlong __iovecAddress, jint __count, jlong __offset, jint __flags) { | ||
struct iovec const *__iovec = (struct iovec const *)(intptr_t)__iovecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)pwritev2(__fd, __iovec, __count, (off_t)__offset, __flags); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_nprocess_1vm_1readv(JNIEnv *__env, jclass clazz, jint __pid, jlong __lvecAddress, jlong __liovcnt, jlong __rvecAddress, jlong __riovcnt, jlong __flags) { | ||
struct iovec const *__lvec = (struct iovec const *)(intptr_t)__lvecAddress; | ||
struct iovec const *__rvec = (struct iovec const *)(intptr_t)__rvecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)process_vm_readv((pid_t)__pid, __lvec, (unsigned long int)__liovcnt, __rvec, (unsigned long int)__riovcnt, (unsigned long int)__flags); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UIO_nprocess_1vm_1writev(JNIEnv *__env, jclass clazz, jint __pid, jlong __lvecAddress, jlong __liovcnt, jlong __rvecAddress, jlong __riovcnt, jlong __flags) { | ||
struct iovec const *__lvec = (struct iovec const *)(intptr_t)__lvecAddress; | ||
struct iovec const *__rvec = (struct iovec const *)(intptr_t)__rvecAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)process_vm_writev((pid_t)__pid, __lvec, (unsigned long int)__liovcnt, __rvec, (unsigned long int)__riovcnt, (unsigned long int)__flags); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
EXTERN_C_EXIT |
37 changes: 37 additions & 0 deletions
37
modules/lwjgl/core/src/generated/c/linux/org_lwjgl_system_linux_UNISTD.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright LWJGL. All rights reserved. | ||
* License terms: https://www.lwjgl.org/license | ||
* MACHINE GENERATED FILE, DO NOT EDIT | ||
*/ | ||
#include "common_tools.h" | ||
#include <unistd.h> | ||
#include <errno.h> | ||
|
||
EXTERN_C_ENTER | ||
|
||
JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_UNISTD_close(JNIEnv *__env, jclass clazz, jint fd) { | ||
jint __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jint)close(fd); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UNISTD_sysconf(JNIEnv *__env, jclass clazz, jint name) { | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)sysconf(name); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_UNISTD_nread(JNIEnv *__env, jclass clazz, jint fd, jlong bufAddress, jlong count) { | ||
void *buf = (void *)(intptr_t)bufAddress; | ||
jlong __result; | ||
UNUSED_PARAMS(__env, clazz) | ||
__result = (jlong)read(fd, buf, (size_t)count); | ||
saveErrno(); | ||
return __result; | ||
} | ||
|
||
EXTERN_C_EXIT |
Oops, something went wrong.