Added poll function

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>