| 1041 | int FileDescriptor::Detach() { return fd_.exchange(-1); } |
| 1042 | |
| 1043 | static Result<int64_t> lseek64_compat(int fd, int64_t pos, int whence) { |
| 1044 | #if defined(_WIN32) |
| 1045 | int64_t ret = _lseeki64(fd, pos, whence); |
| 1046 | #else |
| 1047 | int64_t ret = lseek(fd, pos, whence); |
| 1048 | #endif |
| 1049 | if (ret == -1) { |
| 1050 | return Status::IOError("lseek failed"); |
| 1051 | } |
| 1052 | return ret; |
| 1053 | } |
| 1054 | |
| 1055 | Result<FileDescriptor> FileOpenReadable(const PlatformFilename& file_name) { |
| 1056 | FileDescriptor fd; |
no test coverage detected