News for hackers. Stuff that matters.
Re:How to Use the Foreign Function API in Java 22 to Call C ... by chii on Wednesday May 08, 2024 @08:40PM (#40304140)
> extracting it to a tmp file

i wonder if there's a way to do this entirely in memory? Because some deployment scenarios might not have disk space at all.

Re:How to Use the Foreign Function API in Java 22 to Call C ... by MobiusHorizons on Wednesday May 08, 2024 @08:52PM (#40304199)
/tmp is often a RAM disk in such cases
Re:How to Use the Foreign Function API in Java 22 to Call C ... by xxs on Thursday May 09, 2024 @01:34AM (#40305566)
not with java - it needs a path. Of course if you have a ram disk (e.g. /tmp) it'd do the job.
Re:How to Use the Foreign Function API in Java 22 to Call C ... by rwmj on Thursday May 09, 2024 @07:45AM (#40307193)
Technically memfd_create will let you create a file descriptor backed by a memory region. However in Linux I don't believe there's a way to dlopen that. (Maybe dlopen /dev/fd/... might work?) In FreeBSD there's a fdlopen library function.

Edit: glibc proposal which was never accepted: https://sourceware.org/bugzilla/show_bug.cgi?id=11767