Skip to content

bpo-31904: support signal module for VxWorks #23391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

pxinwr
Copy link
Contributor

@pxinwr pxinwr commented Nov 19, 2020

  1. There are some discussion about "sig_atomic_t fd;" in PR 12670. POSIX spec doesn't define its type. In practice, most implementation defines it as int. Go to Atomic-Types So far it works fine on known OSes. However, on VxWorks, sig_atomic_t is defined as 'unsigned char'. Assigning it to -1 will have problem. So we define wakeup.fd as int specially for VxWorks.
  2. VxWorks has no getitimer() and setitimer() C api available. So skipping the test on VxWorks.

https://bugs.python.org/issue31904

@@ -0,0 +1,3 @@
Put news entry `blurb`_ files for the *VxWorks* section in this directory.

.. _blurb: https://pypi.org/project/blurb/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to not add a new blurb category just for VxWorks. Would you mind to reuse the Library category?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine. Fixed accordingly.

else:
# Start with large chunk size to reduce the
# number of send needed to fill the buffer.
for chunk_size in (2 ** 16, 2 ** 8, 1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to not copy/paste the code, restrict the difference to the loop. Something like:

Suggested change
for chunk_size in (2 ** 16, 2 ** 8, 1):
if sys.platform == "vxworks":
CHUNK_SIZES = (1,)
else:
CHUNK_SIZES = (2 ** 16, 2 ** 8, 1)
for chunk_size in CHUNK_SIZES:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better solution. Changed.

@vstinner
Copy link
Member

Merged, thanks. The updated PR is simpler.

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@pxinwr pxinwr deleted the fix-issue-31904-signal branch May 7, 2021 07:42
@kuhlenough kuhlenough mannequin mentioned this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants