FileBase::set_extent(offset, length) constrains seek() and tell()

This commit is contained in:
John Reiser
2007-02-03 13:31:44 -08:00
parent d1e352c9ee
commit a545a3938f
3 changed files with 40 additions and 7 deletions
+4
View File
@@ -59,6 +59,7 @@ public:
virtual bool isOpen() const { return _fd >= 0; }
int getFd() const { return _fd; }
const char *getName() const { return _name; }
virtual off_t st_size() const; // { return _length; }
protected:
void sopen();
@@ -67,12 +68,15 @@ protected:
virtual void write(const void *buf, int len);
virtual void seek(off_t off, int whence);
virtual off_t tell() const;
virtual void set_extent(off_t offset, off_t length);
int _fd;
int _flags;
int _shflags;
int _mode;
const char *_name;
off_t _offset;
off_t _length;
public:
struct stat st;
};