* callback.c: Update copyright dates.
[deliverable/binutils-gdb.git] / sim / common / callback.c
index 19acca0e99889a7a3281a8521375b03f68f823fe..62848e8025f3e0f42178e78cbb994c240abff8bc 100644 (file)
@@ -1,5 +1,6 @@
 /* Remote target callback routines.
-   Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
    This file is part of GDB.
@@ -22,7 +23,7 @@
    level.  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
 #endif
 #include "ansidecl.h"
 #ifdef ANSI_PROTOTYPES
@@ -46,7 +47,7 @@
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "callback.h"
+#include "gdb/callback.h"
 #include "targ-vals.h"
 
 #ifdef HAVE_UNISTD_H
@@ -399,6 +400,30 @@ os_fstat (p, fd, buf)
   return wrap (p, fstat (fdmap (p, fd), buf));
 }
 
+static int 
+os_ftruncate (p, fd, len)
+     host_callback *p;
+     int fd;
+     long len;
+{
+  int result;
+
+  result = fdbad (p, fd);
+  if (result)
+    return result;
+  result = wrap (p, ftruncate (fdmap (p, fd), len));
+  return result;
+}
+
+static int
+os_truncate (p, file, len)
+     host_callback *p;
+     const char *file;
+     long len;
+{
+  return wrap (p, truncate (file, len));
+}
+
 static int
 os_shutdown (p)
      host_callback *p;
@@ -435,7 +460,7 @@ os_init (p)
   return 1;
 }
 
-/* DEPRECIATED */
+/* DEPRECATED */
 
 /* VARARGS */
 static void
@@ -538,6 +563,9 @@ host_callback default_callback =
   os_stat,
   os_fstat,
 
+  os_ftruncate,
+  os_truncate,
+
   os_poll_quit,
 
   os_shutdown,
@@ -726,7 +754,7 @@ store (p, size, val, big_p)
    TS is ignored.
 
    The result is the size of the target's stat struct,
-   or zero if an error occured during the translation.  */
+   or zero if an error occurred during the translation.  */
 
 int
 cb_host_to_target_stat (cb, hs, ts)
This page took 0.025543 seconds and 4 git commands to generate.