RxRegisterKernelResource

Registers a resource created in the kernel by the marshalled code.

Library:LibC
Classification:Novell
Service:Marshalling

Syntax

  #include <ringx.h>
  
  int RxRegisterKernelResource (
     void         *resource,
     RxCleanup_t   function);
  

Parameters

resource

(IN) Specifies the resource to register.

function

(IN) Specifies the function to cleanup the resource if the protected address space faults.

Return Values

If successful, returns 0. Otherwise returns -1 and sets errno.

Remarks

Resources, created as a result of the real, lower function being called, should be registered during the marshalling code's execution so that they may be cleaned up later if the address space faults.

For example, if the real function is socket and socket creates a number of resources before returning to the caller, RxRegisterKernelResource should be called with a function that can clean up those resources by freeing any memory or locks. The cleanup function is only called if the address space faults. If the application continues to run normally, the cleanup function isn't called because the normal close function would release the resources when they were no longer needed.

The cleanup function must use the following syntax:

  typedef void (*RxCleanup_t)( void *addr );
  

See Also