Get extended information about a client connection, including abilities
#include <sys/neutrino.h> struct _client_able { unsigned ability; unsigned flags; uint64_t range_lo; uint64_t range_hi; }; int ConnectClientInfoAble( int scoid, struct _client_info **info_pp, const int flags, struct _client_able abilities[], const int nable );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
This call gets information about a client connection identified by scoid, allocates a buffer, stores the information in the buffer, and stores a pointer to the buffer in the location that info_pp points to. Use ClientInfoExtFree() to free this buffer.
A server uses this function to determine whether or not a client has the required abilities; see procmgr_ability(), and procmgr_ability_create(). The server should test if the client has a specific ability only when it receives a request to perform a task that requires this ability, and not any sooner. Ability tests result in system trace events being emitted. An ability test done in advance of when it's required can give an erroneous indication of a process's need for an ability. This can interfere with tools for generating security policies and result in system integrators granting abilities to processes that don't need them. If you test abilities only when they're really required, you'll find there almost always will be only one that's applicable at any point in time.
The ConnectClientInfoAble() function is a specialized version of ConnectClientInfo().
The _client_able structure has at least the following members:
In QNX Neutrino 7.0 or later, if the ID is a temporary one (i.e., it has PROCMGR_AID_UNCREATED ORed into it), ConnectClientInfoAble() looks it up again. If the ability has been created, ConnectClientInfoAble() replaces the temporary ID with the permanent one; otherwise it marks the ability as denied.
Set the ability, range_lo, and range_hi members before calling ConnectClientInfoAble(); this function sets the flags member.
0, or -1 if an error occurred (errno is set).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |