This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH] compile for ARM in rdi-share under 4.4BSD
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH] compile for ARM in rdi-share under 4.4BSD
- From: Thomas Zenker <thz at Lennartz-electronic dot DE>
- Date: Fri, 4 Feb 2000 11:57:01 +0100
Hi,
here are 3 small changes I propose to apply to the rdi library in
gdb/rdi-share:
1. hsys.c: to compile under 4.4BSD derived systems (FreeBSD,
NetBSD...) sys_errlist should not be declared in hsys.c.
NEED_SYSERRLIST is set already by configure, so we can
use it.
2. unixcomm.c: 4.4BSD derived systems define BSD, but are
posix compliant and we should not work with the old
compatibility stuff. Because of that I undef BSD in
case of FBSD etc and include sys/ioctl to get the flags.
3. unixcomm.c: if the TIOCEXCL flags exists set serial line
for exclusive use.
These patches are against CVS archive of today.
-- Thomas Zenker
c/o Lennartz electronic GmbH
Bismarckstrasse 136, D-72072 Tuebingen, Germany
Phone: +49-(0)7071-93550
Email: thz@lennartz-electronic.de
Index: hsys.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/rdi-share/hsys.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 hsys.c
--- hsys.c 1999/11/02 04:44:26 1.1.1.2
+++ hsys.c 2000/02/04 10:33:20
@@ -125,8 +125,10 @@
}
}
+#ifdef NEED_SYSERRLIST
extern int sys_nerr;
extern char *sys_errlist[];
+#endif
static char *DebugStrError(int last_errno)
{
Index: unixcomm.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/rdi-share/unixcomm.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 unixcomm.c
--- unixcomm.c 2000/01/11 03:07:32 1.1.1.4
+++ unixcomm.c 2000/02/04 10:33:27
@@ -36,6 +36,11 @@
#include <sys/types.h>
#include <sys/time.h>
+#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (bsdi)
+#undef BSD
+#include <sys/ioctl.h>
+#endif
+
#ifdef sun
# include <sys/ioccom.h>
# ifdef __svr4__
@@ -253,6 +258,13 @@
perror("open");
return -1;
}
+#ifdef TIOCEXCL
+ if (ioctl(serpfd, TIOCEXCL) < 0) {
+ close(serpfd);
+ perror("ioctl: TIOCEXCL");
+ return -1;
+ }
+#endif
return 0;
}