NXVmGetId

Returns the identity of the caller’s virtual machine.

Library:LibC
Classification:NKS
Service:NKS Virtual Machine

Syntax

  #include <nks/vm.h>
   
  NXVmId_t NXVmGetId (void);
  

Return Values

If successful, returns a nonzero numeric value, which is not of a guaranteed range.

If zero is returned, no NKS context is present.

Remarks

The returned value may be communicated to applications running in other virtual machines. If this value is communicated to another NKS virtual machine, it is illegal to use it to call NXVmDestroy or NXVmJoin.

The identity of a virtual machine spawned by the caller is also known. The only two direct uses of this value are joining and terminating (destroying). However, the value may be used in creating a discrete, temporary name—for example, for a FIFO.

See Also