rpc_svc_input, svc_add_input, svc_remove_input - declare or remove a callback on a file descriptor
#include <rpc/rpc.h> typedef void (*svc_callback_t)(svc_input_id_t id, int fd, unsigned int events, void *cookie);
svc_input_id_t svc_add_input(int fd, unsigned int revents, svc_callback_t callback, void *cookie);
int svc_remove_input(svc_input_t id);
The following RPC routines are used to declare or remove a callback on a file descriptor.
See rpc(3NSL) for the definition of the SVCXPRT data structure.
svc_add_input()
The callback to be invoked is specified using the callback parameter. The cookie parameter can be used to pass any data to the callback function. This parameter is a user-defined value which is passed as an argument to the callback function, and it is not used by the Sun RPC library itself.
Several callbacks can be registered on the same file descriptor as long as each callback registration specifies a separate set of event flags.
The callback function is called with the registration id, the fd file descriptor, an revents value, which is a bitmask of all events concerning the file descriptor, and the cookie user-defined value.
Upon successful completion, the function returns a unique identifier for this registration, that can be used later to remove this callback. Upon failure, -1 is returned and errno is set to indicate the error.
The svc_add_input() function will fail if:
EINVAL
EEXIST
ENOMEM
svc_remove_input()
Upon successful completion, the function returns zero. Upon failure, -1 is returned and errno is set to indicate the error.
The svc_remove_input() function will fail if:
EINVAL
See attributes(5) for descriptions of the following attributes:
|
poll(2), rpc(3NSL), attributes(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |