Alastair Houghton
2357d6932c
Refactor FilePathTemp, add tests for permission code.
...
Broke `FilePathTemp.swift` into separate files for POSIX and
Windows.
Added tests for permissions code on Windows.
Added leading underscores to some function names.
Made some other functions `fileprivate`.
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton and Karoy Lorentey
33773a8eb9
Update Sources/System/FilePath/FilePathTemp.swift
...
Co-authored-by: Karoy Lorentey <klorentey@apple.com >
2024-05-08 16:09:56 +01:00
Alastair Houghton
21638a06b1
Map mode bits to Windows ACLs.
...
This adds support for mapping POSIX-style mode bits to Windows ACLs when
calling `open()` or `mkdir()`.
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
ec7d406cd4
Changes after comments from Saleem.
...
Use idiomatic Swift notation, not `Optional<Bool>`.
Prefer Win32 APIs to UCRT APIs.
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
c6456a9c03
Use the proper temporary directory on Darwin.
...
It seems we can get the temporary directory from confstr().
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
cfd3f9da90
Fix swift-system to work on Windows.
...
The swift-system tests were not passing, for various reasons, mostly
to do with path related confusion.
As part of this, add a function to create a temporary directory, as that
was one of the problems.
Also add Windows support for pipe() and ftruncate(), which was missing.
rdar://125087707
2024-05-08 16:09:54 +01:00
Jeremy Schonfeld
dd45c80062
Disfavor String.init(platformString: UnsafePointer<CChar>)
2024-05-02 13:25:04 -07:00
Max Desiatov and Guillaume Lessard
40b6b0ef8c
Add support for WASILibc module ( #159 )
...
Quoting the [wasi.dev landing page](https://wasi.dev ):
> The WebAssembly System Interface (WASI) is a group of standard API specifications for software compiled to the W3C WebAssembly (Wasm) standard. WASI is designed to provide a secure standard interface for applications that can be compiled to Wasm from any language, and that may run anywhere—from browsers to clouds to embedded devices.
Currently support for WASI in Swift is based on [`wasi-libc`](https://github.com/WebAssembly/wasi-libc ).
Adding support for `wasi-libc` mostly amounted to excluding unsupported errnos, adding TLS dictionary storage shim for single-threaded environment, and adding constants in C headers for macros that Clang importer currently doesn't support.
Co-authored-by: Guillaume Lessard <guillaume.lessard@apple.com >
2024-04-30 17:11:39 +01:00
Guillaume Lessard
dae787c199
Merge pull request #148 from finagolfin/droid
...
Android: update pread/pwrite for nullability annotations in NDK 26
2024-03-19 18:23:38 -07:00
Guillaume Lessard
5ca37e7d39
Android: more targeted approach to unusual nullabilities
2024-03-11 09:10:11 -07:00
Guillaume Lessard
403776dc2a
Merge pull request #152 from noahpistilli/visionPro
...
Add support for visionOS
2024-03-08 14:54:35 -08:00
Guillaume Lessard
6609a401b9
Update copyright notices
2024-03-08 12:16:44 -08:00
Guillaume Lessard
17e9790792
Rename withSystemChars
...
- `withNullTerminatedSystemChars` makes it clear that the null-termination is included. Operations where the null-termination is included should be obvious.
2024-03-08 12:16:43 -08:00
Guillaume Lessard
def7b1a70c
Fix behaviour of withCodeUnits()
...
- The original implementation includes a trailing zero with the full collection, but the implementation for a slice does not. As a result, given a `let s: SystemString`, `s.string` was not equal to `s[…].string`
2024-03-08 12:13:04 -08:00
Guillaume Lessard
afb7fa4eef
Generate SystemString.string consistently
...
- SystemString.string and Slice<SystemString>.string should be generated in the same manner. Now they are.
2024-03-08 12:13:04 -08:00
Sketch
f59a0b73ce
Add support for visionOS
2024-03-08 10:39:54 -05:00
Guillaume Lessard
adca1f70b1
Fix SystemString.withCSIA()
...
- The original implementation simply forwarded to the underlying `nullTerminatedStorage`, which contains one element – a null terminator – more than the actual `String`.
- This isn’t in keeping with the sperit of `withContiguousStorageIfAvailable()`, which should present exactly the elements of the collection.
2024-03-07 15:15:56 -08:00
Guillaume Lessard
c2e8f24c7c
avoid passing null pointer to pread() or pwrite()
2024-01-04 17:53:38 -08:00
Finagolfin
5c3617b9e9
Android: update pread/pwrite for nullability annotations in NDK 26
2023-11-24 19:01:31 +05:30
Guillaume Lessard
882466a730
apply missing availability attributes to Mach.Port
2023-10-13 18:55:23 -07:00
Guillaume Lessard
b92be8a02a
Update availability declarations for swift-system 1.1.0 API
2023-10-13 10:21:57 -07:00
Guillaume Lessard
495f729347
[noncopyability] explicitly prevent a capture
...
This may be needed because of a bug involving resilient structs.
2023-10-12 15:01:08 -07:00
Guillaume Lessard
7654f14f8c
[gardening] add some more availability annotations
2023-10-11 14:28:43 -07:00
Guillaume Lessard
0e060b7a7a
Merge pull request #144 from kateinoigakukun/katei/fix-rename-typo
...
Fix typos in renaming message for `Errno`
2023-09-07 15:21:20 -07:00
Yuta Saito
1ccaee141c
Fix typos in renaming message for Errno
2023-09-05 11:36:08 -07:00
Guillaume Lessard
8a8552f617
Merge pull request #129 from glessard/reenable-mach-port
...
Re-enable Mach.Port
2023-08-16 16:04:53 -07:00
Guillaume Lessard
87e68fca36
declare Sendable conformances along with the types
...
- `Sendable` is fundamental, it is preferably not declared as an extension.
2023-08-16 11:19:06 -07:00
Guillaume Lessard
f32faad415
remove code depending on Swift older than 5.6
2023-08-16 11:02:51 -07:00
Guillaume Lessard
8730f2cf25
[gardening] 80-column enforcement
2023-08-15 09:34:05 -07:00
Guillaume Lessard
65693b8b80
improve memory rebinding for mach_port_get_attributes call
2023-08-15 09:11:46 -07:00
Guillaume Lessard
6189c1f553
fix copySendRight() for send rights that become dead names
2023-08-11 14:09:44 -07:00
Lucy Satheesan
b596783bd9
implement closing
2023-08-11 09:07:47 -07:00
Lucy Satheesan
b58450413e
fix off-by-one in IORequest.openat
2023-08-11 09:07:08 -07:00
Lucy Satheesan
d099546787
fix access control
2023-08-11 09:06:17 -07:00
Guillaume Lessard
e4d06ae3ea
simplify deinit
2023-08-10 15:35:27 -07:00
Guillaume Lessard
d259ef476e
test two-parameter withBorrowedName
2023-08-10 15:35:27 -07:00
Guillaume Lessard
5e03246e4e
test copies of dead mach port names
2023-08-10 15:32:19 -07:00
Guillaume Lessard
40b5b3068b
test all the relinquish() methods
2023-08-10 15:32:19 -07:00
Guillaume Lessard
e8bb779909
use inout conversion
...
- this is the situation where it is appropriate
2023-08-10 15:32:19 -07:00
Guillaume Lessard
6ee96ffdb5
modify consuming methods to call discard self
2023-08-09 15:58:56 -07:00
Guillaume Lessard
9123120c08
destroy Send rights with mach_port_deallocate
2023-08-09 15:58:56 -07:00
Daniel Loffgren
2df5b0b031
srdelta argument to mach_port_destruct should be zero
...
This should never have been -1, as there is no send right for
it to balance when `RightType.self == ReceiveRight.self`.
2023-08-09 15:58:56 -07:00
Guillaume Lessard
af4544c869
Re-enable Mach.Port
2023-08-09 15:58:56 -07:00
Lucy Satheesan
1f821a8539
AsyncSequence draft implementation
2023-08-08 09:44:32 -07:00
Lucy Satheesan
996e940942
initial AsyncFileDescriptor work
2023-07-31 22:28:54 -07:00
Lucy Satheesan
6338029b74
stage 2: IORequest enum
2023-07-31 22:28:43 -07:00
Lucy Satheesan
15794f5cad
ioring pitch: first steps
2023-07-18 21:04:39 -07:00
Max Desiatov
0062c82c90
Add support for Musl libc ( #133 )
...
Since Musl is sufficiently different from Glibc (see https://wiki.musl-libc.org/functional-differences-from-glibc.html ), it requires a different import, which now should be applied to files that have `import Glibc` in them.
2023-07-04 16:50:13 +01:00
Guillaume Lessard
adbf8d2856
Add availability attributes to Sendable conformances
2023-06-21 14:50:47 -07:00
Alex Martini
1d1bef36c9
Fix abstracts to follow reference style.
...
- Use a present tense verb phrase
- Avoid repeating the symbol's name
2023-06-21 10:26:04 -07:00