21 Commits
Author SHA1 Message Date
Karoy Lorentey f5e4aac51b Revert "FileOperations: Add Windows implementation for FileDescriptor.resize(to:) (#89)"
This reverts commit 94fa6bd2ff.
2022-06-11 12:54:19 -07:00
Si Beaumont 94fa6bd2ff FileOperations: Add Windows implementation for FileDescriptor.resize(to:) (#89)
* FileOperations: Add Windows implementation for FileDescriptor.resize(to:)

Replace _chsize with _chsize_s on Windows
2022-06-09 09:51:28 -06:00
Alsey Coleman Miller a552fda216 Import C module as @_implementationOnly (#83) 2022-06-08 19:54:55 -06:00
Karoy Lorentey 147ebc053a Unbreak the Windows port 2022-05-21 12:43:59 -07:00
Si Beaumont 7fab65f340 fixup: Remove Windows syscall adaptor for ftruncate 2022-05-06 11:09:20 +01:00
Si Beaumont 5d3519dcef FileOperations: Add FileDescriptor.resize, using ftruncate(2)
Signed-off-by: Si Beaumont <beaumont@apple.com>
2022-05-05 08:24:48 +01:00
Karoy Lorentey 1daa0c9677 Unify availability annotations and synchronize them with macOS 12 / iOS 15
Availability annotations now follow a rigid syntax that mentions the swift-system version that introduced the entry point:

```
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
public func greeting() -> String {
  "Hello"
}
```

This is designed to be processed by automated source generation tools.
2021-12-20 17:10:59 -08:00
George Lyon 689390f50f Implement FileDescriptor.Pipe() (#58)
Adds support for pipe(2)
2021-09-27 16:02:52 -06:00
YR Chen 58a2725013 Fix building on Windows 2021-08-05 10:05:06 -06:00
Rauhul Varma 4f36710d0b Expose O_DIRECTORY as api
- Adds a `directory` OpenOptions as a type-safe version of O_DIRECTORY.
  Allows clients to only open a FileDescriptor for FilePaths that refer
  to directories.
2021-07-14 18:24:52 -06:00
Saleem Abdulrasool 65a906baf1 Internals: replace CModeT with CInterop.Mode (#40)
The typealias was renamed but the reference to it was not fully removed.
This updates the instance enabling building System on Windows.
2021-03-20 12:32:13 -06:00
Saleem Abdulrasool dd1da2991e Internals: add Windows error code equivalences (#37)
Windows does not have the same set of error codes as a POSIX system.
However, the WinSock subsystem provides a set of error codes which are
meant to provide a means for handling similar error scenarios with
sockets.  This additionally adds an additional error code which allows
us to add back a previously ignored error code.
2021-03-16 19:25:12 -06:00
Saleem Abdulrasool bdfeb29148 Internals: adjust the definition of CInterop.Mode for Windows (#36)
Windows does not have a `mode_t` type, instead it uses `int` as a
stand in.  Adjust the type alias to reflect this.
2021-03-16 19:24:59 -06:00
Saleem Abdulrasool 83875613ec Internals: use CInterop.PlatformUnicodeString on Windows (#34)
The typealias was renamed but the Windows side of the build was not
updated.  This prevents building System on Windows.
2021-03-16 19:24:10 -06:00
Michael Ilseman cd4b42e03d Mocking helper for path strings 2021-03-15 15:18:54 -06:00
Michael Ilseman 8b989f724f Do not import CSystem on Darwin 2021-02-27 10:59:54 -07:00
Michael Ilseman b28263a910 Fixup some merge issues 2021-02-26 12:59:31 -07:00
Michael Ilseman b6558a3a90 Normal imports
System is not an overlay and will not pull C and platform modules into the
user's namespace. Import constants normally rather than redefining them.
2021-02-25 21:40:25 -07:00
Karoy Lorentey b9d290dc1e Add missing @_implementationOnly attribute 2021-02-25 21:14:46 -07:00
Michael Ilseman 0734450867 Fixup compilation failures for some compilers 2021-02-25 21:14:46 -07:00
Michael Ilseman d7611ca8ad Internalize SystemInternals
Scrap the separate module SystemInternals and instead have it be a
subdirectory. Adjust all access control accordingly. One day, when Swift gets
proper submodules or supermodules (i.e. resilience domains), we can reinstate
it. For now, a separate module makes binary distribution much more
complicated.
2021-02-25 21:14:46 -07:00