           free(buffer)
         }
 #else
-        precondition(_fd >= 0, "Bad file descriptor")
         if length == 0 && !untilEOF {
             // Nothing requested, return empty response
             return NSData.NSDataReadResult(bytes: nil, length: 0, deallocator: nil)

        }
        return UInt64(liPointer.QuadPart)
#else
        precondition(_fd >= 0, "Bad file descriptor")
        return UInt64(lseek(_fd, 0, SEEK_CUR))
#endif
    }

    @discardableResult
    open func seekToEndOfFile() -> UInt64 {
#if os(Windows)
        precondition(_handle != INVALID_HANDLE_VALUE, "invalid file handle")
        var liPointer: LARGE_INTEGER = LARGE_INTEGER(QuadPart: 0)
        if SetFilePointerEx(_handle, LARGE_INTEGER(QuadPart: 0),
                            &liPointer, DWORD(FILE_END)) == FALSE {


    internal func _readDataOfLength(_ length: Int, untilEOF: Bool, options: NSData.ReadingOptions = []) throws -> NSData.NSDataReadResult {
#if os(Windows)

        if length == 0 && !untilEOF {
          // Nothing requested, return empty response
