make fd private type instead of just int
set_sockopt helper