support kqueue/select mode.