| 1 | Author: Holger Jaekel <[email protected]>
|
| 2 | Summary: the *64 apis are useless as musl is always 64-bit for them
|
| 3 | ----
|
| 4 |
|
| 5 | |
| 6 | |
| 7 | @@ -578,10 +578,10 @@
|
| 8 | CloseHandle(hFile);
|
| 9 | }
|
| 10 | #else // _WIN32
|
| 11 | - struct stat64 info;
|
| 12 | + struct stat info;
|
| 13 |
|
| 14 | - // check if lstat64 succeeded
|
| 15 | - if(lstat64(path.c_str(), &info) == 0)
|
| 16 | + // check if lstat succeeded
|
| 17 | + if(lstat(path.c_str(), &info) == 0)
|
| 18 | {
|
| 19 | resolved.resize(info.st_size);
|
| 20 | if(readlink(path.c_str(), (char*)resolved.data(), resolved.size()) > 0)
|
| 21 | @@ -658,9 +658,9 @@
|
| 22 | if(pathExistsIndex.find(_path) == pathExistsIndex.cend())
|
| 23 | {
|
| 24 | const std::string path = getGenericPath(_path);
|
| 25 | - struct stat64 info;
|
| 26 | - // check if stat64 succeeded
|
| 27 | - pathExistsIndex[_path] = (stat64(path.c_str(), &info) == 0);
|
| 28 | + struct stat info;
|
| 29 | + // check if stat succeeded
|
| 30 | + pathExistsIndex[_path] = (stat(path.c_str(), &info) == 0);
|
| 31 | }
|
| 32 |
|
| 33 | return pathExistsIndex.at(_path);
|
| 34 | @@ -686,10 +686,10 @@
|
| 35 | bool isRegularFile(const std::string& _path)
|
| 36 | {
|
| 37 | const std::string path = getGenericPath(_path);
|
| 38 | - struct stat64 info;
|
| 39 | + struct stat info;
|
| 40 |
|
| 41 | - // check if stat64 succeeded
|
| 42 | - if(stat64(path.c_str(), &info) != 0)
|
| 43 | + // check if stat succeeded
|
| 44 | + if(stat(path.c_str(), &info) != 0)
|
| 45 | return false;
|
| 46 |
|
| 47 | // check for S_IFREG attribute
|
| 48 | @@ -702,10 +702,10 @@
|
| 49 | bool isDirectory(const std::string& _path)
|
| 50 | {
|
| 51 | const std::string path = getGenericPath(_path);
|
| 52 | - struct stat64 info;
|
| 53 | + struct stat info;
|
| 54 |
|
| 55 | - // check if stat64 succeeded
|
| 56 | - if(stat64(path.c_str(), &info) != 0)
|
| 57 | + // check if stat succeeded
|
| 58 | + if(stat(path.c_str(), &info) != 0)
|
| 59 | return false;
|
| 60 |
|
| 61 | // check for S_IFDIR attribute
|
| 62 | @@ -725,10 +725,10 @@
|
| 63 | if((Attributes != INVALID_FILE_ATTRIBUTES) && (Attributes & FILE_ATTRIBUTE_REPARSE_POINT))
|
| 64 | return true;
|
| 65 | #else // _WIN32
|
| 66 | - struct stat64 info;
|
| 67 | + struct stat info;
|
| 68 |
|
| 69 | - // check if lstat64 succeeded
|
| 70 | - if(lstat64(path.c_str(), &info) != 0)
|
| 71 | + // check if lstat succeeded
|
| 72 | + if(lstat(path.c_str(), &info) != 0)
|
| 73 | return false;
|
| 74 |
|
| 75 | // check for S_IFLNK attribute
|
| 76 | @@ -772,10 +772,10 @@
|
| 77 | // regular files and executables, but not setuid, setgid, shared text
|
| 78 | const mode_t mask = S_IFREG;
|
| 79 | const mode_t mask_exec = S_IXUSR | S_IXGRP | S_IXOTH;
|
| 80 | - struct stat64 info;
|
| 81 | + struct stat info;
|
| 82 |
|
| 83 | - // check if stat64 succeeded
|
| 84 | - if(stat64(path.c_str(), &info) != 0)
|
| 85 | + // check if stat succeeded
|
| 86 | + if(stat(path.c_str(), &info) != 0)
|
| 87 | return false;
|
| 88 |
|
| 89 | // check for mask attributes
|