Skip to content

Commit 50688ca

Browse files
jrflatglessard
authored andcommitted
Update Stat.generationNumber to UInt64
1 parent bd155c1 commit 50688ca

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

Proposals/0006-system-stat.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,12 +693,13 @@ public struct Stat: RawRepresentable, Sendable {
693693

694694
/// File generation number
695695
///
696-
/// The file generation number is used to distinguish between different files
697-
/// that have used the same inode over time.
696+
/// The file generation number may be used to distinguish between different
697+
/// files that have used the same inode over time.
698698
///
699699
/// The corresponding C property is `st_gen`.
700-
/// - Note: Only available on Darwin, FreeBSD, and OpenBSD.
701-
public var generationNumber: Int { get set }
700+
/// - Note: Only available on Darwin, FreeBSD, and OpenBSD. The underlying C
701+
/// field is 32-bit on Darwin and OpenBSD, and 64-bit on FreeBSD.
702+
public var generationNumber: UInt64 { get set }
702703
#endif
703704
}
704705

Sources/System/FileSystem/Stat.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,16 @@ public struct Stat: RawRepresentable, Sendable {
521521

522522
/// File generation number
523523
///
524-
/// The file generation number is used to distinguish between different files
525-
/// that have used the same inode over time.
524+
/// The file generation number may be used to distinguish between different
525+
/// files that have used the same inode over time.
526526
///
527527
/// The corresponding C property is `st_gen`.
528-
/// - Note: Only available on Darwin, FreeBSD, and OpenBSD.
528+
/// - Note: Only available on Darwin, FreeBSD, and OpenBSD. The underlying C
529+
/// field is 32-bit on Darwin and OpenBSD, and 64-bit on FreeBSD.
529530
@_alwaysEmitIntoClient
530-
public var generationNumber: Int {
531-
get { Int(rawValue.st_gen) }
532-
set { rawValue.st_gen = numericCast(newValue)}
531+
public var generationNumber: UInt64 {
532+
get { UInt64(rawValue.st_gen) }
533+
set { rawValue.st_gen = numericCast(newValue) }
533534
}
534535
#endif
535536
}

0 commit comments

Comments
 (0)