| 215 | |
| 216 | /*! \brief add a fd_map structure to the fd hash */ |
| 217 | static inline struct fd_map* hash_fd_map( io_wait_h* h, |
| 218 | int fd, |
| 219 | fd_type type, |
| 220 | void* data, |
| 221 | int flags, |
| 222 | unsigned int timeout, |
| 223 | int *already) |
| 224 | { |
| 225 | if (h->fd_hash[fd].fd <= 0) { |
| 226 | *already = 0; |
| 227 | } else { |
| 228 | *already = 1; |
| 229 | } |
| 230 | |
| 231 | h->fd_hash[fd].fd=fd; |
| 232 | h->fd_hash[fd].type=type; |
| 233 | h->fd_hash[fd].data=data; |
| 234 | |
| 235 | h->fd_hash[fd].flags|=flags; |
| 236 | |
| 237 | h->fd_hash[fd].timeout = timeout; |
| 238 | |
| 239 | return &h->fd_hash[fd]; |
| 240 | } |
| 241 | |
| 242 | |
| 243 | #ifdef HAVE_KQUEUE |