-
Notifications
You must be signed in to change notification settings - Fork 125
Stat implementation for Swift System #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Note that the implementation uses typed throws which require Swift 6.0+, so earlier Swift versions are failing. |
@@ -87,6 +87,7 @@ let swiftSettings = swiftSettingsAvailability + swiftSettingsCI + [ | |||
|
|||
let cSettings: [CSetting] = [ | |||
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])), | |||
.define("_GNU_SOURCE", .when(platforms: [.linux])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vaguely remember that this may cause an issue with the glibc module if another package imports it without this define? I.e. either everyone has to import it this way or no one can (in which case, we really want the C importer to set this instead of setting it in the package). @DougGregor?
728d616
to
266636c
Compare
266636c
to
2f0f045
Compare
I would really like native TimeSpec and TimeVal wrappers to be provided by this API and conversions to/from duration be based on them. These type represent the granularity the system thinks in and papering over that with |
The stdlib already provides initializers to convert |
This PR adds a Swift
Stat
implementation for the Cstat
types and system calls.See the pitch at https://forums.swift.org/t/pitch-stat-types-for-swift-system/81616
See the full proposal in #257