]> andersk Git - moira.git/blobdiff - gdb/gdb_conn.c
posixify source
[moira.git] / gdb / gdb_conn.c
index c819b3e88a723bb4bf6d36e6d9d66234ab7f718e..bb263b854f0533dd9b09152dcca6fb28e548dac4 100644 (file)
@@ -1,56 +1,33 @@
 /*
- *     $Source$
- *     $Header$
+ * $Source$
+ * $Header$
  */
 
 #ifndef lint
 static char *rcsid_gdb_conn_c = "$Header$";
 #endif lint
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/************************************************************************/
-/*     
-/*                        gdb_conn.c
-/*     
-/*           GDB - Connection Management Services
-/*     
-/*     Author: Noah Mendelsohn
-/*     Copyright: 1986 MIT Project Athena 
-/*             For copying and distribution information, please see
-/*             the file <mit-copyright.h>.
-/*     
-/*     Routines used in the creation and maintenance of CONNECTIONS.
-/*     Note: these are closely related to the services provided
-/*     by gdb_trans.c and gdb_trans2.c.
-/*     
-/*     
-/************************************************************************/
+/************************************************************************
+ *     
+ *                        gdb_conn.c
+ *     
+ *           GDB - Connection Management Services
+ *     
+ *     Author: Noah Mendelsohn
+ *     Copyright: 1986 MIT Project Athena 
+ *             For copying and distribution information, please see
+ *             the file <mit-copyright.h>.
+ *     
+ *     Routines used in the creation and maintenance of CONNECTIONS.
+ *     Note: these are closely related to the services provided
+ *     by gdb_trans.c and gdb_trans2.c.
+ *     
+ *     
+ ************************************************************************/
 
 #include <mit-copyright.h>
 #include <stdio.h>
-#include <strings.h>
+#include <string.h>
 #include "gdb.h"
 #include <sys/types.h>
 #include <sys/uio.h>
@@ -59,6 +36,9 @@ static char *rcsid_gdb_conn_c = "$Header$";
 #include <netinet/in.h>
 #include <netdb.h>
 #include <errno.h>
+#ifdef SOLARIS
+#include <sys/filio.h>
+#endif /* SOLARIS */
 
 extern int errno;
 #ifdef vax
@@ -67,22 +47,22 @@ extern u_short htons();                     /* ?? All versions?  */
 
 CONNECTION gdb_allocate_connection();
 
-/************************************************************************/
-/*     
-/*                     start_peer_connection (start_peer_connection)
-/*     
-/*     Starts a connection to another process which itself will be 
-/*     issuing a start_peer_connection to us.  Current implementation
-/*     builds at most one stream, with the risk of a hang if 
-/*     the attempts to connect cross in the night.  This is a bug,
-/*     but this level of support is acceptable for casual debugging
-/*     of applications, and perhaps for some production use in
-/*     controlled settings.  I think the only other way to do it 
-/*     is to risk building two streams in parallel, possibly tearing
-/*     one down when the duplication is discovered.  Seems complicated
-/*     and messy.
-/*     
-/************************************************************************/
+/************************************************************************
+ *     
+ *                     start_peer_connection (start_peer_connection)
+ *     
+ *     Starts a connection to another process which itself will be 
+ *     issuing a start_peer_connection to us.  Current implementation
+ *     builds at most one stream, with the risk of a hang if 
+ *     the attempts to connect cross in the night.  This is a bug,
+ *     but this level of support is acceptable for casual debugging
+ *     of applications, and perhaps for some production use in
+ *     controlled settings.  I think the only other way to do it 
+ *     is to risk building two streams in parallel, possibly tearing
+ *     one down when the duplication is discovered.  Seems complicated
+ *     and messy.
+ *     
+ ************************************************************************/
 
 CONNECTION
 start_peer_connection(id)
@@ -143,7 +123,8 @@ char *id;                                   /* null terminated string */
        } else
                return NULL;
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                             g_make_con
@@ -174,7 +155,8 @@ g_make_con()
 
 }
 
