Joins a known virtual machine (VM) to get its termination status.
#include <nks/vm.h> int NXVmJoin ( NXVmId_t wait_for, NXVmId_t *departed_vm, int *status);
(IN) Specifies the ID of the virtual machine to join. If you want to join the next VM spawned by the terminating VM that is calling NXVmJoin, pass NX_VM_JOIN_ANY.
(OUT) Points to the ID of the VM that was actually joined.
(OUT) Points to the location that holds the returned status of the terminated VM. The meaning of the status is application defined.
If successful, returns zero; otherwise, returns an error:
NXVmJoin joins another VM with a similar effect as two threads joining each other (see NXThreadJoin).
NXVmJoin returns the exit code of the specified VM if it has already terminated. Otherwise, the call blocks waiting for that VM to exit.
Virtual machines are created joinable by default. Once a VM terminates, data structures identified with it persist until it is ultimately joined because it is possible to join a VM long after it terminates.There is no discovery mechanism in NKS that will yield a value for wait_for. It must be obtained from NXVmSpawn. Only VMs that have been spawned by the caller can be joined.