MCPcopy Index your code
hub / github.com/python/cpython / can_use_pidfd

Function can_use_pidfd

Lib/asyncio/unix_events.py:953–962  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

951 self._threads.pop(expected_pid)
952
953def can_use_pidfd():
954 if not hasattr(os, 'pidfd_open'):
955 return False
956 try:
957 pid = os.getpid()
958 os.close(os.pidfd_open(pid, 0))
959 except OSError:
960 # blocked by security policy like SECCOMP
961 return False
962 return True
963
964
965class _UnixDefaultEventLoopPolicy(events._BaseDefaultEventLoopPolicy):

Callers 1

__init__Method · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…