Skip to content

Conversation

@snogge
Copy link
Contributor

@snogge snogge commented Aug 14, 2025

Description

Use the input_event_sec and input_event_usec members (macros in C) on all platforms, no matter whether time_t is 32 or 64 bits.
This means the same members are available in the struct no matter whether it is a 32 or 64 bit platform or the linux_time_bits64 config is set.

This is a breaking change.

Sources

https://github.com/torvalds/linux/blob/0cc53520e68bea7fb80fdc6bdf8d226d1b6a98d9/include/uapi/linux/input.h#L28

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

This is a breaking change and should not be backported to the 0.2 branch.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry this has taken me forever to come to consensus on, but I do now think this is the right approach. I have a couple of non-technical requests, the code changes LGTM.

Comment on lines 345 to 346
#[cfg(target_arch = "sparc64")]
_pad1: c_int,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to backport this part of the change. It is technically breaking but our definition is incorrect without it, and sparc64 isn't all that popular of a target. Would you be able to split this to a separate commit?

Padding fields should also get wrapped in Padding<...> now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm - actually, I think this change may not be correct on its own. Looks like the __usec/input_event_usec field would also need to be changed from a long to an int https://github.com/torvalds/linux/blob/3f9f0252130e7dd60d41be0802bf58f6471c691d/include/uapi/linux/input.h#L35C6-L42.

We should probably do that change still to make sure users don't expect the upper half of that field to work, just annoying that sparc has a special-cased suseconds_t in the first place.

(context: torvalds/linux@2e74694)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I see now that the field is of type suseconds_t. Sorry for the confusion; please disregard everything in this thread except for the Padding<...> bit.

@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@tgross35 tgross35 mentioned this pull request Dec 3, 2025
3 tasks
@snogge
Copy link
Contributor Author

snogge commented Dec 4, 2025

I've seen your comments and hope to get around to this next week.

@snogge snogge force-pushed the input_event_x-macros branch from f2975e2 to 204147b Compare December 15, 2025 14:56
@rustbot rustbot added the A-CI Area: CI-related items label Dec 15, 2025
@rustbot

This comment has been minimized.

@snogge snogge force-pushed the input_event_x-macros branch from 204147b to fc7a7cf Compare December 15, 2025 14:56
@snogge
Copy link
Contributor Author

snogge commented Dec 15, 2025

@rustbot ready

@tgross35 The change causes CI errors for i686-linux-unknown-musl. I was not sure what the right thing to do was - I have not been keeping up to date on changes - so I added another time64 exception for musl.

@tgross35
Copy link
Contributor

The musl time64 changes caused a conflict here so this will need a rebase (sorry about that)

@tgross35 The change causes CI errors for i686-linux-unknown-musl. I was not sure what the right thing to do was - I have not been keeping up to date on changes - so I added another time64 exception for musl.

I think it should be fixed by #4463 which resolved everything else in that block (hence the conflict), musl on relevant platforms should be setting the linux time64 cfg now.

This means the same members are available in the struct no matter
whether it is a 32 or 64 bit platform or the linux_time_bits64 config
is set.
@snogge snogge force-pushed the input_event_x-macros branch from fc7a7cf to 568a531 Compare January 14, 2026 08:43
@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@snogge
Copy link
Contributor Author

snogge commented Jan 14, 2026

Rebase is done, I think the failing check is unrelated.

@rustbot ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants