1161537Smarcel/* Parameters for hosting on an RS6000, for GDB, the GNU debugger.
2161537Smarcel   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
3161537Smarcel   2000, 2001 Free Software Foundation, Inc.
4161537Smarcel   Contributed by IBM Corporation.
5161537Smarcel
6161537Smarcel   This file is part of GDB.
7161537Smarcel
8161537Smarcel   This program is free software; you can redistribute it and/or modify
9161537Smarcel   it under the terms of the GNU General Public License as published by
10161537Smarcel   the Free Software Foundation; either version 2 of the License, or
11161537Smarcel   (at your option) any later version.
12161537Smarcel
13161537Smarcel   This program is distributed in the hope that it will be useful,
14161537Smarcel   but WITHOUT ANY WARRANTY; without even the implied warranty of
15161537Smarcel   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16161537Smarcel   GNU General Public License for more details.
17161537Smarcel
18161537Smarcel   You should have received a copy of the GNU General Public License
19161537Smarcel   along with this program; if not, write to the Free Software
20161537Smarcel   Foundation, Inc., 59 Temple Place - Suite 330,
21161537Smarcel   Boston, MA 02111-1307, USA.  */
22161537Smarcel
23161537Smarcel/* The following text is taken from config/rs6000.mh:
24161537Smarcel * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says
25161537Smarcel * # `extern fd_set svc_fdset;' without ever defining the type fd_set.
26161537Smarcel * # Unfortunately this occurs in the vx-share code, which is not configured
27161537Smarcel * # like the rest of GDB (e.g. it doesn't include "defs.h").
28161537Smarcel * # We circumvent this bug by #define-ing fd_set here, but undefining it in
29161537Smarcel * # the xm-rs6000.h file before ordinary modules try to use it.  FIXME, IBM!
30161537Smarcel * MH_CFLAGS='-Dfd_set=int'
31161537Smarcel * So, here we do the undefine...which has to occur before we include
32161537Smarcel * <sys/select.h> below.
33161537Smarcel */
34161537Smarcel#undef fd_set
35161537Smarcel
36161537Smarcel#include <sys/select.h>
37161537Smarcel
38161537Smarcel/* Big end is at the low address */
39161537Smarcel
40161537Smarcel/* At least as of AIX 3.2, we have termios.  */
41161537Smarcel#define	HAVE_TERMIOS 1
42161537Smarcel/* #define HAVE_TERMIO 1 */
43161537Smarcel
44161537Smarcel#define	USG 1
45161537Smarcel
46161537Smarcel#define FIVE_ARG_PTRACE
47161537Smarcel
48161537Smarcel/* This system requires that we open a terminal with O_NOCTTY for it to
49161537Smarcel   not become our controlling terminal.  */
50161537Smarcel
51161537Smarcel#define	USE_O_NOCTTY
52161537Smarcel
53161537Smarcel/* Brain death inherited from PC's pervades.  */
54161537Smarcel#undef NULL
55161537Smarcel#define NULL 0
56161537Smarcel
57161537Smarcel/* The IBM compiler requires this in order to properly compile alloca().  */
58161537Smarcel#pragma alloca
59161537Smarcel
60161537Smarcel/* There is no vfork.  */
61161537Smarcel
62161537Smarcel#define	vfork	fork
63161537Smarcel
64161537Smarcel/* Signal handler for SIGWINCH `window size changed'. */
65161537Smarcel
66161537Smarcel#define	SIGWINCH_HANDLER  aix_resizewindow
67161537Smarcelextern void aix_resizewindow (int);
68161537Smarcel
69161537Smarcel/* This doesn't seem to be declared in any header file I can find.  */
70161537Smarcelchar *termdef (int, int);
71161537Smarcel
72161537Smarcel/* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */
73161537Smarcel
74161537Smarcel#define	SIGWINCH_HANDLER_BODY	\
75161537Smarcel									\
76161537Smarcel/* Respond to SIGWINCH `window size changed' signal, and reset GDB's	\
77161537Smarcel   window settings appropriately. */					\
78161537Smarcel									\
79161537Smarcelvoid 						\
80161537Smarcelaix_resizewindow (signo)			\
81161537Smarcel     int signo;					\
82161537Smarcel{						\
83161537Smarcel  int fd = fileno (stdout);			\
84161537Smarcel  if (isatty (fd)) {				\
85161537Smarcel    int val;					\
86161537Smarcel						\
87161537Smarcel    val = atoi (termdef (fd, 'l'));		\
88161537Smarcel    if (val > 0)				\
89161537Smarcel      lines_per_page = val;			\
90161537Smarcel    val = atoi (termdef (fd, 'c'));		\
91161537Smarcel    if (val > 0)				\
92161537Smarcel      chars_per_line = val;			\
93161537Smarcel  }						\
94161537Smarcel}
95