bpo-31904: Support signal module on VxWorks (GH-23391)
This commit is contained in:
parent
5c73afc36e
commit
1244c816d7
|
@ -519,10 +519,14 @@ class WakeupSocketSignalTests(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
write.setblocking(False)
|
write.setblocking(False)
|
||||||
|
|
||||||
|
written = 0
|
||||||
|
if sys.platform == "vxworks":
|
||||||
|
CHUNK_SIZES = (1,)
|
||||||
|
else:
|
||||||
# Start with large chunk size to reduce the
|
# Start with large chunk size to reduce the
|
||||||
# number of send needed to fill the buffer.
|
# number of send needed to fill the buffer.
|
||||||
written = 0
|
CHUNK_SIZES = (2 ** 16, 2 ** 8, 1)
|
||||||
for chunk_size in (2 ** 16, 2 ** 8, 1):
|
for chunk_size in CHUNK_SIZES:
|
||||||
chunk = b"x" * chunk_size
|
chunk = b"x" * chunk_size
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
@ -595,6 +599,7 @@ class WakeupSocketSignalTests(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
|
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
|
||||||
|
@unittest.skipUnless(hasattr(signal, 'siginterrupt'), "needs signal.siginterrupt()")
|
||||||
class SiginterruptTest(unittest.TestCase):
|
class SiginterruptTest(unittest.TestCase):
|
||||||
|
|
||||||
def readpipe_interrupted(self, interrupt):
|
def readpipe_interrupted(self, interrupt):
|
||||||
|
@ -680,6 +685,8 @@ class SiginterruptTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
|
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
|
||||||
|
@unittest.skipUnless(hasattr(signal, 'getitimer') and hasattr(signal, 'setitimer'),
|
||||||
|
"needs signal.getitimer() and signal.setitimer()")
|
||||||
class ItimerTest(unittest.TestCase):
|
class ItimerTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.hndl_called = False
|
self.hndl_called = False
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Support signal module on VxWorks.
|
|
@ -120,7 +120,11 @@ static volatile struct {
|
||||||
#else
|
#else
|
||||||
#define INVALID_FD (-1)
|
#define INVALID_FD (-1)
|
||||||
static volatile struct {
|
static volatile struct {
|
||||||
|
#ifdef __VXWORKS__
|
||||||
|
int fd;
|
||||||
|
#else
|
||||||
sig_atomic_t fd;
|
sig_atomic_t fd;
|
||||||
|
#endif
|
||||||
int warn_on_full_buffer;
|
int warn_on_full_buffer;
|
||||||
} wakeup = {.fd = INVALID_FD, .warn_on_full_buffer = 1};
|
} wakeup = {.fd = INVALID_FD, .warn_on_full_buffer = 1};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue