aports/main/mariadb/lfs64.patch
2024-06-07 07:29:10 +00:00

926 lines
36 KiB
Diff

needed since https://github.com/bminor/musl/commit/25e6fee27f4a293728dd15b659170e7b9c7db9bc
--
diff --git a/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h b/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h
index 0a389db6..6e3c900f 100644
--- a/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h
+++ b/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h
@@ -129,7 +129,7 @@ class ObjectIDManager
* @param offset the offset to start reading at
* @param size the number of bytes to read into buf
*/
- void readData(uint8_t* buf, off64_t offset, int size) const;
+ void readData(uint8_t* buf, off_t offset, int size) const;
/** @brief Reliably writes data to the bitmap file
*
@@ -140,7 +140,7 @@ class ObjectIDManager
* @param offset the offset to start writing at
* @param size the number of bytes to write
*/
- void writeData(uint8_t* buf, off64_t offset, int size) const;
+ void writeData(uint8_t* buf, off_t offset, int size) const;
/** @brief If there is no bitmap file yet, this is used to make one
*
diff --git a/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read b/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read
index d5368cfa..18754df4 100644
--- a/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read
+++ b/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read
@@ -115,7 +115,7 @@ void* thr_popper(void* arg) {
#endif
longSeekOffset=(uint64_t)offset * (uint64_t)fileBlockSize;
- lseek64(fd, longSeekOffset, SEEK_SET);
+ lseek(fd, longSeekOffset, SEEK_SET);
totalRqst++;
dlen = (fr->BlocksRequested() > extentSize ? extentSize : fr->BlocksRequested());
sz=0;
diff --git a/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp b/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp
index e2e9b3a9..3bb30fd1 100644
--- a/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp
+++ b/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp
@@ -192,7 +192,7 @@ int SMComm::stat(const string& filename, struct stat* statbuf)
common_exit(command, response, err);
}
-int SMComm::truncate(const string& filename, const off64_t length)
+int SMComm::truncate(const string& filename, const off_t length)
{
ByteStream* command = buffers.getByteStream();
ByteStream* response = buffers.getByteStream();
diff --git a/storage/columnstore/columnstore/utils/cloudio/SMComm.h b/storage/columnstore/columnstore/utils/cloudio/SMComm.h
index bb46304b..51edc0be 100644
--- a/storage/columnstore/columnstore/utils/cloudio/SMComm.h
+++ b/storage/columnstore/columnstore/utils/cloudio/SMComm.h
@@ -50,7 +50,7 @@ class SMComm : public boost::noncopyable
// added this one because it should be trivial to implement in SM, and prevents a large
// operation in SMDataFile.
- int truncate(const std::string& filename, const off64_t length);
+ int truncate(const std::string& filename, const off_t length);
int listDirectory(const std::string& path, std::list<std::string>* entries);
diff --git a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp
index 84eab1ac..0d827c16 100644
--- a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp
+++ b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp
@@ -38,7 +38,7 @@ SMDataFile::SMDataFile(const char* name, int _openmode, const struct stat& _stat
comm = SMComm::get();
}
-ssize_t SMDataFile::pread(void* buf, off64_t offset, size_t count)
+ssize_t SMDataFile::pread(void* buf, off_t offset, size_t count)
{
return comm->pread(name(), buf, count, offset);
}
@@ -63,7 +63,7 @@ ssize_t SMDataFile::write(const void* buf, size_t count)
return ret;
}
-int SMDataFile::seek(off64_t offset, int whence)
+int SMDataFile::seek(off_t offset, int whence)
{
switch (whence)
{
@@ -83,18 +83,18 @@ int SMDataFile::seek(off64_t offset, int whence)
return 0;
}
-int SMDataFile::truncate(off64_t length)
+int SMDataFile::truncate(off_t length)
{
return comm->truncate(name(), length);
}
-int SMDataFile::fallocate(int mode, off64_t offset, off64_t length)
+int SMDataFile::fallocate(int mode, off_t offset, off_t length)
{
idbassert_s(mode == 0, "SMDataFile::fallocate() does not support mode != 0 right now.");
return comm->truncate(name(), offset + length);
}
-off64_t SMDataFile::size()
+off_t SMDataFile::size()
{
struct stat _stat;
int err = comm->stat(name(), &_stat);
@@ -104,7 +104,7 @@ off64_t SMDataFile::size()
return _stat.st_size;
}
-off64_t SMDataFile::tell()
+off_t SMDataFile::tell()
{
return position;
}
diff --git a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h
index 1d77edd6..6bd9b20f 100644
--- a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h
+++ b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h
@@ -30,14 +30,14 @@ class SMDataFile : public IDBDataFile
public:
virtual ~SMDataFile();
- ssize_t pread(void* ptr, off64_t offset, size_t count);
+ ssize_t pread(void* ptr, off_t offset, size_t count);
ssize_t read(void* ptr, size_t count);
ssize_t write(const void* ptr, size_t count);
- int seek(off64_t offset, int whence);
- int truncate(off64_t length);
- int fallocate(int mode, off64_t offset, off64_t length);
- off64_t size();
- off64_t tell();
+ int seek(off_t offset, int whence);
+ int truncate(off_t length);
+ int fallocate(int mode, off_t offset, off_t length);
+ off_t size();
+ off_t tell();
int flush();
time_t mtime();
int close();
@@ -48,7 +48,7 @@ class SMDataFile : public IDBDataFile
private:
SMDataFile();
SMDataFile(const char* fname, int openmode, const struct stat&);
- off64_t position;
+ off_t position;
int openmode;
SMComm* comm;
diff --git a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp
index 96fe25d3..c15653ad 100644
--- a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp
+++ b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp
@@ -38,7 +38,7 @@ int SMFileSystem::mkdir(const char* path)
return 0;
}
-off64_t SMFileSystem::size(const char* filename) const
+off_t SMFileSystem::size(const char* filename) const
{
struct stat _stat;
@@ -50,7 +50,7 @@ off64_t SMFileSystem::size(const char* filename) const
return _stat.st_size;
}
-off64_t SMFileSystem::compressedSize(const char* filename) const
+off_t SMFileSystem::compressedSize(const char* filename) const
{
// Yikes, punting on this one.
throw NotImplementedYet(__func__);
diff --git a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h
index 0e60f533..bace23fb 100644
--- a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h
+++ b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h
@@ -33,8 +33,8 @@ class SMFileSystem : public IDBFileSystem, boost::noncopyable
// why are some of these const and some not const in IDBFileSystem?
int mkdir(const char* pathname);
- off64_t size(const char* path) const;
- off64_t compressedSize(const char* path) const;
+ off_t size(const char* path) const;
+ off_t compressedSize(const char* path) const;
int remove(const char* pathname);
int rename(const char* oldpath, const char* newpath);
bool exists(const char* pathname) const;
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp
index 6d7c5834..cb3f2510 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp
+++ b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp
@@ -61,7 +61,7 @@ BufferedFile::~BufferedFile()
delete[] m_buffer;
}
-ssize_t BufferedFile::pread(void* ptr, off64_t offset, size_t count)
+ssize_t BufferedFile::pread(void* ptr, off_t offset, size_t count)
{
ssize_t ret = 0;
int savedErrno;
@@ -116,7 +116,7 @@ ssize_t BufferedFile::read(void* ptr, size_t count)
ssize_t BufferedFile::write(const void* ptr, size_t count)
{
ssize_t ret = 0;
- off64_t offset = tell();
+ off_t offset = tell();
int savedErrno = 0;
size_t progress = 0;
uint8_t* ptr8 = (uint8_t*)ptr;
@@ -144,7 +144,7 @@ ssize_t BufferedFile::write(const void* ptr, size_t count)
return progress;
}
-int BufferedFile::seek(off64_t offset, int whence)
+int BufferedFile::seek(off_t offset, int whence)
{
int ret = 0;
int savedErrno;
@@ -158,7 +158,7 @@ int BufferedFile::seek(off64_t offset, int whence)
return ret;
}
-int BufferedFile::truncate(off64_t length)
+int BufferedFile::truncate(off_t length)
{
int ret = 0;
int savedErrno;
@@ -173,11 +173,11 @@ int BufferedFile::truncate(off64_t length)
return ret;
}
-off64_t BufferedFile::size()
+off_t BufferedFile::size()
{
// going to calculate size 2 ways - first, via seek
- off64_t length = -1;
- off64_t here;
+ off_t length = -1;
+ off_t here;
flockfile(m_fp);
@@ -202,7 +202,7 @@ off64_t BufferedFile::size()
#endif
}
-off64_t BufferedFile::tell()
+off_t BufferedFile::tell()
{
#ifdef _MSC_VER
return _ftelli64(m_fp);
@@ -256,7 +256,7 @@ int BufferedFile::close()
@see
This one is used in shared/we_fileop.cpp to skip expensive file preallocation.
*/
-int BufferedFile::fallocate(int mode, off64_t offset, off64_t length)
+int BufferedFile::fallocate(int mode, off_t offset, off_t length)
{
int ret = 0;
int savedErrno = 0;
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h
index 09646b44..ba688a10 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h
+++ b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h
@@ -40,16 +40,16 @@ class BufferedFile : public IDBDataFile, boost::noncopyable
BufferedFile(const char* fname, const char* mode, unsigned opts);
/* virtual */ ~BufferedFile();
- /* virtual */ ssize_t pread(void* ptr, off64_t offset, size_t count);
+ /* virtual */ ssize_t pread(void* ptr, off_t offset, size_t count);
/* virtual */ ssize_t read(void* ptr, size_t count);
/* virtual */ ssize_t write(const void* ptr, size_t count);
- /* virtual */ int seek(off64_t offset, int whence);
- /* virtual */ int truncate(off64_t length);
- /* virtual */ off64_t size();
- /* virtual */ off64_t tell();
+ /* virtual */ int seek(off_t offset, int whence);
+ /* virtual */ int truncate(off_t length);
+ /* virtual */ off_t size();
+ /* virtual */ off_t tell();
/* virtual */ int flush();
/* virtual */ time_t mtime();
- /* virtual */ int fallocate(int mode, off64_t offset, off64_t length);
+ /* virtual */ int fallocate(int mode, off_t offset, off_t length);
protected:
/* virtual */
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h
index 1747189e..739e7717 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h
+++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h
@@ -124,7 +124,7 @@ class IDBDataFile
* or fseek followed by read for C-library FILE*. Return value
* is the number of bytes read.
*/
- virtual ssize_t pread(void* ptr, off64_t offset, size_t count) = 0;
+ virtual ssize_t pread(void* ptr, off_t offset, size_t count) = 0;
/**
* This is a read method similar to kernel style read or C library
@@ -148,7 +148,7 @@ class IDBDataFile
* operation - ex. HDFS will not support it for files opened for writing
* Returns 0 on success, -1 on error
*/
- virtual int seek(off64_t offset, int whence) = 0;
+ virtual int seek(off_t offset, int whence) = 0;
/**
* The truncate() method is equivalent to the ftruncate method. Note
@@ -156,7 +156,7 @@ class IDBDataFile
* or write or append do not, but HDFS files opened for modification do.
* Returns 0 on success, -1 on error.
*/
- virtual int truncate(off64_t length) = 0;
+ virtual int truncate(off_t length) = 0;
/**
* The size() method returns the size of the file in a manner consistent
@@ -166,14 +166,14 @@ class IDBDataFile
* external view of size may differ (ex. if writing buffered i/o before
* a flush/sync or if writing an open HDFS file). Returns -1 on error.
*/
- virtual off64_t size() = 0;
+ virtual off_t size() = 0;
/**
* The tell() call returns the current offset in the file. This is
* similar to lseek with 0 offset in the standard library and ftell
* for buffered FILE *s.
*/
- virtual off64_t tell() = 0;
+ virtual off_t tell() = 0;
/**
* The flush() method instructs the file to write any buffered contents
@@ -194,7 +194,7 @@ class IDBDataFile
* only.
* Returns -1 on error.
*/
- virtual int fallocate(int mode, off64_t offset, off64_t length) = 0;
+ virtual int fallocate(int mode, off_t offset, off_t length) = 0;
int colWidth()
{
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h
index 4ca4a285..54e58540 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h
+++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h
@@ -82,14 +82,14 @@ class IDBFileSystem
* size() returns the size of the file specified by path.
* Returns the size on success, -1 on error
*/
- virtual off64_t size(const char* path) const = 0;
+ virtual off_t size(const char* path) const = 0;
/**
* compressedSize() returns the decompressed size of the file
* speicified by path.
* Returns the size on success, -1 on error
*/
- virtual off64_t compressedSize(const char* path) const = 0;
+ virtual off_t compressedSize(const char* path) const = 0;
/**
* exists() checks for the existence of a particular path.
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp
index 37d4cb3c..8111d00c 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp
+++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp
@@ -117,14 +117,14 @@ void IDBLogger::logRW(const char* op, const std::string& fname, const IDBDataFil
writeLog(logmsg.str());
}
-void IDBLogger::logSeek(const std::string& fname, const IDBDataFile* ptr, off64_t offset, int whence, int ret)
+void IDBLogger::logSeek(const std::string& fname, const IDBDataFile* ptr, off_t offset, int whence, int ret)
{
ostringstream logmsg;
logmsg << fname << "," << ptr << ",seek," << offset << "," << whence << "," << ret;
writeLog(logmsg.str());
}
-void IDBLogger::logTruncate(const std::string& fname, const IDBDataFile* ptr, off64_t length, int ret)
+void IDBLogger::logTruncate(const std::string& fname, const IDBDataFile* ptr, off_t length, int ret)
{
ostringstream logmsg;
logmsg << fname << "," << ptr << ",truncate," << length << ",," << ret;
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h
index b200c914..c4d6d0a5 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h
+++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h
@@ -36,8 +36,8 @@ class IDBLogger
static void logNoArg(const std::string& fname, const IDBDataFile* ptr, const char* op, int ret);
static void logRW(const char* op, const std::string& fname, const IDBDataFile* ptr, size_t offset,
size_t count, size_t bytesRead);
- static void logSeek(const std::string& fname, const IDBDataFile* ptr, off64_t offset, int whence, int ret);
- static void logTruncate(const std::string& fname, const IDBDataFile* ptr, off64_t length, int ret);
+ static void logSeek(const std::string& fname, const IDBDataFile* ptr, off_t offset, int whence, int ret);
+ static void logTruncate(const std::string& fname, const IDBDataFile* ptr, off_t length, int ret);
static void logSize(const std::string& fname, const IDBDataFile* ptr, long long ret);
static void logFSop(IDBFileSystem::Types type, const char* op, const char* pathname,
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h
index 117f1e8d..d53fbfa0 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h
+++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h
@@ -125,8 +125,8 @@ class IDBPolicy
* please see IDBFileSystem.h.
*/
static int mkdir(const char* pathname);
- static off64_t size(const char* path);
- static off64_t compressedSize(const char* path);
+ static off_t size(const char* path);
+ static off_t compressedSize(const char* path);
static int remove(const char* pathname);
static int rename(const char* oldpath, const char* newpath);
static bool exists(const char* pathname);
@@ -194,12 +194,12 @@ inline int IDBPolicy::mkdir(const char* pathname)
return IDBPolicy::getFs(pathname).mkdir(pathname);
}
-inline off64_t IDBPolicy::size(const char* path)
+inline off_t IDBPolicy::size(const char* path)
{
return IDBPolicy::getFs(path).size(path);
}
-inline off64_t IDBPolicy::compressedSize(const char* path)
+inline off_t IDBPolicy::compressedSize(const char* path)
{
return IDBPolicy::getFs(path).compressedSize(path);
}
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp
index bd3e1c4b..6c9d04a5 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp
+++ b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp
@@ -115,13 +115,13 @@ int PosixFileSystem::rename(const char* oldpath, const char* newpath)
return ret;
}
-off64_t PosixFileSystem::size(const char* path) const
+off_t PosixFileSystem::size(const char* path) const
{
// should this use Boost??
struct stat statBuf;
int rc = ::stat(path, &statBuf);
int savedErrno = errno;
- off64_t ret = ((rc == 0) ? statBuf.st_size : -1);
+ off_t ret = ((rc == 0) ? statBuf.st_size : -1);
if (IDBLogger::isEnabled())
IDBLogger::logFSop(POSIX, "fs:size", path, this, ret);
@@ -156,11 +156,11 @@ size_t readFillBuffer(idbdatafile::IDBDataFile* pFile, char* buffer, size_t byte
return totalBytesRead;
}
-off64_t PosixFileSystem::compressedSize(const char* path) const
+off_t PosixFileSystem::compressedSize(const char* path) const
{
IDBDataFile* pFile = NULL;
size_t nBytes;
- off64_t dataSize = 0;
+ off_t dataSize = 0;
try
{
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h
index c1f4e5ff..6e18ca45 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h
+++ b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h
@@ -29,8 +29,8 @@ class PosixFileSystem : public IDBFileSystem
~PosixFileSystem();
int mkdir(const char* pathname) override;
- off64_t size(const char* path) const override;
- off64_t compressedSize(const char* path) const override;
+ off_t size(const char* path) const override;
+ off_t compressedSize(const char* path) const override;
int remove(const char* pathname) override;
int rename(const char* oldpath, const char* newpath) override;
bool exists(const char* pathname) const override;
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp b/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp
index 07a7630b..97dcb97c 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp
+++ b/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp
@@ -62,7 +62,7 @@ UnbufferedFile::~UnbufferedFile()
close();
}
-ssize_t UnbufferedFile::pread(void* ptr, off64_t offset, size_t count)
+ssize_t UnbufferedFile::pread(void* ptr, off_t offset, size_t count)
{
ssize_t ret;
int savedErrno;
@@ -112,7 +112,7 @@ ssize_t UnbufferedFile::write(const void* ptr, size_t count)
return ret;
}
-int UnbufferedFile::seek(off64_t offset, int whence)
+int UnbufferedFile::seek(off_t offset, int whence)
{
int ret;
int savedErrno;
@@ -127,7 +127,7 @@ int UnbufferedFile::seek(off64_t offset, int whence)
return ret;
}
-int UnbufferedFile::truncate(off64_t length)
+int UnbufferedFile::truncate(off_t length)
{
int ret;
int savedErrno;
@@ -142,9 +142,9 @@ int UnbufferedFile::truncate(off64_t length)
return ret;
}
-off64_t UnbufferedFile::size()
+off_t UnbufferedFile::size()
{
- off64_t ret = 0;
+ off_t ret = 0;
int savedErrno;
struct stat statBuf;
@@ -159,9 +159,9 @@ off64_t UnbufferedFile::size()
return ret;
}
-off64_t UnbufferedFile::tell()
+off_t UnbufferedFile::tell()
{
- off64_t ret;
+ off_t ret;
ret = lseek(m_fd, 0, SEEK_CUR);
return ret;
}
@@ -218,7 +218,7 @@ int UnbufferedFile::close()
@see
This one is used in shared/we_fileop.cpp to skip expensive file preallocation.
*/
-int UnbufferedFile::fallocate(int mode, off64_t offset, off64_t length)
+int UnbufferedFile::fallocate(int mode, off_t offset, off_t length)
{
int ret = 0;
int savedErrno = 0;
diff --git a/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp b/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp
index 42b46873..0cef9ebb 100644
--- a/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp
+++ b/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp
@@ -623,9 +623,9 @@ bool TestRunner::truncateTest(IDBDataFile::Types filetype)
blk_num = m_opts.numblocks;
}
- off64_t fsize = m_file->size();
+ off_t fsize = m_file->size();
- if (fsize != (off64_t)(blk_num * BLK_SIZE))
+ if (fsize != (off_t)(blk_num * BLK_SIZE))
{
ostringstream errstr;
errstr << "wrong file size after truncate, " << fsize << " != " << blk_num * BLK_SIZE;
@@ -645,7 +645,7 @@ bool TestRunner::renameTest(IDBDataFile::Types type)
IDBFileSystem& fs = IDBFileSystem::getFs(type);
// get the size before we move for compare purposes.
- off64_t fsize_orig = fs.size(m_fname.c_str());
+ off_t fsize_orig = fs.size(m_fname.c_str());
// choose a path in a different directory that we know already exists
// and make it specific to our thread...
@@ -666,7 +666,7 @@ bool TestRunner::renameTest(IDBDataFile::Types type)
}
// now check if oldpath exists using size method
- off64_t fsize = fs.size(m_fname.c_str());
+ off_t fsize = fs.size(m_fname.c_str());
if (fsize != -1)
{
@@ -712,7 +712,7 @@ bool TestRunner::copyTest(IDBDataFile::Types type)
IDBFileSystem& fs = IDBFileSystem::getFs(type);
// get the size before we copy for compare purposes.
- off64_t fsize_orig = fs.size(m_fname.c_str());
+ off_t fsize_orig = fs.size(m_fname.c_str());
// choose a path in a different directory that we know already exists
// and make it specific to our thread...
@@ -733,7 +733,7 @@ bool TestRunner::copyTest(IDBDataFile::Types type)
}
// now check if newpath exists using size method
- off64_t fsize = fs.size(newpath.c_str());
+ off_t fsize = fs.size(newpath.c_str());
if (fsize != fsize_orig)
{
@@ -1023,9 +1023,9 @@ bool TestRunner::tellTest(IDBDataFile::Types filetype)
return false;
}
- off64_t filepos = m_file->tell();
+ off_t filepos = m_file->tell();
- if (filepos != off64_t(BLK_SIZE))
+ if (filepos != off_t(BLK_SIZE))
{
ostringstream errstr;
errstr << "tellTest: File position not at correct block, " << filepos << " != " << BLK_SIZE;
diff --git a/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp b/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp
index 9678501c..4bb33049 100644
--- a/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp
+++ b/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp
@@ -393,7 +393,7 @@ int ColumnBufferCompressed::compressAndFlush(bool bFinishingFile)
Stats::startParseEvent(WE_STATS_WRITE_COL);
#endif
- off64_t fileOffset = fFile->tell();
+ off_t fileOffset = fFile->tell();
size_t nitems = fFile->write(compressedOutBuf, outputLen) / outputLen;
if (nitems != 1)
diff --git a/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp b/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp
index 3f89c28a..57f74352 100644
--- a/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp
+++ b/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp
@@ -955,7 +955,7 @@ int ColumnInfo::expandAbbrevExtent(bool bRetainFilePos)
{
if (fLoadingAbbreviatedExtent)
{
- off64_t oldOffset = 0;
+ off_t oldOffset = 0;
if (bRetainFilePos)
{
diff --git a/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp b/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp
index 0a4f5e90..c7eb5fe6 100644
--- a/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp
+++ b/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp
@@ -318,7 +318,7 @@ int Dctnry::expandDctnryExtent()
{
RETURN_ON_NULL(m_dFile, ERR_FILE_SEEK);
- off64_t oldOffset = m_dFile->tell();
+ off_t oldOffset = m_dFile->tell();
RETURN_ON_ERROR(setFileOffset(m_dFile, 0, SEEK_END));
diff --git a/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp b/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp
index 194b260e..4f9ce81b 100644
--- a/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp
+++ b/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp
@@ -93,9 +93,9 @@ size_t readFillBuffer(idbdatafile::IDBDataFile* pFile, char* buffer, size_t byte
return totalBytesRead;
}
-static off64_t getCompressedDataSize(string& fileName)
+static off_t getCompressedDataSize(string& fileName)
{
- off64_t dataSize = 0;
+ off_t dataSize = 0;
IDBDataFile* pFile = 0;
size_t nBytes;
// Some IDBPolicy functions can throw exceptions, caller will catch it
@@ -198,7 +198,7 @@ struct ColumnThread
char fileName[200];
(void)fileOp.getFileName(fOid, fileName, rootList[i], entries[0].partitionNum, entries[0].segmentNum);
string aFile(fileName); // convert between char* and string
- off64_t fileSize = 0;
+ off_t fileSize = 0;
if (fReportRealUse && (fCompressionType > 0))
{
diff --git a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp
index b34535c7..474a44a8 100644
--- a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp
+++ b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp
@@ -1183,7 +1183,7 @@ int ChunkManager::openFile(CompFileData* fileData, const char* mode, int colWidt
// (ex __LINE__); this is used for logging error messages. Likewise, filename
// is used for logging any error message.
//------------------------------------------------------------------------------
-int ChunkManager::setFileOffset(IDBDataFile* pFile, const string& fileName, off64_t offset, int ln) const
+int ChunkManager::setFileOffset(IDBDataFile* pFile, const string& fileName, off_t offset, int ln) const
{
int rc = NO_ERROR;
diff --git a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h
index 30a9862f..bc22a451 100644
--- a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h
+++ b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h
@@ -309,7 +309,7 @@ class ChunkManager
int openFile(CompFileData* fileData, const char* mode, int colWidth, bool useTmpSuffix, int ln) const;
// @brief set offset in a compressed DB file from beginning.
- int setFileOffset(IDBDataFile* pFile, const std::string& fileName, off64_t offset, int ln) const;
+ int setFileOffset(IDBDataFile* pFile, const std::string& fileName, off_t offset, int ln) const;
// @brief read from a compressed DB file.
int readFile(IDBDataFile* pFile, const std::string& fileName, void* buf, size_t size, int ln) const;
diff --git a/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp b/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp
index 1db08a92..2c783325 100644
--- a/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp
+++ b/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp
@@ -1310,7 +1310,7 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t
getLogger()->logMsg(oss.str(), MSGLVL_INFO2);
}
- off64_t endHdrsOffset = pFile->tell();
+ off_t endHdrsOffset = pFile->tell();
rc = expandAbbrevColumnExtent(pFile, dbRoot, emptyVal, colWidth, colDataType);
if (rc != NO_ERROR)
@@ -1374,7 +1374,7 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t
std::endl << std::endl;
#endif
- off64_t endOffset = 0;
+ off_t endOffset = 0;
// Fill in or add necessary remaining empty chunks
if (numChunksToFill > 0)
@@ -1416,7 +1416,7 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t
// Position file to write empty chunks; default to end of headers
// in case there are no chunks listed in the header
- off64_t startOffset = pFile->tell();
+ off_t startOffset = pFile->tell();
if (chunkPtrs.size() > 0)
{
diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp
index 3298a833..ec256a2a 100644
--- a/storage/connect/filamfix.cpp
+++ b/storage/connect/filamfix.cpp
@@ -695,7 +695,7 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org)
return true;
} // endif
#else // !_WIN32
- if (lseek64(h, pos, org) < 0) {
+ if (lseek(h, pos, org) < 0) {
snprintf(g->Message, sizeof(g->Message), "lseek64: %s", strerror(errno));
printf("%s\n", g->Message);
return true;
@@ -1022,7 +1022,7 @@ int BGXFAM::Cardinality(PGLOBAL g)
#else // UNIX
if (Hfile == INVALID_HANDLE_VALUE) {
- int h = open64(filename, O_RDONLY, 0);
+ int h = open(filename, O_RDONLY, 0);
if (trace(1))
htrc(" h=%d\n", h);
@@ -1041,13 +1041,13 @@ int BGXFAM::Cardinality(PGLOBAL g)
} // endif h
// Get the size of the file (can be greater than 4 GB)
- fsize = lseek64(h, 0, SEEK_END);
+ fsize = lseek(h, 0, SEEK_END);
close(h);
} else {
- BIGINT curpos = lseek64(Hfile, 0, SEEK_CUR);
+ BIGINT curpos = lseek(Hfile, 0, SEEK_CUR);
- fsize = lseek64(Hfile, 0, SEEK_END);
- lseek64(Hfile, curpos, SEEK_SET);
+ fsize = lseek(Hfile, 0, SEEK_END);
+ lseek(Hfile, curpos, SEEK_SET);
} // endif Hfile
if (fsize < 0) {
@@ -1357,7 +1357,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc)
return RC_FX;
} // endif error
#else // !_WIN32
- if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) {
+ if (ftruncate(Hfile, (BIGINT)(Tpos * Lrecl))) {
snprintf(g->Message, sizeof(g->Message), MSG(TRUNCATE_ERROR), strerror(errno));
return RC_FX;
} // endif
@@ -1402,7 +1402,7 @@ bool BGXFAM::OpenTempFile(PGLOBAL g)
return true;
} // endif Tfile
#else // UNIX
- Tfile = open64(tempname, O_WRONLY | O_TRUNC, S_IWRITE);
+ Tfile = open(tempname, O_WRONLY | O_TRUNC, S_IWRITE);
if (Tfile == INVALID_HANDLE_VALUE) {
int rc = errno;
@@ -1531,7 +1531,7 @@ void BGXFAM::Rewind(void)
#if defined(_WIN32) //OB
SetFilePointer(Hfile, 0, NULL, FILE_BEGIN);
#else // UNIX
- lseek64(Hfile, 0, SEEK_SET);
+ lseek(Hfile, 0, SEEK_SET);
#endif // UNIX
#endif // 0
CurBlk = -1;
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index 184df646..f462060a 100644
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
@@ -3084,7 +3084,7 @@ bool BGVFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b)
return true;
} // endif
#else // !_WIN32
- if (lseek64(h, pos, (b) ? SEEK_END : SEEK_SET) < 0) {
+ if (lseek(h, pos, (b) ? SEEK_END : SEEK_SET) < 0) {
snprintf(g->Message, sizeof(g->Message), MSG(ERROR_IN_LSK), errno);
return true;
} // endif
@@ -3238,7 +3238,7 @@ int BGVFAM::GetBlockInfo(PGLOBAL g)
if (h == INVALID_HANDLE_VALUE || !len.QuadPart) {
#else // !_WIN32
- h = open64(filename, O_RDONLY, 0);
+ h = open(filename, O_RDONLY, 0);
if (h == INVALID_HANDLE_VALUE || !_filelength(h)) {
#endif // !_WIN32
@@ -3314,7 +3314,7 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g)
#else // !_WIN32
int oflag = (b) ? O_RDWR : O_RDWR | O_TRUNC;
- h = open64(filename, oflag, 0);
+ h = open(filename, oflag, 0);
#endif // !_WIN32
if (h == INVALID_HANDLE_VALUE) {
@@ -3409,7 +3409,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
int h;
BIGINT pos;
- h= open64(filename, O_CREAT | O_WRONLY, S_IREAD | S_IWRITE);
+ h= open(filename, O_CREAT | O_WRONLY, S_IREAD | S_IWRITE);
if (h == -1)
return true;
@@ -3420,7 +3420,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
htrc("MEF: pos=%lld n=%d maxblk=%d blksize=%d\n",
pos, n, MaxBlk, Blksize);
- if (lseek64(h, pos, SEEK_SET) < 0)
+ if (lseek(h, pos, SEEK_SET) < 0)
goto err;
// This actually fills the empty file
@@ -3619,7 +3619,7 @@ bool BGVFAM::OpenTableFile(PGLOBAL g)
return true;
} // endswitch
- Hfile = open64(filename, oflag, pmd); // Enable file size > 2G
+ Hfile = open(filename, oflag, pmd); // Enable file size > 2G
if (Hfile == INVALID_HANDLE_VALUE) {
rc = errno;
@@ -3933,7 +3933,7 @@ int BGVFAM::DeleteRecords(PGLOBAL g, int irc)
return RC_FX;
} // endif error
#else // !_WIN32
- if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) {
+ if (ftruncate(Hfile, (BIGINT)(Tpos * Lrecl))) {
snprintf(g->Message, sizeof(g->Message), MSG(TRUNCATE_ERROR), strerror(errno));
return RC_FX;
} // endif
@@ -3993,7 +3993,7 @@ bool BGVFAM::OpenTempFile(PGLOBAL g)
#else // UNIX
int oflag = (MaxBlk) ? O_WRONLY : O_WRONLY | O_TRUNC;
- Tfile = open64(tempname, oflag, S_IWRITE);
+ Tfile = open(tempname, oflag, S_IWRITE);
if (Tfile == INVALID_HANDLE_VALUE) {
int rc = errno;
@@ -4250,7 +4250,7 @@ void BGVFAM::Rewind(void)
#if defined(_WIN32) //OB
SetFilePointer(Hfile, 0, NULL, FILE_BEGIN);
#else // UNIX
- lseek64(Hfile, 0, SEEK_SET);
+ lseek(Hfile, 0, SEEK_SET);
#endif // UNIX
#endif // 0
} // end of Rewind
diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp
index 4bcbbfd4..1144f89a 100644
--- a/storage/connect/xindex.cpp
+++ b/storage/connect/xindex.cpp
@@ -2652,7 +2652,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
/*******************************************************************/
/* Position the cursor at end of file so ftell returns file size. */
/*******************************************************************/
- if (!(NewOff.Val = (longlong)lseek64(Hfile, 0LL, SEEK_END))) {
+ if (!(NewOff.Val = (longlong)lseek(Hfile, 0LL, SEEK_END))) {
snprintf(g->Message, sizeof(g->Message), MSG(FUNC_ERRNO), errno, "Seek");
return true;
} // endif
@@ -2681,7 +2681,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
htrc("noff[%d]=%lld\n", id, noff[id].Val);
// Position the cursor at the offset of this index
- if (lseek64(Hfile, noff[id].Val, SEEK_SET) < 0) {
+ if (lseek(Hfile, noff[id].Val, SEEK_SET) < 0) {
snprintf(g->Message, sizeof(g->Message), "(XHUGE)lseek64: %s (%lld)", strerror(errno), noff[id].Val);
printf("%s\n", g->Message);
// snprintf(g->Message, sizeof(g->Message), MSG(FUNC_ERRNO), errno, "Hseek");
@@ -2709,10 +2709,10 @@ bool XHUGE::Seek(PGLOBAL g, int low, int high, int origin)
} // endif
#else // UNIX
- off64_t pos = (off64_t)low
- + (off64_t)high * ((off64_t)0x100 * (off64_t)0x1000000);
+ off_t pos = (off_t)low
+ + (off_t)high * ((off_t)0x100 * (off_t)0x1000000);
- if (lseek64(Hfile, pos, origin) < 0) {
+ if (lseek(Hfile, pos, origin) < 0) {
snprintf(g->Message, sizeof(g->Message), MSG(ERROR_IN_LSK), errno);
if (trace(1))
@@ -2841,7 +2841,7 @@ void XHUGE::Close(char *fn, int id)
#else // !_WIN32
if (id >= 0 && fn) {
if (Hfile != INVALID_HANDLE_VALUE) {
- if (lseek64(Hfile, id * sizeof(IOFF), SEEK_SET) >= 0) {
+ if (lseek(Hfile, id * sizeof(IOFF), SEEK_SET) >= 0) {
ssize_t nbw = write(Hfile, &NewOff, sizeof(IOFF));
if (nbw != (signed)sizeof(IOFF))