Repository navigation
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @LawnGnome (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
7910336 to
89eb084
Compare
This comment has been minimized.
This comment has been minimized.
|
Just catching up on the last month of notifications, sorry. I don't have any context on nuttx, so I'm going to re-roll this. @rustbot reroll |
|
I don't know anything about nuttx either, cc @no1wudi as target maintainer From a quick glance it looks like rust-lang/libc#5555 was merged now, but only into the main branch, so it's only in the libc 1.0 pre-release, not in any 0.2.x release. My understanding is that more steps are needed before std can use the updated libc definitions:
However, looking at the actual changes here, I'm not sure if this is the right way. Duplicating various struct literals just to add fields which are internal to the libc implementation on some platform doesn't seem great for maintainability. Perhaps there's a way to rewrite the affected code that works the same on all platforms including NuttX? |
I'm not sure what the update process for libc is, I just wanted to provide the required changes upfront so it won't break.
I agree, do you see a better solution? The primary alternative I see is using Default: let mut pollfd = libc::pollfd {
fd: self.as_raw_fd(),
events: libc::POLLOUT,
revents: 0,
..Default::default()
};Which would require implementing |
|
I would suggest the pattern of creating the C struct with rust/library/std/src/sys/process/unix/pidfd.rs Lines 31 to 32 in 96a18bf Then we should be able to merge this PR independently of when the libc fix makes it into a libc 0.2.x release and that release is adopted by the standard library. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
89eb084 to
4e405ed
Compare
|
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. |
That works too (if unsafe is acceptable), and I updated accordingly. |
This comment has been minimized.
This comment has been minimized.
4e405ed to
f9f9cd6
Compare
This comment has been minimized.
This comment has been minimized.
f9f9cd6 to
4731e88
Compare
This comment has been minimized.
This comment has been minimized.
Corresponding libc PR: rust-lang/libc#5555 pollfd has some extra internal fields on NuttX, so we use mem::zeroed() to initialze.
4731e88 to
eeb36a0
Compare
This goes together with this libc PR: rust-lang/libc#5555