sim: callback: convert FS interfaces to 64-bit

Rather than rely on off_t being the right size between the host &
target, have the interface always be 64-bit.  We can figure out if
we need to truncate when actually outputting it to the right target.
This commit is contained in:
Mike Frysinger 2021-04-24 14:40:43 -04:00
parent 00330cd18a
commit 2fbe9507bf
6 changed files with 24 additions and 11 deletions

View file

@ -205,10 +205,10 @@ os_isatty (host_callback *p, int fd)
return result;
}
static int
os_lseek (host_callback *p, int fd, long off, int way)
static int64_t
os_lseek (host_callback *p, int fd, int64_t off, int way)
{
int result;
int64_t result;
result = fdbad (p, fd);
if (result)
@ -519,7 +519,7 @@ os_lstat (host_callback *p, const char *file, struct stat *buf)
}
static int
os_ftruncate (host_callback *p, int fd, long len)
os_ftruncate (host_callback *p, int fd, int64_t len)
{
int result;
@ -542,7 +542,7 @@ os_ftruncate (host_callback *p, int fd, long len)
}
static int
os_truncate (host_callback *p, const char *file, long len)
os_truncate (host_callback *p, const char *file, int64_t len)
{
#ifdef HAVE_TRUNCATE
int result;