Example:
version (linux) {
import core.sys.linux.unistd : getpid;
bool sandboxed = isProcessSandboxed(getpid());
writeln("Sandboxed: ", sandboxed);
}bool isProcessSandboxed(int pid) @trustedChecks if a process is running in a sandbox environment.
This function detects various sandboxing mechanisms across platforms:
pid | The process ID to check. |
Example:
version (linux) {
import core.sys.linux.unistd : getpid;
bool sandboxed = isProcessSandboxed(getpid());
writeln("Sandboxed: ", sandboxed);
}