-
Notifications
You must be signed in to change notification settings - Fork 381
Replace check_shim with check_shim_abi in unix/foreign_items shims #4263
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
Conversation
Would you prefer I update all the remaining shims in this file as part of this PR, or should I submit a separate PR for that? Updating all check_shim calls here would result in a large change, which might make the review process more difficult. |
No please don't make this PR any bigger. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! You uncovered a few cases where we are not properly consistent with our types.
We generally assume that long
is isize
and unsigned long
is usize
, so please also keep doing that here. Same for size_t
and ssize_t
, those are usize
and isize
, respectively.
For types like off_t
, off64_t
, clockid_t
, we should be using their proper types, but some functions do not. So please do one of the following:
- change the logic inside these functions to use the proper type. Typically this means using e.g.
to_int(this.libc_ty_layout("off_t").size)
instead ofto_i32()
. - or keep the logic the same, put
i32
into thecheck_shim_abi
invocation, and add a comment saying "FIXME: should be off_t".
@rustbot author
Reminder, once the PR becomes ready for a review, use |
@rustbot ready |
This looks great, thanks! Please squash the commits, then we can land this. Please use the @rustbot author |
…me related shims Making type consistent in shims pread return type fix make clock_gettime shim type consistent
0891832
to
4c9ae03
Compare
@rustbot ready |
Links to #3842.