uschindler commented on issue #11772:
URL: https://github.com/apache/lucene/issues/11772#issuecomment-1246993380

   This is how to call `getpid()` with Java 19 (you need to enable preview APIS 
and also enable access to native code (disabled for secuirty by default):
   
   ```java
   var cLinker = Linker.nativeLinker();
   // Using a MethodHandle
   MethodHandle getpidMH = 
cLinker.downcallHandle(cLinker.defaultLookup().lookup("getpid").get(),
                       FunctionDescriptor.of(JAVA_INT));
   int pid    = (int) getpidMH.invokeExact();
   System.out.printf("MethodHandle calling getpid() (%d)\n", pid);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to