-\f/************************************************************************/
+
+/************************************************************************/
 /*     
 /*                             g_null_con
 /*     
@@ -229,7 +211,7 @@ CONNECTION con;
 
 }
 
-\f
+
 /************************************************************************/
 /*     
 /*                     gdb_allocate_connection
@@ -270,7 +252,8 @@ gdb_allocate_connection()
        return &gdb_cons[i];                    /* return new highest con */
                                                /* ever used*/       
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                     g_try_connecting
@@ -312,7 +295,7 @@ char *id;
        /*      
        /*----------------------------------------------------------*/
 
-       bzero((char *)&target, sizeof(target));
+       memset((char *)&target, 0, sizeof(target));
        g_parse_target(id, &peer_host, &target.sin_port);
        if (peer_host == NULL) {
                fprintf(gdb_log,"gdb: g_try_connecting...  '%s' is not a valid host:server\n",
@@ -342,7 +325,7 @@ char *id;
        /*----------------------------------------------------------*/
 
 
-       bcopy(peer_host->h_addr, (char *)&target.sin_addr, peer_host->h_length);
+       memcpy((char *)&target.sin_addr,peer_host->h_addr,peer_host->h_length);
        target.sin_family = peer_host->h_addrtype;
 
        /*----------------------------------------------------------*/
@@ -384,7 +367,8 @@ char *id;
        return TRUE;
 
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                     g_parse_target
@@ -488,7 +472,8 @@ u_short *port;
                *port = serv->s_port;
        }
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                     g_try_accepting
@@ -555,7 +540,7 @@ char *id;
        /*      
        /*----------------------------------------------------------*/
 
-       bzero((char *)&self, sizeof(self));
+       memset((char *)&self, 0, sizeof(self));
        g_parse_target(id, &peer_host, &self.sin_port);
        if (peer_host == NULL) {
                GDB_GIVEUP("gdb_try_accepting: bad port not caught by try connecting")
@@ -618,7 +603,8 @@ char *id;
        con->out.fd = peer;
        con->status = CON_STARTING;
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                     g_ver_oprotocol
@@ -672,6 +658,7 @@ CONNECTION con;
 #endif !VERIFY_PROTOCOL
 }
 
+
 /************************************************************************/
 /*     
 /*                     g_ver_iprotocol
@@ -725,7 +712,7 @@ CONNECTION con;
 #endif
 }
 
-\f
+
 /************************************************************************/
 /*     
 /*                     sever_connection (sever_connection)
@@ -755,6 +742,7 @@ CONNECTION con;
        return NULL;
 }
 
+
 /************************************************************************/
 /*     
 /*                     g_stop_with_errno
@@ -765,7 +753,6 @@ CONNECTION con;
 /*     
 /************************************************************************/
 
-
 int
 g_stop_with_errno(con)
 CONNECTION con;
@@ -775,6 +762,7 @@ CONNECTION con;
        
 }
 
+
 /************************************************************************/
 /*     
 /*                     g_stop_connection
@@ -825,7 +813,7 @@ CONNECTION con;
        return;
 }
 
-\f
+
 /************************************************************************/
 /*     
 /*                     gdb_de_allocate_connection
@@ -853,7 +841,8 @@ CONNECTION con;
 
        gdb_mcons = i + 1;
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                     g_cleanup_half_conection
@@ -886,7 +875,8 @@ HALF_CONNECTION hcon;
                current = next;
        }
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                 create_listening_connection (create_listening_connection)
@@ -977,7 +967,7 @@ char *id;
        /*      
        /*----------------------------------------------------------*/
 
-       bzero((char *)&self, sizeof(self));
+       memset((char *)&self, 0, sizeof(self));
        /*
         * Determine our port number
         */
@@ -1029,7 +1019,8 @@ char *id;
                gdb_mfd = con->in.fd + 1;
        return con;
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                     g_allocate_connection_buffers
This page took 0.130466 seconds and 4 git commands to generate.