kern_soclose Kernel Service
Purpose
Aborts any connections and releases the data in the socket.
Syntax
#include <sys/kern_socket.h>
int kern_soclose( ksocket _t so )Parameters
| Item | Description |
|---|---|
| so | The socket on which the close will be issued. |
Description
The kern_soclose kernel service aborts any connection and releases the data in the socket.
Execution Environment
The kern_soclose kernel service can be called from the process environment.
Examples
ksocket_t so;
int rc;
rc = kern_socreate(AF_INET, &so, SOCK_STREAM, IPPROTO_TCP);
if (rc != 0 )
{
return(-1);
}
/* Socket is in use */
...
kern_soclose(so);Return Values
| Item | Description |
|---|---|
| 0 | Upon Success |
| >0 | Error |
The nonzero return value is the error number that is defined in the /usr/include/sys/errno.h file.