This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[fyi] Add gdb_dirent.h and use
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [fyi] Add gdb_dirent.h and use
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 25 May 2000 16:47:03 +1000
- Organization: Cygnus Solutions
FYI,
This replaces any includes of <sys/dir.h> and <dirent.h> with
"gdb_dirent.h". As IanT noted on the binutils list:
> I believe that on some systems you must include <sys/dir.h> before
> including <sys/user.h>. I'm not completly certain about that, though.
Andrew
Thu May 25 15:22:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (AC_CHECK_HEADERS): Check for <dirent.h>,
<sys/ndir.h>, <sys/dir.h> and <ndir.h>.
* config.in, configure: Re-generate.
* gdb_dirent.h: New file
* infptrace.c: Include "gdb_dirent.h" instead of <sys/dir.h>.
* core-aout.c: Ditto.
* procfs.c: Include "gdb_dirent.h" instead of <dirent.h>.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.26
diff -p -r1.26 configure.in
*** configure.in 2000/05/25 01:50:50 1.26
--- configure.in 2000/05/25 06:32:55
*************** AC_CHECK_HEADERS(ctype.h curses.h endian
*** 102,108 ****
string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
! time.h sys/ioctl.h sys/user.h)
AC_HEADER_STAT
AC_C_CONST
--- 102,109 ----
string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
! time.h sys/ioctl.h sys/user.h \
! dirent.h sys/ndir.h sys/dir.h ndir.h)
AC_HEADER_STAT
AC_C_CONST
Index: core-aout.c
===================================================================
RCS file: /cvs/src/src/gdb/core-aout.c,v
retrieving revision 1.1.1.3
diff -p -r1.1.1.3 core-aout.c
*** core-aout.c 1999/10/05 23:08:06 1.1.1.3
--- core-aout.c 2000/05/25 06:32:55
***************
*** 41,47 ****
/* These are needed on various systems to expand REGISTER_U_ADDR. */
#ifndef USG
! #include <sys/dir.h>
#include <sys/file.h>
#include "gdb_stat.h"
#include <sys/user.h>
--- 41,47 ----
/* These are needed on various systems to expand REGISTER_U_ADDR. */
#ifndef USG
! #include "gdb_dirent.h"
#include <sys/file.h>
#include "gdb_stat.h"
#include <sys/user.h>
Index: gdb_dirent.h
===================================================================
RCS file: gdb_dirent.h
diff -N gdb_dirent.h
*** /dev/null Tue May 5 13:32:27 1998
--- gdb_dirent.h Wed May 24 23:32:55 2000
***************
*** 0 ****
--- 1,40 ----
+ /* Portable <dirent.h>
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ #if !defined(GDB_DIRENT_H)
+ #define GDB_DIRENT_H
+
+ /* From bfd/hpux-core.c. */
+
+ #ifdef HAVE_DIRENT_H
+ # include <dirent.h>
+ #else
+ # ifdef HAVE_SYS_NDIR_H
+ # include <sys/ndir.h>
+ # endif
+ # ifdef HAVE_SYS_DIR_H
+ # include <sys/dir.h>
+ # endif
+ # ifdef HAVE_NDIR_H
+ # include <ndir.h>
+ # endif
+ #endif
+
+ #endif /* !defined(GDB_DIRENT_H) */
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.2
diff -p -r1.2 infptrace.c
*** infptrace.c 2000/02/09 08:52:45 1.2
--- infptrace.c 2000/05/25 06:32:57
***************
*** 34,40 ****
#endif
#include <sys/param.h>
! #include <sys/dir.h>
#include <signal.h>
#include <sys/ioctl.h>
--- 34,40 ----
#endif
#include <sys/param.h>
! #include "gdb_dirent.h"
#include <signal.h>
#include <sys/ioctl.h>
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.12
diff -p -r1.12 procfs.c
*** procfs.c 2000/05/22 06:17:35 1.12
--- procfs.c 2000/05/25 06:33:06
***************
*** 1,5 ****
/* Machine independent support for SVR4 /proc (process file system) for GDB.
! Copyright 1999 Free Software Foundation, Inc.
Written by Michael Snyder at Cygnus Solutions.
Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
--- 1,5 ----
/* Machine independent support for SVR4 /proc (process file system) for GDB.
! Copyright 1999-2000 Free Software Foundation, Inc.
Written by Michael Snyder at Cygnus Solutions.
Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
*************** Inc., 59 Temple Place - Suite 330, Bosto
*** 76,82 ****
#ifdef NEW_PROC_API
#include <sys/types.h>
! #include <dirent.h> /* opendir/readdir, for listing the LWP's */
#endif
#include <fcntl.h> /* for O_RDONLY */
--- 76,82 ----
#ifdef NEW_PROC_API
#include <sys/types.h>
! #include "gdb_dirent.h" /* opendir/readdir, for listing the LWP's */
#endif
#include <fcntl.h> /* for O_RDONLY */