Create a context.


#include <mm/renderer.h>
mmr_context_t* mmr_context_create( 
                            mmr_connection_t *connection,
                            const char *name,
                            unsigned flags, 
                            mode_t mode )


An mm-renderer connection handle.
The name of the context. This must be a valid filename and will show up in the pathname space as a directory.
Must be zero. No flags are defined for now.
Permission flags controlling which processes can access the context. These flags are specified in a standard POSIX permissions bitfield.
The w bits control which processes can open secondary handles to access the context. The r and x bits provide access to mm-renderer events related to the context.
In this bitfield, the user permissions apply to the caller and to any process with the same effective user ID (euid). You must set these permissions appropriately to grant your application (or other applications running with the same euid) sufficient access to the context being created. The group permissions apply to processes with an effective group ID (egid) or a supplementary group ID matching the caller's egid. The other permissions apply to all other processes.




Create and open a new context with the specified name. Fail if a context with that name already exists. The name must be a valid filename and will show up as a directory in the pathname space, with its file permissions set based on the mode argument. Note that there's not a direct mapping between the value given in mode and the file permissions assigned to the context directory. For an explanation of how the permissions specified in the function call are interpreted, see the mode argument.

When successful, the function returns a handle, called the primary handle, for accessing the newly created context. Depending on your configuration, you may be able to create any number of secondary handles by calling mmr_context_open().

To avoid memory leaks, every handle opened with mmr_context_create() needs to be closed, either explicitly through an API call or implicitly by terminating the process. The mm-renderer configuration also determines whether closing the primary handle also destroys the context. If this option is set and you do close the primary handle of a context, you can no longer use any secondary handles to that context, so you must close those handles by calling mmr_context_close() on each one. If this option isn't set, you can call mmr_context_close() to close the primary handle without destroying the context, which lets you keep using that context by accessing it with secondary handles.


A handle on success, or a null pointer on failure (check errno).


QNX Neutrino

Interrupt handler No
Signal handler No
Thread Yes