* Compute the fo_poll flags required for a fd given by the index and * bit position in the fd_mask array. */
| 1256 | * bit position in the fd_mask array. |
| 1257 | */ |
| 1258 | static __inline int |
| 1259 | selflags(fd_mask **ibits, int idx, fd_mask bit) |
| 1260 | { |
| 1261 | int flags; |
| 1262 | int msk; |
| 1263 | |
| 1264 | flags = 0; |
| 1265 | for (msk = 0; msk < 3; msk++) { |
| 1266 | if (ibits[msk] == NULL) |
| 1267 | continue; |
| 1268 | if ((ibits[msk][idx] & bit) == 0) |
| 1269 | continue; |
| 1270 | flags |= select_flags[msk]; |
| 1271 | } |
| 1272 | return (flags); |
| 1273 | } |
| 1274 | |
| 1275 | /* |
| 1276 | * Set the appropriate output bits given a mask of fired events and the |