Always use 64bit file I/O.

This commit is contained in:
Moritz Bunkus 2004-06-14 08:35:10 +00:00
parent f25917add1
commit f1c9df0b9d
2 changed files with 7 additions and 7 deletions

View File

@ -97,21 +97,21 @@ xio_write(int fd,
int
xio_ftruncate(int fd,
off_t length) {
int64_t length) {
if ((fd < 0) || (fd >= MAX_INSTANCES) || (instances[fd] == NULL))
return -1;
return instances[fd]->truncate(length);
}
off_t
int64_t
xio_lseek(int fd,
off_t offset,
int64_t offset,
int whence) {
int64_t expected_pos;
seek_mode smode;
if ((fd < 0) || (fd >= MAX_INSTANCES) || (instances[fd] == NULL))
return (off_t)-1;
return (int64_t)-1;
if (whence == SEEK_SET) {
smode = seek_beginning;
expected_pos = offset;
@ -124,7 +124,7 @@ xio_lseek(int fd,
}
instances[fd]->setFilePointer(offset, smode);
if (instances[fd]->getFilePointer() != expected_pos)
return (off_t)-1;
return (int64_t)-1;
return expected_pos;
}

View File

@ -34,8 +34,8 @@ extern "C" {
int xio_open(const char *pathname, int flags, ...);
ssize_t xio_read(int fd, void *buf, size_t count);
ssize_t xio_write(int fd, const void *buf, size_t count);
int xio_ftruncate(int fd, off_t length);
off_t xio_lseek(int fd, off_t offset, int whence);
int xio_ftruncate(int fd, int64_t length);
int64_t xio_lseek(int fd, int64_t offset, int whence);
int xio_close(int fd);
int xio_fstat(int fd, struct stat *buf);
int xio_lstat(const char *filename, struct stat *buf);