MCPcopy Create free account
hub / github.com/pexpect/pexpect / nonblock

Function nonblock

tests/platform_checks/check_handler.py:11–17  ·  view source on GitHub ↗
(fd)

Source from the content-addressed store, hash-verified

9GLOBAL_SIGCHLD_RECEIVED = 0
10
11def nonblock (fd):
12 # if O_NDELAY is set read() returns 0 (ambiguous with EOF).
13 # if O_NONBLOCK is set read() returns -1 and sets errno to EAGAIN
14 original_flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0)
15 flags = original_flags | os.O_NONBLOCK
16 fcntl.fcntl(fd, fcntl.F_SETFL, flags)
17 return original_flags
18
19def signal_handler (signum, frame):
20 print '<HANDLER>'

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…