Skip to content

NetBSD: add kinfo_file, kinfo_pcb structures and related constants#4985

Merged
tgross35 merged 1 commit intorust-lang:mainfrom
antoncxx:netbsd-ext
Mar 3, 2026
Merged

NetBSD: add kinfo_file, kinfo_pcb structures and related constants#4985
tgross35 merged 1 commit intorust-lang:mainfrom
antoncxx:netbsd-ext

Conversation

@antoncxx
Copy link
Contributor

@antoncxx antoncxx commented Feb 19, 2026

Description

This PR extends NetBSD support with updates to kernel information structures and file descriptor types.

1. Added kinfo_pcb

  • Constants:
    • PCB_SLOP
    • PCB_ALL

2. kinfo_file structure

  • Contants
    • KERN_FILE_BYFILE
    • KERN_FILE_BYPID
    • KERN_FILESLOP

3. File descriptor types

  • DTYPE_VNODE
  • DTYPE_SOCKET
  • DTYPE_PIPE
  • DTYPE_MISC
  • DTYPE_CRYPTO
  • DTYPE_MQUEUE
  • DTYPE_SEM
  • DTYPE_EVENTFD
  • DTYPE_TIMERFD

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 label +stable-nominated


Of all the file descriptor types, I’ve been having trouble with DTYPE_MEMFD. Even though it exists in the NetBSD source code, the corresponding header on an actual installation seems to be missing this definition. I’m not sure how to handle this properly—whether to ignore it during tests or not include it at all.

@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

Some changes occurred in a NetBSD-like module

cc @semarie

@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Feb 19, 2026
@semarie
Copy link
Contributor

semarie commented Feb 19, 2026

Some changes occurred in a NetBSD-like module

cc @semarie

just to note that the PR is properly rebased to NetBSD only 👍

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.

The structs themselves look pretty fine, but a lot of the support bits can be dropped.

Also, please give PRs a more descriptive title. We get a lot of additions to NetBSD API and it is helpful to be able to narrow them down :)

View changes since this review

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

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

@rustbot

This comment has been minimized.

@antoncxx antoncxx changed the title Extended NetBSD API NetBSD: add kinfo_file, kinfo_pcb structures and related constants Mar 3, 2026
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.

Think the two things here should fix it. Please rebase & squash after then LGTM, assuming CI passes

View changes since this review

@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2026

Some changes occurred in an OpenBSD module

cc @semarie

@rustbot rustbot added the A-CI Area: CI-related items label Mar 3, 2026
@rustbot

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 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.

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.

@tgross35 tgross35 added this pull request to the merge queue Mar 3, 2026
@antoncxx
Copy link
Contributor Author

antoncxx commented Mar 3, 2026

Thank you!

View changes since this review

Thank you for the review!

Merged via the queue into rust-lang:main with commit 56caa81 Mar 3, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: CI-related items S-waiting-on-author 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