ソケットオプションの取得
''int PASCAL FAR getsockopt (''
''SOCKET'' s,
''int'' level,
''int'' optname,
''char FAR *'' optval,
''int FAR *'' optlen
''); ''
----
s
-A descriptor identifying a socket. 

level
-The level at which the option is defined; the only supported levels are SOL_SOCKET and IPPROTO_TCP. 

optname
-The socket option for which the value is to be retrieved. 

optval
-A pointer to the buffer in which the value for the requested option is to be returned. 

optlen
-A pointer to the size of the optval buffer.

*返り値 [#z7ccd81f]
成功した場合 0 を返しエラーの場合 SOCKET_ERROR を返す

*エラー [#a95b5f13]
WSAENOTINITIALISED
-A successful WSAStartup() must occur before using this API. 

WSAENETDOWN
-The Windows Sockets implementation has detected that the network subsystem has failed. 

WSAEFAULT
-The optlen argument was invalid. 

WSAEINPROGRESS
-A blocking Windows Sockets operation is in progress. 

WSAENOPROTOOPT
-The option is unknown or unsupported. In particular, SO_BROADCAST is not supported on sockets of type SOCK_STREAM, while SO_ACCEPTCON, SO_DONTLINGER, SO_KEEPALIVE, SO_LINGER and SO_OOBINLINE are not supported on sockets of type SOCK_DGRAM. 

WSAENOPROTOOPT
-The option is unknown or unsupported. In particular, SO_BROADCAST is not supported on sockets of type SOCK_STREAM, while SO_ACCEPTCONN, SO_DONTLINGER, SO_KEEPALIVE, SO_LINGER and SO_OOBINLINE are not supported on sockets of type SOCK_DGRAM. 

WSAENOTSOCK
-The descriptor is not a socket.