improved poll() support