/* 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.
level. */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
#endif
#include "ansidecl.h"
#ifdef ANSI_PROTOTYPES
#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
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;
return 1;
}
-/* DEPRECIATED */
+/* DEPRECATED */
/* VARARGS */
static void
os_stat,
os_fstat,
+ os_ftruncate,
+ os_truncate,
+
os_poll_quit,
os_shutdown,
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)