ConnectServerInfo(), ConnectServerInfo_r()

Получить информацию о соединении с сервером

Прототип:

#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 );

Аргументы:

pid
The process ID of the owner of the connection.
coid
The connection ID of the connection.
info
NULL, or a pointer to a struct _server_info where the function can store information about the connection.

Библиотека:

libc

Описание:

The ConnectServerInfo() and ConnectServerInfo_r() kernel calls get information about the connection coid owned by process pid, and store it in the structure pointed to by 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.

Данные функции идентичны за исключением способа возврата ошибок.

If the info argument is NULL, ConnectServerInfo() ignores connections with dead servers and skips to the next coid. If info is non-NULL, the function fills in the struct _server_info; for connections with dead servers, it turns on the _NTO_COF_DEAD bit in the flags field of the structure.

Возвращаемое значение:

ConnectServerInfo()
A matched coid. If an error occurs, the function returns -1 and sets errno.
ConnectServerInfo_r()
A matched coid. This function does NOT set errno. If an error occurs, the function returns the negative of a value from the Errors section.

Коды ошибок:

EFAULT
A fault occurred when the kernel tried to access the buffers provided.
EINVAL
Process pid doesn't have a connection >= coid.
ESRCH
The process indicated by pid doesn't exist.

Классификация:

ЗОСРВ «Нейтрино»

Точка остановки потока
Да
Обработчик прерываний
Нет
Обработчик сигналов
Да
В потоке
Да

Тематические ссылки:

struct _server_info, asyncmsg_connect_attach(), ConnectAttach(), ConnectClientInfo(), MsgInfo(), MsgReceivev(), ND_NODE_CMP(), netmgr_ndtostr(), netmgr_remote_nd(), netmgr_strtond()




Предыдущий раздел: Описание API системной библиотеки