# Os.pidfd\_open missing

**URL:** <https://discuss.python.org/t/os-pidfd-open-missing/110186>\
**Category:** Python Help\
**Tags:** help, stdlib\
**Created:** [November 19, 2026, 5:44am UTC](https://discuss.python.org/t/os-pidfd-open-missing/110186 "2026-11-19T05:44:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinBonner](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@MartinBonner](https://discuss.python.org/u/MartinBonner)\
**Post date:** [November 19, 2026, 5:44am UTC](https://discuss.python.org/t/os-pidfd-open-missing/110186/1 "2026-11-19T05:44:00Z")

</div>

`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 _why_ `pidfd_open` is missing? Or can you suggest any diagnostics I can gather to help diagnose the problem?

---

<div class="post-metadata">

**Author:** ![BowlOfRed](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bowlofred/32/3379_2.png) [@BowlOfRed](https://discuss.python.org/u/BowlOfRed)\
**Post date:** [November 19, 2026, 8:18am UTC](https://discuss.python.org/t/os-pidfd-open-missing/110186/2 "2026-11-19T08:18:11Z")

</div>

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.

```python
import ctypes, os
libc = ctypes.CDLL(None, use_errno=True)
fd = libc.syscall(434, os.getpid(), 0)
if fd >= 0:
    print(f"Success, fd:{fd}")
else:
    print(f"Unsupported, errno: {ctypes.get_errno()}")

```

---

<div class="post-metadata">

**Author:** ![MartinBonner](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@MartinBonner](https://discuss.python.org/u/MartinBonner)\
**Post date:** [November 19, 2026, 8:18am UTC](https://discuss.python.org/t/os-pidfd-open-missing/110186/3 "2026-11-19T08:18:25Z")

</div>

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.
