Skip to content

Fix exit-with-error accessing /proc on macOS#307

Open
mevanlc wants to merge 1 commit into
raboof:mainfrom
mevanlc:macos-bsd-proc-fix
Open

Fix exit-with-error accessing /proc on macOS#307
mevanlc wants to merge 1 commit into
raboof:mainfrom
mevanlc:macos-bsd-proc-fix

Conversation

@mevanlc

@mevanlc mevanlc commented Jun 8, 2026

Copy link
Copy Markdown

nethogs could exit with an error "Error reading /proc, needed to get pid set" when running on macOS (test was run on an installation from brew, reported version 0.8.8).

Tested

  • compiles and runs on macOS Tahoe, Ubuntu 26, FreeBSD 15

Notes:

  • Define NETHOGS_HAVE_PROC for non-Apple/non-FreeBSD platforms (room for expansion to other BSDs)
  • Guard all /proc-based connection/inode and pid mapping paths behind the macro
  • Skip /proc cleanup and GC logic on BSD/macOS builds while keeping behavior intact
  • Use portable object-dir cleanup fallback in MakeLib

    - Define NETHOGS_HAVE_PROC for non-Apple/non-FreeBSD platforms
    - Guard all /proc-based connection/inode and pid mapping paths behind the macro
    - Skip /proc cleanup and GC logic on BSD/macOS builds while keeping behavior intact
    - Use portable object-dir cleanup fallback in MakeLib
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