Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for off_t (0.14 sec)

  1. tensorflow/c/experimental/filesystem/plugins/posix/copy_file_linux.cc

    namespace tf_posix_filesystem {
    
    // Transfers up to `size` bytes from `dst_fd` to `src_fd`.
    //
    // This method uses `sendfile` specific to linux after 2.6.33.
    int CopyFileContents(int dst_fd, int src_fd, off_t size) {
      off_t offset = 0;
      int bytes_transferred = 0;
      int rc = 1;
      // When `sendfile` returns 0 we stop copying and let callers handle this.
      while (offset < size && rc > 0) {
        // Use uint64 for safe compare SSIZE_MAX
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Nov 22 21:23:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  2. tensorflow/c/experimental/filesystem/plugins/posix/copy_file_portable.cc

    //
    // This method uses a temporary buffer to hold contents.
    int CopyFileContents(int dst_fd, int src_fd, off_t size) {
      // Use a copy buffer of 128KB but don't store it on the stack.
      constexpr static size_t kPosixCopyFileBufferSize = 128 * 1024;
      std::unique_ptr<char[]> buffer(new char[kPosixCopyFileBufferSize]);
    
      off_t offset = 0;
      int bytes_transferred = 0;
      int rc = 1;
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Nov 22 21:23:55 GMT 2019
    - 1.9K bytes
    - Viewed (0)
  3. tensorflow/c/experimental/filesystem/plugins/posix/copy_file.h

    //
    // This method uses `sendfile` if available (i.e., linux 2.6.33 or later) or an
    // intermediate buffer if not.
    //
    // Returns number of bytes transferred or -1 on failure.
    int CopyFileContents(int dst_fd, int src_fd, off_t size);
    
    }  // namespace tf_posix_filesystem
    
    C
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Nov 22 21:23:55 GMT 2019
    - 1.2K bytes
    - Viewed (0)
  4. tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem_helper.h

    // `mode`. The later is only used if `dst` needs to be created.
    int TransferFileContents(const char* src, const char* dst, mode_t mode,
                             off_t size);
    
    // Returns true only if `entry` points to an entry other than `.` or `..`.
    //
    // This is a filter for `scandir`.
    int RemoveSpecialDirectoryEntries(const struct dirent* entry);
    
    C
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Nov 22 21:23:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  5. tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem_helper.cc

    #include <unistd.h>
    
    #include "tensorflow/c/experimental/filesystem/plugins/posix/copy_file.h"
    
    namespace tf_posix_filesystem {
    
    int TransferFileContents(const char* src, const char* dst, mode_t mode,
                             off_t size) {
      int src_fd = open(src, O_RDONLY);
      if (src_fd < 0) return -1;
    
      // When creating file, use the same permissions as original
      mode_t open_mode = mode & (S_IRWXU | S_IRWXG | S_IRWXO);
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Jan 16 05:36:52 GMT 2020
    - 2.1K bytes
    - Viewed (1)
  6. tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem.cc

        // cross-platform, return type of `Read` is `int64_t`.
        int64_t r = int64_t{pread(posix_file->fd, dst, requested_read_length,
                                  static_cast<off_t>(offset))};
        if (r > 0) {
          dst += r;
          offset += static_cast<uint64_t>(r);
          n -= r;  // safe as 0 < r <= n so n will never underflow
          read += r;
        } else if (r == 0) {
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Sun Mar 24 20:08:23 GMT 2024
    - 15.8K bytes
    - Viewed (0)
Back to top