Skip to content

Commit aabb794

Browse files
committed
Test pidfd_open availability on GNU/Linux builds
Verify that building against the modern Linux UAPI headers enables os.pidfd_open on GNU/Linux targets.
1 parent 35b465c commit aabb794

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pythonbuild/disttests/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,13 @@ def test_socket_af_vsock(self):
352352
self.assertTrue(hasattr(socket, "AF_VSOCK"))
353353
self.assertEqual(socket.AF_VSOCK, 40)
354354

355+
@unittest.skipUnless(
356+
"-linux-gnu" in os.environ["TARGET_TRIPLE"],
357+
"modern kernel UAPI headers are currently enabled for Linux GNU targets",
358+
)
359+
def test_os_pidfd_open(self):
360+
self.assertTrue(hasattr(os, "pidfd_open"))
361+
355362
def test_linux_uapi_not_in_sysconfig(self):
356363
import sysconfig
357364

0 commit comments

Comments
 (0)