#include <sys.socket.h>
Kernighan-Ritchie-C:
int soc_close(s);
int s;
ANSI-C:
int soc_close(int s);
Description
The exact functionality of soc_close() is determined by the address family used.
soc_close() for AF_INET and AF_INET6
soc_close() closes socket s depending on the SO_LINGER option (see the setsockopt() function in section "getsockopt(), setsockopt() - get and set socket options").
If soc_close() is used with the SO_LINGER option, soc_close() will try to shut down the connection within the time specified by SO_LINGER after sending all pending data.
soc-close() for AF_ISO
soc_close() closes the socket s. Any data in the network and in BCAM is lost.
Return value
0:
If successful.
-1:
If errors occur. errno is set to indicate the error.
Errors indicated by errno
EBADF
The s parameter is not a valid descriptor.
See also
setsockopt()