s/struct _serial_t/struct serial/
[deliverable/binutils-gdb.git] / bfd / trad-core.c
index 633c53d98384a24920e870f5e721f7f55a18173b..872ad54ab858c119ab5ee3219c8ee05548732008 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back end for traditional Unix core files (U-area and raw sections)
-   Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 98, 99, 2000
+   Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+   2000
    Free Software Foundation, Inc.
    Written by John Gilmore of Cygnus Support.
 
@@ -25,7 +26,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "libaout.h"           /* BFD a.out internal data structures */
 
 #include <sys/param.h>
-#include <sys/dir.h>
+#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
 #include <signal.h>
 
 #include <sys/user.h>          /* After a.out.h  */
@@ -34,7 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include TRAD_HEADER
 #endif
 
-  struct trad_core_struct 
+  struct trad_core_struct
     {
       asection *data_section;
       asection *stack_section;
@@ -73,7 +86,7 @@ trad_unix_core_file_p (abfd)
   if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0)
     return 0;
 #endif
-    
+
   val = bfd_read ((void *)&u, 1, sizeof u, abfd);
   if (val != sizeof u)
     {
@@ -83,7 +96,7 @@ trad_unix_core_file_p (abfd)
     }
 
   /* Sanity check perhaps??? */
-  if (u.u_dsize > 0x1000000)   /* Remember, it's in pages... */
+  if (u.u_dsize > 0x1000000)   /* Remember, it's in pages...  */
     {
       bfd_set_error (bfd_error_wrong_format);
       return 0;
@@ -112,7 +125,7 @@ trad_unix_core_file_p (abfd)
                                 + u.u_ssize))
        > (unsigned long) statbuf.st_size)
       {
-       bfd_set_error (bfd_error_file_truncated);
+       bfd_set_error (bfd_error_wrong_format);
        return 0;
       }
 #ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE
@@ -140,7 +153,7 @@ trad_unix_core_file_p (abfd)
                bfd_zmalloc (sizeof (struct trad_core_struct));
   if (rawptr == NULL)
     return 0;
-  
+
   abfd->tdata.trad_core_data = rawptr;
 
   rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */
@@ -195,13 +208,13 @@ trad_unix_core_file_p (abfd)
      from *u_ar0.  The other is that u_ar0 is sometimes an absolute address
      in kernel memory, and on other systems it is an offset from the beginning
      of the `struct user'.
-     
+
      As a practical matter, we don't know where the registers actually are,
      so we have to pass the whole area to GDB.  We encode the value of u_ar0
      by setting the .regs section up so that its virtual memory address
      0 is at the place pointed to by u_ar0 (by setting the vma of the start
      of the section to -u_ar0).  GDB uses this info to locate the regs,
-     using minor trickery to get around the offset-or-absolute-addr problem. */
+     using minor trickery to get around the offset-or-absolute-addr problem.  */
   core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0;
 
   core_datasec (abfd)->filepos = NBPG * UPAGES;
@@ -261,9 +274,9 @@ trad_unix_core_file_matches_executable_p  (core_bfd, exec_bfd)
 \f
 /* If somebody calls any byte-swapping routines, shoot them.  */
 static void
-swap_abort()
+swap_abort ()
 {
-  abort(); /* This way doesn't require any declaration for ANSI to fuck up */
+  abort (); /* This way doesn't require any declaration for ANSI to fuck up */
 }
 #define        NO_GET  ((bfd_vma (*) PARAMS ((   const bfd_byte *))) swap_abort )
 #define        NO_PUT  ((void    (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
@@ -304,7 +317,7 @@ const bfd_target trad_core_vec =
      bfd_false, bfd_false,
      bfd_false, bfd_false
     },
-    
+
        BFD_JUMP_TABLE_GENERIC (_bfd_generic),
        BFD_JUMP_TABLE_COPY (_bfd_generic),
        BFD_JUMP_TABLE_CORE (trad_unix),
@@ -316,6 +329,6 @@ const bfd_target trad_core_vec =
        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
     NULL,
-    
+
     (PTR) 0                    /* backend_data */
 };
This page took 0.024636 seconds and 4 git commands to generate.