The setsockopt(2) syscall allows a program to set options on a socket. Some options are restricted to the superuser (root) only.