mirror of
https://github.com/apple/swift-system
synced 2026-11-25 04:47:55 +00:00
FileOperations: Add Windows implementation for FileDescriptor.resize(to:) (#89)
* FileOperations: Add Windows implementation for FileDescriptor.resize(to:) Replace _chsize with _chsize_s on Windows
This commit is contained in:
1 parent
a552fda216
commit
94fa6bd2ff
2 files changed
+7
-2
No files matched your search
@@ -401,7 +401,6 @@ extension FileDescriptor {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !os(Windows)
|
||||
/*System 1.2.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
|
||||
extension FileDescriptor {
|
||||
/// Truncate or extend the file referenced by this file descriptor.
|
||||
@@ -447,4 +446,3 @@ extension FileDescriptor {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -105,4 +105,11 @@ internal func pwrite(
|
||||
return Int(nNumberOfBytesWritten)
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
internal func ftruncate(
|
||||
_ fd: Int32,
|
||||
_ length: off_t
|
||||
) -> Int32 {
|
||||
_chsize_s(fd, numericCast(length))
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user