Use poll() to avoid an infinite blocking read() that causes ANRs during cleanup