/*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#include "squid.h"
#include "Debug.h"
-#include "disk.h"
#include "DiskIO/IORequestor.h"
#include "DiskIO/Mmapped/MmappedFile.h"
#include "DiskIO/ReadRequest.h"
#include "DiskIO/WriteRequest.h"
+#include "fs_io.h"
#include "globals.h"
#include <cerrno>
};
MmappedFile::MmappedFile(char const *aPath): fd(-1),
- minOffset(0), maxOffset(-1), error_(false)
+ minOffset(0), maxOffset(-1), error_(false)
{
assert(aPath);
path_ = xstrdup(aPath);
// XXX: almost a copy of BlockingFile::open
void
-MmappedFile::open(int flags, mode_t mode, RefCount<IORequestor> callback)
+MmappedFile::open(int flags, mode_t, RefCount<IORequestor> callback)
{
assert(fd < 0);
ioRequestor = callback;
if (fd < 0) {
- debugs(79,3, HERE << "open error: " << xstrerror());
+ int xerrno = errno;
+ debugs(79,3, "open error: " << xstrerr(xerrno));
error_ = true;
} else {
++store_open_disk_fd;
- debugs(79,3, HERE << "FD " << fd);
+ debugs(79,3, "FD " << fd);
// setup mapping boundaries
struct stat sb;
}
Mmapping::Mmapping(int aFd, size_t aLength, int aProt, int aFlags, off_t anOffset):
- fd(aFd), length(aLength), prot(aProt), flags(aFlags), offset(anOffset),
- delta(-1), buf(NULL)
+ fd(aFd), length(aLength), prot(aProt), flags(aFlags), offset(anOffset),
+ delta(-1), buf(NULL)
{
}
}
// TODO: check MAP_NORESERVE, consider MAP_POPULATE and MAP_FIXED
+