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

Function get_cid

Lib/test/test_socket.py:94–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 return decorator
93
94def get_cid():
95 if fcntl is None:
96 return None
97 if not hasattr(socket, 'IOCTL_VM_SOCKETS_GET_LOCAL_CID'):
98 return None
99 try:
100 with open("/dev/vsock", "rb") as f:
101 r = fcntl.ioctl(f, socket.IOCTL_VM_SOCKETS_GET_LOCAL_CID, " ")
102 except OSError:
103 return None
104 else:
105 return struct.unpack("I", r)[0]
106
107def _have_socket_can():
108 """Check whether CAN sockets are supported on this host."""

Callers 3

_have_socket_vsockFunction · 0.85
setUpMethod · 0.85
clientSetUpMethod · 0.85

Calls 2

unpackMethod · 0.80
openFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…