Skip to content

qnx: Add missing definitions for io-sock - #5469

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
lambinoo:fix-missing-bits-qnx8
Sep 7, 2026
Merged

qnx: Add missing definitions for io-sock#5469
tgross35 merged 1 commit into
rust-lang:mainfrom
lambinoo:fix-missing-bits-qnx8

Conversation

@lambinoo

@lambinoo lambinoo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I'm currently working on getting socket2 to compile for QNX8 networking stack. This PR adds some missing network related structs and constants.

@lambinoo
lambinoo force-pushed the fix-missing-bits-qnx8 branch from fbbe72e to b32f2a1 Compare September 4, 2026 11:09
@lambinoo lambinoo changed the title fix: add missing constants for io-sock QNX fix: add missing definitions for io-sock QNX Sep 4, 2026
@lambinoo
lambinoo force-pushed the fix-missing-bits-qnx8 branch from b32f2a1 to 543e03a Compare September 4, 2026 11:55

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks reasonable enough to me but the target maintainers should review/test. Cc @flba-eb @gh-tr @jonathanpallant @japaric

@rustbot label +S-waiting-on-maintainer

View changes since this review

Comment thread src/unix/nto/io_sock/mod.rs Outdated
Comment on lines +58 to +63
// https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/in.h#L549
pub struct ip_mreqn {
pub imr_multiaddr: in_addr,
pub imr_address: in_addr,
pub imr_ifindex: c_int,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please put these links into the commit message, rather than in comments

@lambinoo lambinoo Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated! Also fixed the the in_addr fields to crate::in_addr since that's what the rest of the file is using

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • The following commits have merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

    You can start a rebase with the following commands:

    $ # rebase
    $ git pull --rebase https://github.com/rust-lang/libc.git main
    $ git push --force-with-lease
    

@lambinoo
lambinoo force-pushed the fix-missing-bits-qnx8 branch from b539bb3 to 54be82a Compare September 6, 2026 14:21
@rustbot

rustbot commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

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.

@lambinoo
lambinoo force-pushed the fix-missing-bits-qnx8 branch 2 times, most recently from 33e91af to 53c3ebe Compare September 6, 2026 14:26
Comment on lines 8 to 10
//! * `x86_64-pc-qnx`
//!

@tgross35 tgross35 Sep 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tgross35

tgross35 commented Sep 7, 2026

Copy link
Copy Markdown
Member

Also this is labled "fix" but this is just an API addition. For future reference we don't use conventional commits but instead use scoping, makes it much easier to get a changelog (no need to change it's just an FYI)

@tgross35 tgross35 changed the title fix: add missing definitions for io-sock QNX qnx: Add missing definitions for io-sock Sep 7, 2026
@lambinoo
lambinoo force-pushed the fix-missing-bits-qnx8 branch 2 times, most recently from a773b6b to 5702a8e Compare September 7, 2026 07:16

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just waiting on a target maintainer to confirm

View changes since this review

@jonathanpallant

Copy link
Copy Markdown
Contributor

I would strongly advise against linking to the FreeBSD headers in the commit message. The only place to check these constants is in QNX SDP 8.0 and/or its online documentation, because whilst it might be based on FreeBSD, QNX could have changed any of these constants to suit their needs.

Using target/qnx/usr/include/netinet/in.h in my copy of QNX SDP 8, I have verified:

  • ip_mreqn
  • ip_mreq_source
  • TCP_KEEPIDLE
  • TCP_KEEPINTVL
  • TCP_KEEPCNT
  • IP_RECVTOS
  • IP_ADD_SOURCE_MEMBERSHIP
  • IP_DROP_SOURCE_MEMBERSHIP

@lambinoo

lambinoo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Should I remove the references to freeBSD then from the commit message? Mostly wanted to link to publicly available headers, but it's true that the SDP is the only source of truth here.

@jonathanpallant

jonathanpallant commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Also, the ip_mreqn and ip_mreq_source structures don't exist in QNX SDP 7.1 from what I can see, so these should probably be excluded from those targets.

Uh, scratch that. I didn't have io-sock installed. They look the same in QNX SDP 7.1.

@lambinoo

lambinoo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Also, the ip_mreqn and ip_mreq_source structures don't exist in QNX SDP 7.1 from what I can see, so these should probably be excluded from those targets.

Uh, scratch that. I didn't have io-sock installed. They look the same in QNX SDP 7.1.

Yeah, they should be in usr/include/io-sock/netinet/in.h. From my understand, QNX is backporting anything on the io-sock side from 8 to 7.1. So they should be the same most if not all the time.

@lambinoo
lambinoo force-pushed the fix-missing-bits-qnx8 branch from 5702a8e to 7d219cf Compare September 7, 2026 12:29
@lambinoo

lambinoo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Removed any references to FreeBSD from the commit message

@tgross35

tgross35 commented Sep 7, 2026

Copy link
Copy Markdown
Member

Thanks Jonathan for reviewing

@tgross35
tgross35 added this pull request to the merge queue Sep 7, 2026
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Sep 7, 2026
Merged via the queue into rust-lang:main with commit 77e9b41 Sep 7, 2026
58 checks passed
lambinoo added a commit to lambinoo/libc that referenced this pull request Sep 11, 2026
(cherry picked from commit 77e9b41)

Backport of: rust-lang#5469
lambinoo added a commit to lambinoo/libc that referenced this pull request Sep 11, 2026
(cherry picked from commit 77e9b41)

Backport of: rust-lang#5469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-unix S-waiting-on-maintainer stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants