rust-lang / rust-lang/libc

musl: Change `time_t` definition on 32-bit targets according to "time64"

Open
#1,848 18 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug-outdated-type I-needs-decision O-musl upstream-change
Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

time_t is defined as c_long on musl:
https://github.com/rust-lang/libc/blob/b1268e43cd34ebc95d184928296fc73740cd5162/src/unix/linux_like/linux/musl/mod.rs#L3
and c_long is i32 on 32-bit targets:
https://github.com/rust-lang/libc/blob/b1268e43cd34ebc95d184928296fc73740cd5162/src/unix/linux_like/linux/musl/b32/mod.rs#L1
But the time_t definition has been changed to 64-bit by https://github.com/bminor/musl/commit/38143339646a4ccce8afe298c34467767c899f51, since musl 1.2.0.
We will change our type to i64 on 32-bit targets as well at some point but we should announce it before changing.
cc #1846

Implementation history:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/unix/linux_like/linux/musl/mod.rs and the 32-bit definition in src/unix/linux_like/linux/musl/b32/mod.rs, then read the linked musl commit and related PRs #4443 and #4463. Check which 32-bit musl targets and tests are affected; done means the binding matches musl 1.2.0's time_t behavior and the announced compatibility change is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.