sarugaku / shellingham

Tool to Detect Surrounding Shell
ISC License
222 stars 33 forks source link

select correct /proc/#/status file fields on BSD systems #68

Closed jacklag closed 1 year ago

jacklag commented 1 year ago

BSD system have different fields than Linux systems if they provide a /proc FS Added a switch to select the correct fields on BSD systems.

uranusjr commented 1 year ago

Nice! The code can probably be slightly tweaked, but this looks good to me.

jacklag commented 1 year ago

What kind of tweaks you are thinking about?

uranusjr commented 1 year ago

Oops I meant to do those directly during last weekend but didn’t have the time. I was mostly worried about potentially incompatible systems (e.g. Cygwin) that may not have uname available and looking to make the calculation a bit safer.