How to get the parent process id, ppid?

I am trying to find out whether my julia is called from python, from R or plainly julia.

Research brought me to using the ppid on Unix based systems, however I couldn’t find how to get it using julia.

Try this:

getppid() = @ccall getppid()::Cint

Test:

julia> getppid()
1366207
2 Likes

Could perhaps be worth a PR given that we have

julia> Libc.getpid()
1371361
1 Like