os.pidfd_open gives me an AttributeError saying that os does not have an attribute pidfd_open.
I am running a locally built version of python which we distribute with our software. The python version is 3.11 (docs say pidfd_open is new in 3.9) I am running on Ubuntu 24.04 which uses kernel 6.8 (docs say pidfd_open needs at least 5.3).
Does anyone understand whypidfd_open is missing? Or can you suggest any diagnostics I can gather to help diagnose the problem?
Can you see if your kernel does in fact support the syscall? I think the following should test that. If you get errno 38, that would suggest the call is not in your kernel.
Problem solved. I am running Ubuntu 24.04, but some of our customers are running much older distros than that. sys/fd.h in the container used to build python doesn’t have pidfd_open defined, so Python skips it.