Motivation:
When the `BufferedReader` reads short when filling its buffer during a
request for some bytes, it may avoid giving the caller all bytes
available. The bytes remain in the buffer and are available on the next
call but this appears to the caller as if the file has been read
completely as the returned bytes are less than those requested.
Modifications:
- Read the expected bytes or whatever is left in the buffer
- Add a test
Result:
Less unexpected behaviour
Motivation:
There is a bug in `ReadableFileHandleProtocol.bufferedReader(startingAtAbsoluteOffset:capacity:)` where we are hardcoding initial offset to 0 instead of passing the actual param value.
Modifications:
Pass the actual param value.
Motivation:
SwiftNIO doesn't compile for visionOS because NIOFileSystem depends on
Swift System which doesn't yet support visionOS.
As NIOFileSystem isn't yet stable API we can define it out on some
platforms.
Modifications:
- Only define NIOFileSystem on macOS, iOS, tvOS, watchOS, Linux and
Android.
- Only include Swift System on the same platforms
Result:
SwiftNIO compiles on visionOS, albeit without NIOFileSystem.
Use direct syscall for `renameat2` because Musl doesn't include
a wrapper for it. Similarly, define the constants ourselves.
Add Musl imports in relevant places.
Motivation:
I/O is typically blocking, but options for interacting with the
filesystem using `async` APIs are limited. This change adds a new module
to NIO, `NIOFileSystem`. At the moment this is exposed as the
`_NIOFileSystem` product while users get a chance to try it out and
provide feedback.
During this time the API of `NIOFileSystem` is subject to change.
Breaking changes will come in _minor_ NIO releases and additive changes
may come in _patch_ releases of NIO.
Modifications:
- Add `NIOFileSystem`, `NIOFileSystemFoundationCompat`,
`NIOFileSystemTests`, `NIOFileSystemIntegrationTests`, and
`NIOFileSystemFoundationCompatTests`.
- Update docs
- Update CNIOLinux and CNIODarwin shims
Result:
File system can be accessed via `async` APIs