67 m_flags = autoclose ? InternalAutoClose : 0;
81 open(name.c_str(),
flags, perms);
88 if (m_flags & InternalAutoClose)
99 m_flags &= ~InternalAutoClose;
101 m_flags |= InternalAutoClose;
112 return copy ? this->duplicate(dup) :
dup;
121 child->
fd(sysduplicate(fd));
149 open(name.c_str(),
flags, perms);
162 assert(name && *name);
170 unsigned newflags = InternalAutoClose;
172 sysopen(name, flags, perms, newfd, newflags);
190 info.ra_offset = what[
i].
offset();
191 info.ra_count = what[
i].
size();
192 fcntl(fd, F_RDADVISE, &info);
193 #elif _POSIX_ADVISORY_INFO > 0 194 posix_fadvise(fd, what[
i].
offset(), what[
i].
size(), POSIX_FADV_WILLNEED);
196 #error advisory read ahead not available on this platform 246 if (!sysclose(fd, &error))
249 m_flags &= ~InternalAutoClose;
258 m_flags &= ~InternalAutoClose;
virtual void setAutoClose(bool closeit)
IOSize writev(const IOBuffer *from, IOSize length) override
void throwStorageError(const char *category, const char *context, const char *call, int error)
virtual void create(const char *name, bool exclusive=false, int perms=0666)
virtual void attach(IOFD fd)
IOSize writev(const IOBuffer *from, IOSize buffers) override
IOSize write(const void *from, IOSize n) override
IOSize readv(IOBuffer *into, IOSize buffers) override
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
IOSize write(const void *from, IOSize n) override
void close(void) override
IOSize readv(IOBuffer *into, IOSize length) override
IOOffset offset(void) const
static int position[264][3]
File * duplicate(bool copy) const
virtual IOFD fd(void) const
bool prefetch(const IOPosBuffer *what, IOSize n) override