mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-38692: Add os.pidfd_open. (GH-17063)
This commit is contained in:
parent
56698d5769
commit
6c4c45efae
6 changed files with 94 additions and 1 deletions
|
@ -1470,6 +1470,15 @@ class PosixTester(unittest.TestCase):
|
|||
open(fn, 'wb').close()
|
||||
self.assertRaises(ValueError, os.stat, fn_with_NUL)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "pidfd_open"), "pidfd_open unavailable")
|
||||
def test_pidfd_open(self):
|
||||
with self.assertRaises(OSError) as cm:
|
||||
os.pidfd_open(-1)
|
||||
if cm.exception.errno == errno.ENOSYS:
|
||||
self.skipTest("system does not support pidfd_open")
|
||||
self.assertEqual(cm.exception.errno, errno.EINVAL)
|
||||
os.close(os.pidfd_open(os.getpid(), 0))
|
||||
|
||||
class PosixGroupsTester(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue