Process-in-Process
 All Functions Groups Pages
Functions
Export/Import Functions

Functions

int pip_named_export (void *exp, const char *format,...) __attribute__((format(printf
 export an address of the calling PiP root or a PiP task to the others. More...
 
int int pip_named_import (int pipid, void **expp, const char *format,...) __attribute__((format(printf
 import the named exported address More...
 
int int int pip_named_tryimport (int pipid, void **expp, const char *format,...) __attribute__((format(printf
 import the named exported address (non-blocking) More...
 
int int int int pip_export (void *exp)
 export an address More...
 
int pip_import (int pipid, void **expp)
 import exported address of a PiP task More...
 
int pip_set_aux (void *aux)
 Associate user data with a PiP task. More...
 
int pip_get_aux (void **auxp)
 Retrieve the user data associated with a PiP task. More...
 
int pip_get_dlmopen_info (int pipid, void **handlep, long *lmidp)
 Retrieve the loaded link map info. of the specified Pip task. More...
 

Detailed Description

PiP Export and Import

Description
Export and import functions to exchange addresses among tasks

Function Documentation

int pip_named_export ( void *  exp,
const char *  format,
  ... 
)
Name
pip_named_export
Synopsis
#include <pip/pip.h>
int pip_named_export( void *exp, const char *format, ... )
Description
Pass an address of a memory region to the other PiP task. Unlike the simmple pip_export and pip_import functions which can only export one address per task, pip_named_export and pip_named_import can associate a name with an address so that PiP root or PiP task can exchange arbitrary number of addressess.
Parameters
[in]expan address to be passed to the other PiP task
[in]formata printf format to give the exported address a name. If this is NULL, then the name is assumed to be "".
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMpip_init is not yet called.
EBUSYThe name is already registered.
ENOMEMNot enough memory
Note
The addresses exported by pip_named_export cannot be imported by calling pip_import, and vice versa.
See Also
pip_named_import
int int pip_named_import ( int  pipid,
void **  expp,
const char *  format,
  ... 
)
Name
pip_named_import
Synopsis
#include <pip/pip.h>
int pip_named_import( int pipid, void **expp, const char *format, ... )
Description
Import an address exported by the specified PiP task and having the specified name. If it is not exported yet, the calling task will be blocked. The
Parameters
[in]pipidThe PiP ID to import the exposed address
[out]exppThe starting address of the exposed region of the PiP task specified by the pipid.
[in]formata printf format to give the exported address a name
Note
There is possibility of deadlock when two or more tasks are mutually waiting for exported addresses.
The addresses exported by pip_export cannot be imported by calling pip_named_import, and vice versa.
Returns
zero is returned if this function succeeds. On error, an error number is returned.
Return values
EPERMpip_init is not yet called.
EINVALThe specified pipid is invalid
ENOMEMNot enough memory
ECANCELEDThe target task is terminated
EDEADLKpipid is the calling task and tries to block itself
See Also
pip_named_export
pip_named_tryimport
pip_export
pip_import
int int int pip_named_tryimport ( int  pipid,
void **  expp,
const char *  format,
  ... 
)
Name
pip_named_tryimport
Synopsis
#include <pip/pip.h>
int pip_named_tryimport( int pipid, void **expp, const char *format, ... )
Description
Import an address exported by the specified PiP task and having the specified name. If it is not exported yet, this returns EAGAIN.
Parameters
[in]pipidThe PiP ID to import the exposed address
[out]exppThe starting address of the exposed region of the PiP task specified by the pipid.
[in]formata printf format to give the exported address a name
Note
The addresses exported by pip_export cannot be imported by calling pip_named_import, and vice versa.
Returns
Zero is returned if this function succeeds. On error, an error number is returned.
Return values
EPERMpip_init is not yet called.
EINVALThe specified pipid is invalid
ENOMEMNot enough memory
ECANCELEDThe target task is terminated
EAGAINTarget is not exported yet
See Also
pip_named_export
pip_named_import
pip_export
pip_import
int int int int pip_export ( void *  exp)
Name
pip_export
Synopsis
#include <pip/pip.h>
int pip_export( void *exp );
Description
Pass an address of a memory region to the other PiP task. This is a very naive implementation in PiP v1 and deprecated. Once a task export an address, there is no way to change the exported address or undo export.
Parameters
[in]expAn addresss
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMPiP library is not initialized yet
See Also
pip_import
pip_named_export
pip_named_import
pip_named_tryimport
int pip_import ( int  pipid,
void **  expp 
)
Name
pip_import
Synopsis
#include <pip/pip.h>
int pip_export( void **expp );
Description
Get an address exported by the specified PiP task. This is a very naive implementation in PiP v1 and deprecated. If the address is not yet exported at the time of calling this function, then NULL is returned.
Parameters
[in]pipidThe PiP ID to import the exportedaddress
[out]exppThe exported address
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMPiP library is not initialized yet
See Also
pip_export
pip_named_export
pip_named_import
pip_named_tryimport
int pip_set_aux ( void *  aux)
Name
pip_set_aux
Synopsis
#include <pip/pip.h>
int pip_set_aux( void *aux );
Parameters
[in]auxPointer to the user dats to assocate with the calling PiP task
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMPiP library is not yet initialized or already finalized
See Also
pip_get_aux
int pip_get_aux ( void **  auxp)
Name
pip_get_aux
Synopsis
#include <pip/pip.h>
int pip_get_aux( void **auxp );
Parameters
[out]auxpReturned user data
Returns
Return 0 on success. Return an error code on error.
Return values
EINAVLdomainp is NULL or auxp is NULL
EPERMPiP library is not yet initialized or already finalized
See Also
pip_set_aux
int pip_get_dlmopen_info ( int  pipid,
void **  handlep,
long *  lmidp 
)
Name
pip_get_dlmopen_info
Synopsis
#include <pip/pip.h>
int pip_get_dlmopen_info( int pipid, void **handlep, long *lmidp )
Parameters
[in]pipidThe PiP ID
[out]handleploaded handle
[out]lmidpLmid
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMPiP library is not yet initialized or already finalized
See Also
pip_task_spawn