NXContextGetName

Returns the name of the specified context.

Library:LibC
Classification:NKS
Service:Threads

Syntax

  #include <nks/nksapi.h> 
   
  int NXContextGetName (
     NXContext_t   ctx, 
     char         *name, 
     size_t        len); 
  

Parameters

ctx

(IN) Points to the context handle returned from NXContextAlloc.

name

(OUT) Points to a previously allocated buffer to receive the name of the context. To avoid name truncation, the buffer must have a size of NX_MAX_OBJECT_NAME_LEN+1.

len

(IN) Specifies the length of the receiving buffer.

Return Values

If successful, returns 0; otherwise, returns a nonzero error code:

Decimal

Hex

Constant

Description

1

0x01

NX_ENOENT

The specified context is not valid.

Remarks

NXContextGetName is used to find out the name of a specified context. The resulting string will be 0 in length unless the context has already been named by calling NXContextSetName. Names have no significance to NKS, but if thread contexts have significance to your application, naming a context can be useful in debugging. You are responsible for interpreting the returned string.

NXContextGetName copies a maximum of the number of bytes specified by len-1 and adds NULL termination.

On NetWare, threads that execute the named context use the returned name in the debugger.

If context is invalid, NXContextGetName does nothing. It leaves name undefined and returns the NX_ENOENT value.

See Also

NXContextSetName