Le quartidi 24 nivôse, an CCXI, tom hawkins a écrit : > I just started playing with sockets through Ocaml, but I'm > having difficultly setting options on a socket. > I can get the options just fine (getsockopt), but > when I try to set an option I get "permission denied". > > What am I doing wrong? You are doing wrong that you are trying to set an option that obviously requires superuser privileges. If you are using Linux, by exemple, you can see in the source code: case SO_DEBUG: if(val && !capable(CAP_NET_ADMIN)) { ret = -EACCES; } else sk->debug=valbool; break; and the manpage says: SO_DEBUG Enable socket debugging. Only allowed for processes with the CAP_NET_ADMIN capability or an effective user id of 0. In fact, _you_ are not doing anything wrong: the Linux kernel is wrong, because the Single Unix Specification does not mention EACCES as a permitted exit value for setsockopt, nor the fact that SO_DEBUG should be restricted.