Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unsafe callbacks #4341

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

highjeans
Copy link

@highjeans highjeans commented Mar 19, 2025

Description

This PR changes the callback function type to be unsafe rather than safe in (i believe) all functions that need a callback function, as per the discussion in #2198.

Closes #2198

Sources

As no APIs were changes (other than making the callback type unsafe), and safe vs unsafe functions are not documented in the linux documentation/header files, there are no sources.

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

@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2025

Some changes occurred in the Android module

cc @maurer

@tgross35
Copy link
Contributor

These look good to me, but there seem to be a few more cases. Would you mind getting those as well? https://github.com/search?q=repo%3Arust-lang%2Flibc%20%2F%3A.*fn%5C(%2F&type=code for a rough search, e.g. the aix module, solaris, espidf, and a few others.

We can't backport this since it is breaking unfortunately, but it will be great to have for 1.0:

@rustbot label +stable-declined

@rustbot rustbot added the stable-declined This change is breaking, difficult to backport, low priority, or otherwise not relevant for 0.2 label Mar 22, 2025
@tgross35
Copy link
Contributor

tgross35 commented Apr 2, 2025

@rustbot author for the request above

@rustbot
Copy link
Collaborator

rustbot commented Apr 2, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android O-linux O-unix O-windows S-waiting-on-author stable-declined This change is breaking, difficult to backport, low priority, or otherwise not relevant for 0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libc::clone() should take an unsafe callback
3 participants