![]() |
![]() |
![]() |
Store information about a connection
#include <sys/neutrino.h> int ConnectServerInfo( pid_t pid, int coid, struct _server_info* info ); int ConnectServerInfo_r( pid_t pid, int coid, struct _server_info* info );
libc
The ConnectServerInfo() and ConnectServerInfo_r() functions are identical except in the way they indicate errors. See the Returns section for details.
These kernel calls store information about the connection coid owned by process pid into info. If the process doesn't have a connection coid the call scans for the next higher connection and returns it if present. Otherwise, -1 is returned. If you wish to check for the existence of an exact connection you must compare the returned connection with the coid you requested.
The parameters returned in info at least the following members:
Member | Description |
---|---|
uint32_t nd | Server's's node ID |
pid_t pid | Server's process ID |
struct _cred_info cred | User and group ID credentials |
The cred member has at least the following members:
Member | Description |
---|---|
uid_t ruid | Real user-ID of sending process. |
uid_t euid | Effective user-ID of sending process. |
uid_t suid | Saved user-ID of sending process. |
gid_t rgid | Real group-ID of sending process. |
gid_t egid | Effective group-ID of sending process. |
gid_t sgid | Saved group-ID of sending process. |
uint32_t ngroups | Number of groups in grouplist. |
gid_t grouplist[NGROUPS_MAX] | Supplementary group-IDs of sending process. |
The ngroups argument indicates the size of the callers grouplist in the credential. Making it smaller than NGROUPS_MAX may result in a subset of the groups being returned.
This call is used by a server to check if a client has permissions to access a resource. In a resource manager, it would be called on an open() request.
The nd node descriptor is a magic cookie.
To: | Use this function: |
---|---|
Compare two nd objects | ND_NODE_CMP() |
Convert a nd to text | netmgr_ndtostr() |
Convert text to a nd | netmgr_strtond() |
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
ConnectAttach(), ConnectClientInfo(), MsgInfo(), MsgReceivev(), ND_NODE_CMP(), netmgr_ndtostr(), netmgr_remote_nd(), netmgr_strtond()
![]() |
![]() |
![]() |