From f5e4aac51b30df607f4c5fbd1886fabacc424b41 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Sat, 11 Jun 2022 12:54:19 -0700 Subject: [PATCH] Revert "FileOperations: Add Windows implementation for FileDescriptor.resize(to:) (#89)" This reverts commit 94fa6bd2ff28d04b01ae4147c26a111c2a8ba25f. --- Sources/System/FileOperations.swift | 2 ++ Sources/System/Internals/WindowsSyscallAdapters.swift | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Sources/System/FileOperations.swift b/Sources/System/FileOperations.swift index 055daee..a8b107c 100644 --- a/Sources/System/FileOperations.swift +++ b/Sources/System/FileOperations.swift @@ -401,6 +401,7 @@ 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. @@ -446,3 +447,4 @@ extension FileDescriptor { } } } +#endif diff --git a/Sources/System/Internals/WindowsSyscallAdapters.swift b/Sources/System/Internals/WindowsSyscallAdapters.swift index 13f42c9..36acace 100644 --- a/Sources/System/Internals/WindowsSyscallAdapters.swift +++ b/Sources/System/Internals/WindowsSyscallAdapters.swift @@ -105,11 +105,4 @@ internal func pwrite( return Int(nNumberOfBytesWritten) } -@inline(__always) -internal func ftruncate( - _ fd: Int32, - _ length: off_t -) -> Int32 { - _chsize_s(fd, numericCast(length)) -} #endif