Karoy Lorentey
bb6ab43e44
Update availability declarations
2023-03-01 18:10:40 -08:00
Karoy Lorentey
e708e4adda
Mach: Avoid non-inlinable generics where possible
...
- Leave Ports as non-frozen for now, but expose its two stored
properties.
- Make most members inlinable. The core initializers and the
deinitializer must remain opaque for now.
- Mark the empty `MachPortRight` types as `@frozen` — these are
markers, not carrying any data.
rdar://106057781
2023-02-28 17:05:18 -08:00
Karoy Lorentey
cc96d40bee
Merge pull request #76 from apple/lorentey/post-back-ios15-system
...
Update package with changes from recent ABI stable releases
2023-02-28 16:13:44 -08:00
loffgren
9cdaaa356e
Merge pull request #121 from loffgren/machport_fixes
...
Mach.Port: Tidiness
2023-02-22 09:55:03 -08:00
Daniel Loffgren
16c7885387
Move public annotations from extensions down to each function explicitly
2023-02-21 16:03:31 -08:00
Daniel Loffgren
0fb71dd6ad
Fit all function signatures within 80 cols
2023-02-13 23:53:06 -08:00
Daniel Loffgren
16a2775645
Annotate entire Mach namespace as being available in System 1.3.0
2023-02-13 17:53:42 -08:00
Daniel Loffgren
13bf719c29
Freeze the Mach namespace, as it should only ever be used as a namespace
2023-02-10 18:04:55 -08:00
Daniel Loffgren
3750b96b2e
name and context should have leading underscores
2023-02-10 18:03:31 -08:00
Daniel Loffgren
12baba9706
machPrecondition should have a leading underscore
2023-02-10 17:59:16 -08:00
Alex Martini
2c2a831f66
Remove blank lines at the end of doc comments.
2023-01-31 12:35:33 -08:00
Alex Martini
deb56e1ad2
Keep doc comments immediately before declarations.
...
If there's anything between them, DocC doesn't recognize that the doc
comment belongs to the declaration that comes after the interruption,
resulting in that declaration being undocumented.
2023-01-31 12:07:17 -08:00
Max Desiatov
3f66dfbaf8
MachPort: fix build issues with Swift 5.7
...
It seems that `#if $MoveOnly` check has no effect on Swift 5.7, so we should check whether Swift 5.8 or later are available first.
Resolves #117 .
2023-01-05 10:58:04 +00:00
Daniel Loffgren
700b8f867e
Use two space indentation
2022-12-22 18:01:40 -08:00
loffgren and Karoy Lorentey
d129f62ce9
Use Markdown code voice for initializer comment
...
Co-authored-by: Karoy Lorentey <klorentey@apple.com >
2022-12-22 17:12:26 -08:00
loffgren and Michael Ilseman
ae6b1f24a9
Remove space before inheritance colon
...
Co-authored-by: Michael Ilseman <michael.ilseman@gmail.com >
2022-12-22 14:52:36 -08:00
Daniel Loffgren
6a9ebce259
Add public annotations where applicable
2022-12-21 13:20:38 -08:00
Daniel Loffgren
7f4560f022
Remove unnecessary RightTypes for Mach.Ports being constructed inline with a return
2022-12-21 13:12:13 -08:00
Daniel Loffgren
6dd57fe3a9
Add a friendly precondition message for the MACH_PORT_NULL check
2022-12-21 12:57:25 -08:00
Daniel Loffgren
551d7b897f
Use mach_port_destruct() to deinit receive rights eliminating the second syscall, and use mach_port_mod_refs() for all other right types to get a free type check at deinit time
...
mach_port_mod_refs() requires the type of right being modified. So,
MACH_PORT_DEAD must be identified as a separate type. As this is
something that shouldn't be possible for receive rights, preconditions
have also been added to protect against this particular error.
2022-12-21 12:53:47 -08:00
Daniel Loffgren
296374ecef
Label tuple contents for allocatePortPair() and relinquish()
2022-12-21 11:46:06 -08:00
Daniel Loffgren
213165ab72
size should be the number of natural_t's
2022-12-20 15:45:17 -08:00
Daniel Loffgren
bd036acda6
Storage should be initialized to MACH_PORT_NULL, rather than 0
2022-12-20 15:45:17 -08:00
Daniel Loffgren
4536c47763
Use precondition instead of assert, adding a machPrecondition for the common KERN_SUCCESS check
2022-12-20 15:45:17 -08:00
Daniel Loffgren
bdc776bd3e
Correct parameter whitespace
2022-12-19 17:14:53 -08:00
loffgren and Matt Wright
c2d940ecf3
Remove parens around RightType condition in initializer
...
Co-authored-by: Matt Wright <mww@apple.com >
2022-12-19 16:41:33 -08:00
Daniel Loffgren
304ccc3abb
Add Mach.Port
2022-12-07 17:24:26 -08:00
Florian Friedrich
77d9ca18c1
Add Sendable conformances ( #115 )
2022-11-30 14:04:49 -07:00
3405691582
18cceda484
Support OpenBSD. ( #113 )
...
Add the usual `os` conditionals and exclude errno constants that aren't
present on this platform.
Maybe availability annotations are a better way to deal with this, but
that is likely something that requires more careful consideration.
2022-10-31 09:22:05 -06:00
Alex Martini
015e9baf40
Fix a broken link. ( #107 )
2022-08-23 07:21:09 -06:00
Daniel Duan
036f567f23
Remove Windows warnings ( #105 )
...
These calls are missing their Windows counter parts, resulting warnings
stating `X is deprecated: The POSIX name for this item is deprecated.
Instead, use the ISO C and C++ conformant name: Y. See online help for
details`.
Add them like the rest.
2022-06-21 09:50:24 -06:00
Karoy Lorentey
e9886bf251
Merge branch 'main' into lorentey/post-back-ios15-system
...
# Conflicts:
# Sources/System/FilePath/FilePathString.swift
2022-06-13 16:45:25 -07:00
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
Guillaume Lessard
3920df78d9
Correct deprecation messages
2022-06-03 16:43:25 -06:00
Guillaume Lessard
afe2d35d0b
Mitigate misuse of pointer conversion in FilePath inits
2022-06-03 16:43:25 -06:00
Guillaume Lessard
25380a1bea
Mitigate misuse of pointer conversion in String inits
2022-06-03 16:43:25 -06:00
Alex Martini
6db5a4a43b
Fix broken links.
...
Fixes rdar://79096457
2022-06-03 15:23:53 -07:00
Guillaume Lessard
914c782b96
Replace assumingMemoryBound with temporary rebinding
...
- this doesn’t use the new memory binding API.
2022-05-27 18:09:45 -06:00
Karoy Lorentey
147ebc053a
Unbreak the Windows port
2022-05-21 12:43:59 -07:00
Si Beaumont
865fd70605
Merge branch 'main' into sb/resize
2022-05-20 18:26:33 +01:00
Si Beaumont
fea7d5030d
docs: Removed duplicate paragraph from FileDescriptor.writeAll(_:) docs ( #85 )
2022-05-16 07:28:47 -07:00
Si Beaumont
d90bf8529a
fixup: Move FileDescriptor.fileSize() to an internal extension in SystemTests
2022-05-06 11:55:00 +01:00
Si Beaumont
02daf4b6a7
fixup: Move FileDescriptor.resize to extension with #if !os(Windows)
2022-05-06 11:55:00 +01: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
Si Beaumont
23ac190631
FileHelpers: Add FileDescriptor.fileSize
...
Signed-off-by: Si Beaumont <beaumont@apple.com >
2022-05-04 12:33:03 +01:00
Karoy Lorentey
ca700460b1
Fix compatibility with Swift 5.3.3
2021-12-26 22:00:07 -08:00
Karoy Lorentey
81d78be499
Fix Windows build
2021-12-26 21:53:28 -08:00