mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
include/gdb:
* callback.h (struct host_callback_struct): New members ftruncate and truncate. gdb: sim/common: * callback.c (os_ftruncate, os_truncate): New functions. (default_callback): Initialize ftruncate and truncate members. sim/sh: * syscall.h (SYS_truncate, SYS_ftruncate): Define. * interp.c (trap): Add support for SYS_ftruncate and SYS_truncate.
This commit is contained in:
@ -399,6 +399,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, stat (file, len));
|
||||
}
|
||||
|
||||
static int
|
||||
os_shutdown (p)
|
||||
host_callback *p;
|
||||
@ -538,6 +562,9 @@ host_callback default_callback =
|
||||
os_stat,
|
||||
os_fstat,
|
||||
|
||||
os_ftruncate,
|
||||
os_truncate,
|
||||
|
||||
os_poll_quit,
|
||||
|
||||
os_shutdown,
|
||||
|
Reference in New Issue
Block a user