libnames.a - names client API library

Functions to communicate with the names server. More...

Functions

int names_register (const char *name)
 Register the current thread with the given name.
int names_query_id (const l4_threadid_t id, char *name, const int length)
 Get the name registered for a thread ID.
int names_unregister (const char *name)
 Unregister a given name.
int names_query_name (const char *name, l4_threadid_t *id)
 Get the thread ID registered for a given name.
int names_unregister_task (l4_threadid_t tid)
 Unregister all names registered for a given task.
int names_query_nr (const int nr, char *name, const int length, l4_threadid_t *id)
 Query the entry of the given number.
int names_waitfor_name (const char *name, l4_threadid_t *id, const int timeout)
 Repeatedly query for a given name.

Detailed Description

Functions to communicate with the names server.

The function-prototypes can be found in <l4/names/libnames.>.


Function Documentation

int names_query_id ( const l4_threadid_t  id,
char *  name,
const int  length 
)

Get the name registered for a thread ID.

Parameters:
id The thread ID the name should be returned for.
name Pointer to a preallocated area of memory. May be NULL.
length Size of the area at name
Return values:
0 Error. The thread ID was not being registered before.
!=0 Success.
The name service is queried for the thread_id id. If there is a name registered for id, the associated name is copied to the buffer referenced by name.

References names_get_ns_id(), and NAMES_MAX_NAME_LEN.

int names_query_name ( const char *  name,
l4_threadid_t *  id 
)

Get the thread ID registered for a given name.

Parameters:
name 0-terminated name the ID should be returned for.
id Thread ID of the name. May be NULL.
Return values:
0 Error. The name was not being registered before.
!=0 Success.
The name service is queried for the string name. If found, the associated thread_id is written to the buffer referenced by id.

References names_get_ns_id().

Referenced by names_waitfor_name().

int names_query_nr ( const int  nr,
char *  name,
const int  length,
l4_threadid_t *  id 
)

Query the entry of the given number.

Parameters:
nr The nr the name and thread ID should be returned for.
name Pointer to a preallocated area of memory. May be NULL.
length Size of the area at name.
id Thread ID of the entry number nr. May be NULL.
Return values:
0 Error. The entry with the given number is not valid.
!=0 Success.
The name service is queried for the given number. Upon success, both name and id are filled in. To get all entries registered at the server, you have to iterate from 0 to NAMES_MAX_ENTRIES and take all successful answers into account.

References names_get_ns_id(), and NAMES_MAX_NAME_LEN.

int names_register ( const char *  name  ) 

Register the current thread with the given name.

Parameters:
name 0-terminated name to register as.
Return values:
0 Error. Name is already registerd.
!=0 Success.
The string name is registered with the caller's own thread_id.

Note:
The name is not necessarily 0-terminated when being sent to the server.

References names_get_ns_id().

int names_unregister ( const char *  name  ) 

Unregister a given name.

Parameters:
name 0-terminated name to unregister.
Return values:
0 Error. Name is not registerd.
!=0 Success.
The string name is unregistered.

References names_get_ns_id().

int names_unregister_task ( l4_threadid_t  tid  ) 

Unregister all names registered for a given task.

Parameters:
tid contains the task ID to unregister
Return values:
0 Error. No entry found matching the given task.
!=0 Success. At least one entry matching the given task found.
All names/ID pairs with the task-ID part of the thread ID matching that of tid are unregistered at the server.

References names_get_ns_id().

int names_waitfor_name ( const char *  name,
l4_threadid_t *  id,
const int  timeout 
)

Repeatedly query for a given name.

Parameters:
name 0-terminated name the ID should be returned for.
id thread ID will be stored here.
timeout timeout in ms,
Return values:
0 Error. The name was not registered within the timeout.
!=0 Success.
The name service is repeatedly queried for the string name. If the name gets registered before timeout is over, the associated thread_id is copied into the buffer referenced by id.

References names_query_name().


Generated on Wed Apr 11 06:40:22 2012 for names - DROPS Name Service by  doxygen 1.5.6