Please check the manual page getsockopt(2).