Skip to content

Conversation

@vstakhov
Copy link
Member

@vstakhov vstakhov commented Nov 4, 2025

Document struct kinfo_proc with complete field descriptions, add CAVEATS about ABI stability and machine-dependent fields, provide an example with build instructions, and add libprocstat(3) cross-reference.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Thank you for taking the time to contribute to FreeBSD!
There is an issue that needs to be fixed:

Please review CONTRIBUTING.md, then update and push your branch again.

Add comprehensive documentation for struct kinfo_proc:

- Add complete C-style struct definition with types and inline comments
  showing all user-accessible fields
- Document key fields including process identifiers, credentials, memory
  statistics, runtime information, and flags
- Clarify process flag fields (ki_flag, ki_kiflag, ki_flag2) with
  examples and header file references
- Add complete, compilable example program demonstrating memory usage
  reporting
- Add CAVEATS section documenting ABI stability, machine-dependent
  fields, and portability considerations across BSD systems
- Clarify description of function behavior and memory allocation
- Add cross-references to related manual pages

The struct definition excludes internal kernel pointers and uses a
single ellipsis for additional fields, following the style of other
system structure documentation.

Signed-off-by: Vsevolod Stakhov <[email protected]>
Enhance the kinfo_getproc(3) manual page example:
- Make example work without arguments by defaulting to current process
  when no PID is specified
- Make memory output consistent by displaying all values in KB instead
  of mixing bytes and KB
- Add compilation instructions showing that -lutil is required

Improve struct documentation:
- Add comment about ki_structsize and KINFO_PROC_SIZE macro for
  determining actual structure size
- Direct readers to <sys/user.h> for full structure definition
- Move ellipsis inside comment to make struct syntactically valid C

Add cross-reference to kinfo_getproc(3) in libprocstat(3) manual page
since it provides comprehensive documentation for struct kinfo_proc.

Signed-off-by: Vsevolod Stakhov <[email protected]>
Copy link
Contributor

@concussious concussious left a comment

Choose a reason for hiding this comment

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

This is not a complete review as I am not familiar with the subject matter.

vstakhov and others added 2 commits November 6, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants