Use size_t as return value from read()

This commit is contained in:
Sebastian Messmer 2015-12-07 12:13:23 +01:00
parent afd900944a
commit 3943862f0e
4 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ public:
virtual void stat(struct ::stat *result) const = 0;
virtual void truncate(off_t size) const = 0;
virtual ssize_t read(void *buf, size_t count, off_t offset) const = 0;
virtual size_t read(void *buf, size_t count, off_t offset) const = 0;
virtual void write(const void *buf, size_t count, off_t offset) = 0;
virtual void flush() = 0;
virtual void fsync() = 0;

View File

@ -27,7 +27,7 @@ public:
virtual void chown(const boost::filesystem::path &path, uid_t uid, gid_t gid) = 0;
virtual void truncate(const boost::filesystem::path &path, off_t size) = 0;
virtual void ftruncate(int descriptor, off_t size) = 0;
virtual int read(int descriptor, void *buf, size_t count, off_t offset) = 0;
virtual size_t read(int descriptor, void *buf, size_t count, off_t offset) = 0;
virtual void write(int descriptor, const void *buf, size_t count, off_t offset) = 0;
virtual void fsync(int descriptor) = 0;
virtual void fdatasync(int descriptor) = 0;

View File

@ -195,7 +195,7 @@ void FilesystemImpl::ftruncate(int descriptor, off_t size) {
_open_files.get(descriptor)->truncate(size);
}
int FilesystemImpl::read(int descriptor, void *buf, size_t count, off_t offset) {
size_t FilesystemImpl::read(int descriptor, void *buf, size_t count, off_t offset) {
PROFILE(_readNanosec);
return _open_files.get(descriptor)->read(buf, count, offset);
}

View File

@ -31,7 +31,7 @@ public:
void chown(const boost::filesystem::path &path, uid_t uid, gid_t gid) override;
void truncate(const boost::filesystem::path &path, off_t size) override;
void ftruncate(int descriptor, off_t size) override;
int read(int descriptor, void *buf, size_t count, off_t offset) override;
size_t read(int descriptor, void *buf, size_t count, off_t offset) override;
void write(int descriptor, const void *buf, size_t count, off_t offset) override;
void fsync(int descriptor) override;
void fdatasync(int descriptor) override;