serverspy/src/serverspy.cxx
//------------------------------------------------------------------------------
// This procedure will create a socket and set it to close on exec.
//------------------------------------------------------------------------------
This procedure will create a socket and set it to close on exec.
This procedure will create a socket and set it to close on exec .
int create_socket() {
    int sock = socket (PF_INET, SOCK_STREAM, 0);
#ifndef _WIN32
    if (sock >= 0) {
        fcntl(sock, F_SETFD, 1);
    }
#endif
    return sock;
}
int create_socket ( ) { int sock = socket ( PF_INET , SOCK_STREAM , 0 ) ; #ifndef _WIN32 if ( sock >= 0 ) { fcntl ( sock , F_SETFD , 1 ) ; } #endif return sock ; }
This procedure will create a socket and set it to close on exec.
This procedure will create a socket and set it to close on exec .