QNX Developer Support
|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Create a data server variable
#include <ds.h> int ds_create( ds_t dsdes, const char * variable_name, char flags, struct sigevent * sigevent );
- A data server descriptor returned by ds_register().
- The name of the variable that you want to create.
All variables are global, so only one instance of the variable can exist in the data server process. The maximum length of a variable name is 60 characters.
- Flags that specify the variable's behavior:
- DS_PERM -- don't delete the variable when the application that created it terminates. The variable is removed when the data server process terminates, or if the flag is turned off after the application that created the variable terminates.
If flags is 0, the variable is removed if you call ds_deregister(), or the process terminates.
- A pointer to a sigevent structure that describes a proxy or signal to be sent to the external application that created the variable if the data referenced by the variable changes; see below.
Use the -l ds option to qcc to link against this library.
The ds_create() function creates a variable, whose name is given by variable_name, on the data server identified by dsdes.
We recommend the following event types for use with this function:
- An error occurred (errno is set).
- Invalid file descriptor dsdes.
- The variable name already exists in the data server.
- Not enough memory to create the variable or initialize the data.
See slinger in the Utilities Reference.