code: def test_open(self):
      libc_name = find_library("c")
      if libc_name is None:
          raise unittest.SkipTest("Unable to find C library")
      libc = CDLL(libc_name, use_errno=True)
      if os.name == "nt":
          libc_open = libc._open
      else:
          libc_open = libc.open
  
      libc_open.argtypes = c_char_p, c_int
  
      self.assertEqual(libc_open("", 0), -1)
      self.assertEqual(get_errno(), errno.ENOENT)
  
      self.assertEqual(set_errno(32), errno.ENOENT)
      self.assertEqual(get_errno(), 32)
  
      if threading:
  
          def _worker():
              set_errno(0)
  
              libc = CDLL(libc_name, use_errno=False)
              if os.name == "nt":
                  libc_open = libc._open
              else:
                  libc_open = libc.open
              libc_open.argtypes = c_char_p, c_int
              self.assertEqual(libc_open("", 0), -1)
              self.assertEqual(get_errno(), 0)
  
          t = threading.Thread(target=_worker)
          t.start()
          t.join()
  
          self.assertEqual(get_errno(), 32)
          set_errno(0)
  
file_path: catboost/contrib/tools/python/src/Lib/ctypes/test/test_errno.py
imports: import unittest, os, errno
  from ctypes import *
  from ctypes.util import find_library
  from test import test_support
label_desc: Use image node_id 1 for calling the Test obj's underlying member method code with example usage: obj.test_open() without return types