Hello I hope this is the right mailing list. I recently had a look at the Linux attach provider implementation and could not help but noticing that a large part, if not all of it, could be replaced with Java. Besides getting rid of the C code this should allow us to unify the AIX, Linux and macOS implementations under a single Unix implementation.
The permission check can be implemented using JSR 203 [1] to access uid, gid and file mode and using jdk.internal.misc.VM to get the euid and egid. Reading and writing to Unix domain sockets can be done through JEP 380 [2]. Sending SIGQUIT to a process could in theory done through JEP 102 [3] however sending SIGQUIT to self is currently blocked. This is required for the self attach mechanism. There a very small C function is still needed for now, this is hopefully portable. I did a small prototype [4]. The tier1 suite runs and I can attach to a local JVM. The overhead will likely be a bit higher as we go through more JDK abstractions. [1] https://jcp.org/en/jsr/detail?id=203 [2] https://openjdk.java.net/jeps/380 [3] https://openjdk.java.net/jeps/102 [4] https://github.com/marschall/jdk/commit/207dac7e4d1bd65450bbd2c9e14d33fc34b7cebc Cheers Philippe