-
Notifications
You must be signed in to change notification settings - Fork 207
Closed
Description
Linux uses unsigned types for stat
fields like st_mtime
which are actually signed. Values with the most significant bit indicate negative time offsets from the epoch, which is to say, dates before 1970. Currently rustix just re-exports the kernel's stat
struct, so it inherits this problem of using unsigned types for things that hold signed data.
rustix should change to using its own type for stat
. That's also a chance to make st_mode
be a Mode
, st_uid
be a Uid
, and so on, and maybe even have things like st_mtime
/st_mtime_nsec
be a Timespec
.
While here, macOS has a bug with negative timestamps, details here, and rustix should consider applying a similar fix.
Metadata
Metadata
Assignees
Labels
No labels