#include "gdb.h"
#include "gdb_lib.h"
#include <errno.h>
+#ifdef POSIX
+#include <sys/utsname.h>
+#endif
extern int sys_nerr;
extern char *sys_errlist[];
struct passwd *pw_struct; /* passwd entry comes back */
/* here */
+#ifdef POSIX
+ struct utsname nameposix;
+ struct sigaction act;
+
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+#endif
+
/*
* So we know we've been initialized, and we do it only once
*/
* closed at the other end. gdb_move_data handles this condition
* synchronously.
*/
+#ifdef POSIX
+ act.sa_handler = (void(*)()) SIG_IGN;
+ (void) sigaction(SIGPIPE, &act, NULL);
+#else
(void) signal(SIGPIPE, SIG_IGN);
+#endif
/*
* Make a note of the local host and user name
*/
+#ifdef POSIX
+ (void) uname(&nameposix);
+ strncpy(hostname, nameposix.nodename, sizeof(hostname) - 1);
+#else
if (gethostname(hostname, sizeof(hostname)-1)!=0)
(void) strcpy(hostname, "????");
+#endif
gdb_host = db_alloc(strlen(hostname)+1);
(void) strcpy(gdb_host, hostname);