procmgr_ability_create()

Create a process-manager ability

Synopsis:

#include <sys/procmgr.h>

int procmgr_ability_create( const char *name,
                            unsigned flags );

Arguments:

name
The name of the ability. This should by convention consist of a service identifier followed by a capability identifier (e.g., "fs-qnx6/some_devctl").
flags
Flags that apply to the new ability; a bitwise OR of zero or more of the following:
  • PROCMGR_ADN_ROOT — the ability applies to processes that have an effective user ID of 0.
  • PROCMGR_ADN_NONROOT — the ability applies to processes that have an effective user ID other than 0.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The procmgr_ability_create() function creates a process-manager ability. A server can use this function to create the ability, and clients can use procmgr_ability_lookup() to look it up. The name argument is a string that uniquely identifies the ability, and the flags specify which privilege domains have the ability by default.

Note:
  • In order to create an ability, your process must have the PROCMGR_AID_ABLE_CREATE ability enabled. For more information, see procmgr_ability().
  • You can only set the privilege domains for a new ability once; additional calls to procmgr_ability_create() for the same ability will fail unless the flags are the same as before.
  • There's no requirement for a call to procmgr_ability_create() to precede calls to procmgr_ability_lookup(). This avoids forcing any specific ordering of process initialization.

Returns:

A numeric ability identifier, which can then be used in a call to procmgr_ability() or to verify the abilities of a client, or a negative errno value if an error occurred.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes