Skip to content

Commit 300188a

Browse files
committed
wip: more cleanup
1 parent b32fa0e commit 300188a

File tree

2 files changed

+6
-31
lines changed

2 files changed

+6
-31
lines changed

Sources/System/FileLock.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ extension FileDescriptor {
2424
}
2525

2626
extension FileDescriptor.FileLock {
27-
/// TODO: docs
2827
@_alwaysEmitIntoClient
2928
public init() { self.init(rawValue: .init()) }
3029

@@ -66,8 +65,6 @@ extension FileDescriptor.FileLock {
6665

6766
/// The process ID of the lock holder, filled in by`FileDescriptor.getLock()`.
6867
///
69-
/// TODO: Actual ProcessID type
70-
///
7168
/// The corresponding C field is `l_pid`
7269
@_alwaysEmitIntoClient
7370
public var pid: ProcessID {
@@ -129,33 +126,6 @@ extension FileDescriptor.FileLock {
129126
}
130127
}
131128

132-
133-
// TODO: Need to version this carefully
134-
// TODO: Don't do this, make a new type, but figure out ranges for that new type
135-
extension FileDescriptor.SeekOrigin: Comparable, Strideable {
136-
// TODO: Should stride be CInt or Int?
137-
138-
public func distance(to other: FileDescriptor.SeekOrigin) -> Int {
139-
Int(other.rawValue - self.rawValue)
140-
}
141-
142-
public func advanced(by n: Int) -> FileDescriptor.SeekOrigin {
143-
.init(rawValue: self.rawValue + CInt(n))
144-
}
145-
public static func < (
146-
lhs: FileDescriptor.SeekOrigin, rhs: FileDescriptor.SeekOrigin
147-
) -> Bool {
148-
lhs.rawValue < rhs.rawValue
149-
}
150-
}
151-
152-
extension FileDescriptor {
153-
struct FileRange {
154-
// Note: if it has an origin it wouldn't be comparable really or strideable
155-
}
156-
}
157-
158-
159129
extension FileDescriptor {
160130
/// All bytes in a file
161131
///

Sources/System/ProcessID.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

2-
/// TODO: docs
2+
#if !os(Windows)
3+
4+
/// The process identifier (aka PID) used to uniquely identify an active process.
5+
///
6+
/// The corresponding C type is `pid_t`
37
@frozen
48
public struct ProcessID: RawRepresentable, Hashable {
59
@_alwaysEmitIntoClient
@@ -9,3 +13,4 @@ public struct ProcessID: RawRepresentable, Hashable {
913
public init(rawValue: CInterop.PID) { self.rawValue = rawValue }
1014
}
1115

16+
#endif

0 commit comments

Comments
 (0)