Lines Matching refs:fd
13 static int _recycle_fd(int fd);
14 static inline int _fd_is_valid(int fd);
27 int fd; in iotx_cm_open() local
49 fd = _get_fd(connection); in iotx_cm_open()
50 if (fd < 0) { in iotx_cm_open()
55 connection->fd = fd; in iotx_cm_open()
56 return fd; in iotx_cm_open()
59 int iotx_cm_connect(int fd, uint32_t timeout) in iotx_cm_connect() argument
64 if (_fd_is_valid(fd) < 0) { in iotx_cm_connect()
69 connect_func = _cm_fd[fd]->connect_func; in iotx_cm_connect()
99 static int _iotx_cm_yield(int fd, unsigned int timeout) in _iotx_cm_yield() argument
107 if (fd == -1) { in _iotx_cm_yield()
123 if (_fd_is_valid(fd) < 0) { in _iotx_cm_yield()
129 yield_func = _cm_fd[fd]->yield_func; in _iotx_cm_yield()
145 int iotx_cm_yield(int fd, unsigned int timeout) in iotx_cm_yield() argument
150 return _iotx_cm_yield(fd, timeout); in iotx_cm_yield()
154 int iotx_cm_sub(int fd, iotx_cm_ext_params_t *ext, const char *topic, in iotx_cm_sub() argument
159 if (_fd_is_valid(fd) < 0) { in iotx_cm_sub()
165 sub_func = _cm_fd[fd]->sub_func; in iotx_cm_sub()
170 int iotx_cm_unsub(int fd, const char *topic) in iotx_cm_unsub() argument
174 if (_fd_is_valid(fd) < 0) { in iotx_cm_unsub()
180 unsub_func = _cm_fd[fd]->unsub_func; in iotx_cm_unsub()
185 int iotx_cm_pub(int fd, iotx_cm_ext_params_t *ext, const char *topic, in iotx_cm_pub() argument
190 if (_fd_is_valid(fd) < 0) { in iotx_cm_pub()
196 pub_func = _cm_fd[fd]->pub_func; in iotx_cm_pub()
201 int iotx_cm_close(int fd) in iotx_cm_close() argument
205 if (_fd_is_valid(fd) < 0) { in iotx_cm_close()
224 close_func = _cm_fd[fd]->close_func; in iotx_cm_close()
229 if (_recycle_fd(fd) != 0) { in iotx_cm_close()
243 static inline int _fd_is_valid(int fd) in _fd_is_valid() argument
252 ret = (fd >= 0 && fd < CM_MAX_FD_NUM && _cm_fd[fd] != NULL) ? 0 : -1; in _fd_is_valid()
257 static int _recycle_fd(int fd) in _recycle_fd() argument
266 if (fd < 0 || fd > CM_MAX_FD_NUM - 1) { in _recycle_fd()
271 _cm_fd[fd] = NULL; in _recycle_fd()