diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2022-09-20 01:00:54 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2022-09-20 01:00:54 +0200 |
commit | 2b57f247128dc7f243c98c323a301942264d9a5d (patch) | |
tree | c219b9fdc5d54003ed789181c5b854e2ce2f3add /psutil/arch | |
parent | 735de787b84a1c8410d97ce402847bfc0c535487 (diff) | |
download | psutil-2b57f247128dc7f243c98c323a301942264d9a5d.tar.gz |
#2084: document limitations of environ() on macOS Big Sur
Diffstat (limited to 'psutil/arch')
-rw-r--r-- | psutil/arch/osx/process_info.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c index 4af510e8..47330ea6 100644 --- a/psutil/arch/osx/process_info.c +++ b/psutil/arch/osx/process_info.c @@ -241,7 +241,14 @@ error: } -// return process environment as a python string +// Return process environment as a python string. +// On Big Sur this function returns an empty string unless: +// * kernel is DEVELOPMENT || DEBUG +// * target process is same as current_proc() +// * target process is not cs_restricted +// * SIP is off +// * caller has an entitlement +// See: https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/kern/kern_sysctl.c#L1315-L1321 PyObject * psutil_get_environ(pid_t pid) { int nargs; |