neko2.1:How to get PID of the current process? are there any api about that ?
It’s currently not possible with the existing API. You might be able to figure it out using Sys.command but that would involve platform specific code.
I try to use python to get this function.
/**
Show current pid
Tectonics:
nekoc getpid.neko
neko getpid
*/
var sys_get_pid = $loader.loadprim("std@sys_get_pid", 0);
$print(sys_get_pid());
I’m pretty sure this was added in NekoVM 1.4.5, according to the CHANGES file, way back in aught 6; before my time.
API - System - NekoVM last item.
To put a more positive spin on this thread outcome. Neko has many (almost) secret powers (until you bump into the right hint).
Have good, make well