Skip to content

This project is part of my talk about Project Panama. The goal is to show how you can call (almost) any C library using Java

Notifications You must be signed in to change notification settings

davidtos/LIO_old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LIO (Linux IO)

This repository is part of my talk about Project Panama. I aim to show how you can call C libraries from inside your Java code.

What is inside this repository

The library contains a working example of FUSE and IO_URING with liburing.

  • FUSE code see this
    • To unmount use the following command fusermount3 -u $FILE_PATH
  • IO_URING READ code see this
    • The read example uses polling to reduce the number of system calls.
    • To see that the polling is working you can use sudo bpftrace -e 'tracepoint:io_uring:io_uring_submit_req* {printf("%s(%d)\n", comm, pid);}' this shows you what called submit.
  • IO_URING WRITE code see this
    • The write example does not use polling but makes a system call.

Wrapper code

The code that calls the C code is generated using Jextract. Jextract creates Java code based on the header files.

To generate FUSE: jextract -D_FILE_OFFSET_BITS=64 -D FUSE_USE_VERSION=35 --source -d generated/src -t org.libfuse -I /Documents/libfuse-fuse-3.10.5/include/ /Documents/libfuse-fuse-3.10.5/include/fuse.h

To generate Liburing: jextract -D IOURINGINLINE=extern -l uring -t io.uring -I include --output ./generated --header-class-name liburingtest include/liburing.h

Side note

This sample code is not production ready, it's just a proof of concept that happens to work.

About

This project is part of my talk about Project Panama. The goal is to show how you can call (almost) any C library using Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages