/*
- * $Header$
+ * $Header$
*/
#ifndef lint
#endif lint
-
/************************************************************************
*
* gdb_fserv.c
#include <sys/signal.h>
#include "gdb.h"
#include <sys/resource.h>
-\f
+
+
/************************************************************************
*
* create_forking_server (create_forking_server)
/* Called on SIGCHILD to reap all dead children.
/*
/************************************************************************/
-#ifndef sun
+#ifndef POSIX
int
#else
void
#endif
gdb_reaper()
{
+#ifdef POSIX
+ int status
+#else
union wait status;
+#endif
extern char *sys_siglist[];
- while (wait3(&status, WNOHANG, (struct rusage *)0) >0) {
-#ifdef notdef
- if (WIFEXITED(status)) {
- if (status.w_retcode)
- printf("exited with code %d\n",
- status.w_retcode);
- }
- if (WIFSIGNALED(status)) {
- printf("exited on %s signal%s\n",
- sys_siglist[status.w_termsig],
- (status.w_coredump?"; core dumped":0));
- }
-#endif notdef
- }
+#ifdef POSIX
+ while (waitpid(-1, &status, WNOHANG) >0);
+#else
+ while (wait3(&status, WNOHANG, (struct rusage *)0) >0);
+#endif
}
\f
/************************************************************************/
int
g_do_signals()
{
-#ifdef sun
- struct sigvec act;
+#ifdef POSIX
+ struct sigaction act;
- act.sv_handler = gdb_reaper;
- act.sv_mask = 0;
- act.sv_flags = 0;
- (void) sigvec(SIGCHLD, &act, NULL);
+ act.sa_handler = gdb_reaper;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ (void) sigaction(SIGCHLD, &act, (struct sigaction *)0);
#else /* sun */
(void) signal(SIGCHLD, gdb_reaper);
#endif
/*
- * $Source$
- * $Header$
+ * $Source$
+ * $Header$
*/
#ifndef lint
#endif lint
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/************************************************************************/
-/*
-/* gdb_ops.c
-/*
-/* GDB - Asynchronous Operations and Their Synchronous
-/* Counterparts
-/*
-/* Author: Noah Mendelsohn
-/* Copyright: 1986 MIT Project Athena
-/* For copying and distribution information, please see
-/* the file <mit-copyright.h>.
-/*
-/* These routines provide a suite of asynchronous operations
-/* on connections.
-/*
-/************************************************************************/
+/************************************************************************
+ *
+ * gdb_ops.c
+ *
+ * GDB - Asynchronous Operations and Their Synchronous
+ * Counterparts
+ *
+ * Author: Noah Mendelsohn
+ * Copyright: 1986 MIT Project Athena
+ * For copying and distribution information, please see
+ * the file <mit-copyright.h>.
+ *
+ * These routines provide a suite of asynchronous operations
+ * on connections.
+ *
+ ************************************************************************/
#include <mit-copyright.h>
#include <stdio.h>
#include "gdb.h"
#include <netinet/in.h>
#include <sys/ioctl.h>
+#ifdef SOLARIS
+#include <sys/filio.h>
+#endif
#ifdef vax
extern u_long htonl();
#endif vax
-\f
-/************************************************************************/
-/*
-/* send_object (send_object)
-/*
-/* Synchronous form of start_sending_object. Returns either
-/* OP_CANCELLED, or OP_RESULT(op).
-/*
-/************************************************************************/
+
+
+/************************************************************************
+ *
+ * send_object (send_object)
+ *
+ * Synchronous form of start_sending_object. Returns either
+ * OP_CANCELLED, or OP_RESULT(op).
+ *
+ ************************************************************************/
int
send_object(con, objp, type)
delete_operation(op);
return retval;
}
-\f
+
+
/************************************************************************/
/*
/* start_send_object (g_snobj)
return OP_COMPLETE;
}
-\f
+
/************************************************************************/
/*
/* receive_object (receive_object)
delete_operation(op);
return retval;
}
-\f
+
+
/************************************************************************/
/*
/* start_receiving_object (g_rcobj)
db_free((char *)arg, sizeof(struct robj_data)); /* free the state structure */
return OP_COMPLETE;
}
-\f
+
+
/************************************************************************/
/*
/* complete_operation(complete_operation)
}
-\f
+
/************************************************************************/
/*
/* cancel_operation(cancel_operation)
return OP_CANCELLED;
}
-\f
+
+
/************************************************************************/
/*
/* start_listening
return OP_COMPLETE;
}
-\f
+
/************************************************************************/
/*
/* start_accepting_client
/*
- * $Source$
- * $Header$
+ * $Source$
+ * $Header$
*/
#ifndef lint
#endif lint
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/************************************************************************/
-/*
-/* gdb_serv.c
-/*
-/* GDB - Routines to implement the server/client model
-/* of connections.
-/*
-/* Author: Noah Mendelsohn
-/* Copyright: 1986 MIT Project Athena
-/* For copying and distribution information, please see
-/* the file <mit-copyright.h>.
-/*
-/************************************************************************/
+/************************************************************************
+ *
+ * gdb_serv.c
+ *
+ * GDB - Routines to implement the server/client model
+ * of connections.
+ *
+ * Author: Noah Mendelsohn
+ * Copyright: 1986 MIT Project Athena
+ * For copying and distribution information, please see
+ * the file <mit-copyright.h>.
+ *
+ ************************************************************************/
#include <mit-copyright.h>
#include <stdio.h>
#include <strings.h>
#include "gdb.h"
#include <sys/ioctl.h>
+#ifdef SOLARIS
+#include <sys/filio.h>
+#endif
- /*----------------------------------------------------------*/
- /*
- /* The following field names and types describe the
- /* tuple sent from clients to servers during negotiation.
- /*
- /*----------------------------------------------------------*/
+ /*----------------------------------------------------------
+ *
+ * The following field names and types describe the
+ * tuple sent from clients to servers during negotiation.
+ *
+ *----------------------------------------------------------*/
char *g_tsv_field_names[] = {"server_id",
"parms",
#define FSV_SERVER_ID 1
#define FSV_PARMS 2
-\f
+
/************************************************************************/
/*
/* gdb_i_srv
gdb_socklen = sizeof(gdb_sockaddr_of_client);
}
-\f
+
/************************************************************************/
/*
/* start_server_connection (start_server_connection)
return NULL;
}
}
-\f
+
/************************************************************************/
/*
/* g_try_server
return;
}
-\f
+
/************************************************************************/
/*
/* g_ask_server
/* CON_STOPPING with errno */
}
}
-\f
+
+
/************************************************************************/
/*
/* start_replying_to_client