you are viewing a single comment's thread
view the rest of the comments
[–] 6 points 2 months ago* (3 children)

Did you know openBSD does not have this folder? I think the BSD's do not use /proc. I do not know why though.

  • source
  • hideshow 3 child comments
  • [–] 3 points 2 months ago* (last edited 2 months ago) (2 children)

    That raises the question of how their ps, top, lsof and such work, since afaik in Linux they read from /proc.

    P.S. Looks like BSDs tug at the kernel via syscalls, namely sysctl and also the ‘kvm interface’ in the case of MacOS (not sure what ‘kvm’ thing is meant here). Seems vaguely reasonable, since procfs also queries the kernel for the info, so about the same resources would be used, perhaps even with the overhead of filesystem traversal and string-numbers conversion.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 2 months ago (1 child)

    I might be mistaken, but I think kvm stands for kernel virtual machine. Having no /proc, and interacting with sysctl instead sounds more secure, IMO.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 2 months ago

    Some pseudofiles under /proc are only readable by the user running the process, and of course root can read everything. So it's the standard Unix security model, afaics.

    For example, any process' command-line arguments are famously visible to everyone, while the environment variables only to the user of the process.

  • source
  • parent