Skip to content

Add proc_info structs and methods to macOS SystemB#1723

Open
dbwiddis wants to merge 1 commit intojava-native-access:masterfrom
dbwiddis:add-resource-usage-and-proc-info
Open

Add proc_info structs and methods to macOS SystemB#1723
dbwiddis wants to merge 1 commit intojava-native-access:masterfrom
dbwiddis:add-resource-usage-and-proc-info

Conversation

@dbwiddis
Copy link
Copy Markdown
Contributor

@dbwiddis dbwiddis commented May 11, 2026

Adds macOS process/socket information structs and methods to c.s.j.p.mac.SystemB.

Most mappings have been in use by OSHI since 2020, finally catching up on my upstream contributions. vm_deallocate (yes I had a memory leak for a decade) and statfs64 are recent additions.

Changes

c.s.j.p.mac.SystemB:

  • ProcFdInfo
  • InSockInfo
  • TcpSockInfo
  • proc_pidfdinfo(), statfs64(), vm_deallocate() methods
  • Constants: PROC_PIDLISTFDS, PROC_PIDFDSOCKETINFO, PROX_FDTYPE_SOCKET, SOCKINFO_IN, SOCKINFO_TCP, TSI_T_NTIMERS, AF_INET, AF_INET6

Reference headers

  • sys/proc_info.h: struct proc_fdinfo, struct in_sockinfo, struct tcp_sockinfo, PROC_PIDLISTFDS, PROC_PIDFDSOCKETINFO, PROX_FDTYPE_SOCKET, TSI_T_NTIMERS

- Add ProcFdInfo, InSockInfo, TcpSockInfo structs to c.s.j.p.mac.SystemB
- Add proc_pidfdinfo(), statfs64(), vm_deallocate() methods
- Add PROC_PIDLISTFDS, PROC_PIDFDSOCKETINFO, PROX_FDTYPE_SOCKET,
  SOCKINFO_IN, SOCKINFO_TCP, TSI_T_NTIMERS, AF_INET, AF_INET6 constants
- Add SystemBTest additions (testProcPidFdInfo, testStatfs64)

All struct mappings verified against Apple XNU headers:
- sys/proc_info.h (struct proc_fdinfo, struct in_sockinfo, struct tcp_sockinfo)
@dbwiddis dbwiddis force-pushed the add-resource-usage-and-proc-info branch from fd3e4e7 to 4cd4d97 Compare May 11, 2026 01:04
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.

1 participant