|
|
b2cd752 |
diff -ur root-6.22.00.orig/io/io/src/RRawFileUnix.cxx root-6.22.00/io/io/src/RRawFileUnix.cxx
|
|
|
b2cd752 |
--- root-6.22.00.orig/io/io/src/RRawFileUnix.cxx 2020-06-14 17:51:48.000000000 +0200
|
|
|
b2cd752 |
+++ root-6.22.00/io/io/src/RRawFileUnix.cxx 2020-07-02 09:02:48.202677798 +0200
|
|
|
b2cd752 |
@@ -9,6 +9,8 @@
|
|
|
b2cd752 |
* For the list of contributors see $ROOTSYS/README/CREDITS. *
|
|
|
b2cd752 |
*************************************************************************/
|
|
|
b2cd752 |
|
|
|
b2cd752 |
+#include "ROOT/RConfig.hxx"
|
|
|
b2cd752 |
+
|
|
|
b2cd752 |
#include "ROOT/RRawFileUnix.hxx"
|
|
|
b2cd752 |
#include "ROOT/RMakeUnique.hxx"
|
|
|
b2cd752 |
|
|
|
b2cd752 |
@@ -47,8 +49,13 @@
|
|
|
b2cd752 |
|
|
|
b2cd752 |
std::uint64_t ROOT::Internal::RRawFileUnix::GetSizeImpl()
|
|
|
b2cd752 |
{
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ struct stat64 info;
|
|
|
b2cd752 |
+ int res = fstat64(fFileDes, &info;;
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
struct stat info;
|
|
|
b2cd752 |
int res = fstat(fFileDes, &info;;
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
if (res != 0)
|
|
|
b2cd752 |
throw std::runtime_error("Cannot call fstat on '" + fUrl + "', error: " + std::string(strerror(errno)));
|
|
|
b2cd752 |
return info.st_size;
|
|
|
b2cd752 |
@@ -68,7 +75,11 @@
|
|
|
b2cd752 |
|
|
|
b2cd752 |
void ROOT::Internal::RRawFileUnix::OpenImpl()
|
|
|
b2cd752 |
{
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ fFileDes = open64(GetLocation(fUrl).c_str(), O_RDONLY);
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
fFileDes = open(GetLocation(fUrl).c_str(), O_RDONLY);
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
if (fFileDes < 0) {
|
|
|
b2cd752 |
throw std::runtime_error("Cannot open '" + fUrl + "', error: " + std::string(strerror(errno)));
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
@@ -76,8 +87,13 @@
|
|
|
b2cd752 |
if (fOptions.fBlockSize >= 0)
|
|
|
b2cd752 |
return;
|
|
|
b2cd752 |
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ struct stat64 info;
|
|
|
b2cd752 |
+ int res = fstat64(fFileDes, &info;;
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
struct stat info;
|
|
|
b2cd752 |
int res = fstat(fFileDes, &info;;
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
if (res != 0) {
|
|
|
b2cd752 |
throw std::runtime_error("Cannot call fstat on '" + fUrl + "', error: " + std::string(strerror(errno)));
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
@@ -92,7 +108,11 @@
|
|
|
b2cd752 |
{
|
|
|
b2cd752 |
size_t total_bytes = 0;
|
|
|
b2cd752 |
while (nbytes) {
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ ssize_t res = pread64(fFileDes, buffer, nbytes, offset);
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
ssize_t res = pread(fFileDes, buffer, nbytes, offset);
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
if (res < 0) {
|
|
|
b2cd752 |
if (errno == EINTR)
|
|
|
b2cd752 |
continue;
|
|
|
b2cd752 |
diff -ur root-6.22.00.orig/tree/ntuple/v7/src/RMiniFile.cxx root-6.22.00/tree/ntuple/v7/src/RMiniFile.cxx
|
|
|
b2cd752 |
--- root-6.22.00.orig/tree/ntuple/v7/src/RMiniFile.cxx 2020-06-14 17:51:48.000000000 +0200
|
|
|
b2cd752 |
+++ root-6.22.00/tree/ntuple/v7/src/RMiniFile.cxx 2020-07-02 10:06:55.066204147 +0200
|
|
|
b2cd752 |
@@ -13,6 +13,8 @@
|
|
|
b2cd752 |
* For the list of contributors see $ROOTSYS/README/CREDITS. *
|
|
|
b2cd752 |
*************************************************************************/
|
|
|
b2cd752 |
|
|
|
b2cd752 |
+#include <ROOT/RConfig.hxx>
|
|
|
b2cd752 |
+
|
|
|
b2cd752 |
#include "ROOT/RMiniFile.hxx"
|
|
|
b2cd752 |
|
|
|
b2cd752 |
#include <ROOT/RRawFile.hxx>
|
|
|
b2cd752 |
@@ -999,7 +1001,11 @@
|
|
|
b2cd752 |
R__ASSERT(fFile);
|
|
|
b2cd752 |
size_t retval;
|
|
|
b2cd752 |
if ((offset >= 0) && (static_cast<std::uint64_t>(offset) != fFilePos)) {
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ retval = fseeko64(fFile, offset, SEEK_SET);
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
retval = fseek(fFile, offset, SEEK_SET);
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
R__ASSERT(retval == 0);
|
|
|
b2cd752 |
fFilePos = offset;
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
@@ -1099,7 +1105,11 @@
|
|
|
b2cd752 |
if (idxDirSep != std::string::npos) {
|
|
|
b2cd752 |
fileName.erase(0, idxDirSep + 1);
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ FILE *fileStream = fopen64(std::string(path.data(), path.size()).c_str(), "wb");
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
FILE *fileStream = fopen(std::string(path.data(), path.size()).c_str(), "wb");
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
R__ASSERT(fileStream);
|
|
|
b2cd752 |
|
|
|
b2cd752 |
auto writer = new RNTupleFileWriter(ntupleName);
|
|
|
b2cd752 |
@@ -1319,7 +1329,11 @@
|
|
|
b2cd752 |
fFileSimple.Write(&strEmpty, strEmpty.GetSize());
|
|
|
b2cd752 |
fFileSimple.Write(&fileRoot, fileRoot.GetSize());
|
|
|
b2cd752 |
fFileSimple.fFilePos = tail;
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ auto retval = fseeko64(fFileSimple.fFile, tail, SEEK_SET);
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
auto retval = fseek(fFileSimple.fFile, tail, SEEK_SET);
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
R__ASSERT(retval == 0);
|
|
|
b2cd752 |
fFileSimple.fFilePos = tail;
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
diff -ur root-6.22.00.orig/tree/ntuple/v7/test/ntuple.cxx root-6.22.00/tree/ntuple/v7/test/ntuple.cxx
|
|
|
b2cd752 |
--- root-6.22.00.orig/tree/ntuple/v7/test/ntuple.cxx 2020-06-14 17:51:48.000000000 +0200
|
|
|
b2cd752 |
+++ root-6.22.00/tree/ntuple/v7/test/ntuple.cxx 2020-07-02 10:10:54.409737807 +0200
|
|
|
b2cd752 |
@@ -1,3 +1,5 @@
|
|
|
b2cd752 |
+#include <ROOT/RConfig.hxx>
|
|
|
b2cd752 |
+
|
|
|
b2cd752 |
#include <ROOT/RColumnModel.hxx>
|
|
|
b2cd752 |
#include <ROOT/RDataFrame.hxx>
|
|
|
b2cd752 |
#include <ROOT/RNTuple.hxx>
|
|
|
b2cd752 |
@@ -891,10 +893,17 @@
|
|
|
b2cd752 |
ntuple->Fill();
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
}
|
|
|
b2cd752 |
+#ifdef R__SEEK64
|
|
|
b2cd752 |
+ FILE *file = fopen64(fileGuard.GetPath().c_str(), "rb");
|
|
|
b2cd752 |
+ ASSERT_TRUE(file != nullptr);
|
|
|
b2cd752 |
+ EXPECT_EQ(0, fseeko64(file, 0, SEEK_END));
|
|
|
b2cd752 |
+ EXPECT_GT(ftello64(file), 2048LL * 1024LL * 1024LL);
|
|
|
b2cd752 |
+#else
|
|
|
b2cd752 |
FILE *file = fopen(fileGuard.GetPath().c_str(), "rb");
|
|
|
b2cd752 |
ASSERT_TRUE(file != nullptr);
|
|
|
b2cd752 |
EXPECT_EQ(0, fseek(file, 0, SEEK_END));
|
|
|
b2cd752 |
EXPECT_GT(ftell(file), 2048LL * 1024LL * 1024LL);
|
|
|
b2cd752 |
+#endif
|
|
|
b2cd752 |
fclose(file);
|
|
|
b2cd752 |
|
|
|
b2cd752 |
auto ntuple = RNTupleReader::Open("myNTuple", fileGuard.GetPath());
|