Skip to content

bpo-31904 : Add support for VxWorks RTOS #4184

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

Closed
wants to merge 221 commits into from
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
10d4405
patch configure for VxWorks
kuhlenough Sep 15, 2017
9d53ef2
Any version of python should be OK for cross build.
kuhlenough Sep 15, 2017
db2e0e8
undef DATE TIME for VxWorks
kuhlenough Sep 17, 2017
cb3aa97
limited signal feilds in VxWorks
kuhlenough Sep 17, 2017
1939a13
bpo-31904 : Python should support VxWorks RTOS
kuhlenough Sep 15, 2017
9a92b63
What's new file for bpo-30914
kuhlenough Oct 31, 2017
e997ecc
**install** and **commoninstall** targets do not include shared libra…
kuhlenough Oct 31, 2017
7faa281
revert Makefile.pre.in static build changes
kuhlenough Nov 1, 2017
98d3bdf
Merge branch 'master' of https://github.com/kuhlenough/cpython
kuhlenough Nov 1, 2017
249794c
EOL whitespace removal
kuhlenough Nov 1, 2017
8bab325
Remove space
kuhlenough Nov 3, 2017
21457f7
revert change
kuhlenough Nov 3, 2017
b6c9012
Merge branch 'master' of https://github.com/kuhlenough/cpython
kuhlenough Nov 9, 2017
809b73a
whitespace
kuhlenough Nov 9, 2017
847515f
Merge remote-tracking branch 'upstream/master'
kuhlenough Nov 9, 2017
4abb38d
pull review changes
kuhlenough Nov 9, 2017
08d4b40
Merge branch 'master' of https://github.com/kuhlenough/cpython
kuhlenough Nov 9, 2017
c8c322c
VxWorks has no h_errno reworked
kuhlenough Nov 9, 2017
fd303e0
Ignor readelf cross-compile error with VxWorks
kuhlenough Nov 9, 2017
93dca1b
ssl detections differences with varibles
kuhlenough Nov 9, 2017
288e627
fix indent with patchcheck
kuhlenough Nov 9, 2017
c768168
add VxWorks support for os_cpu_count, spawnv, spawnve
kuhlenough Nov 10, 2017
e7bf7e3
Merge branch 'master' of https://github.com/kuhlenough/cpython
kuhlenough Nov 10, 2017
f4b41a9
Don't build or install shared libraries if
kuhlenough Nov 18, 2017
f94b66a
Merge remote-tracking branch 'upstream/master'
kuhlenough Nov 18, 2017
2b16c82
Restore mathlib() so VxWorks build doesn't fail looking for libm
kuhlenough Nov 19, 2017
215bc2e
Reverse ifeq HAVE_DYNAMIC_LOADING logic in Makefile.pre.in
kuhlenough Nov 22, 2017
6921cf8
Merge remote-tracking branch 'upstream/master'
kuhlenough Dec 27, 2017
e62ed36
fix review issues
kuhlenough Dec 27, 2017
0861635
regenerated clinic/posixmodule.c.h
kuhlenough Dec 31, 2017
4d9158a
Merge remote-tracking branch 'upstream/master'
kuhlenough Dec 31, 2017
c6d7110
test
Jan 9, 2018
760da7a
record changes before I remove test code
Jan 15, 2018
1a0786f
wut
Jan 15, 2018
9752833
compiles
Jan 15, 2018
aeb5a6d
remove test files
Jan 15, 2018
dd24c10
remove unessecary files
Jan 15, 2018
e83c1d8
remove files
Jan 15, 2018
f1e3e72
fix setup.py
Jan 15, 2018
29c94e6
add PyList to char** code
Jan 16, 2018
4a59407
successfully exposed rtpSpawn
Jan 16, 2018
cf0fdd7
fixstuff
Jan 18, 2018
233711d
fix conflicts
Jan 18, 2018
a290567
configure changed
Jan 18, 2018
aa2e09f
not sure
Jan 18, 2018
18463dd
Fix static linking extensions
pablogsal Jan 21, 2018
db70b18
Add test for building extensions as builtins
pablogsal Jan 21, 2018
dd55e39
Add more extensions to the test
pablogsal Jan 21, 2018
0ad214f
Fix Windows Build
pablogsal Jan 21, 2018
7058513
Fix tests
Jan 23, 2018
a6e829f
stage before merging bpo32232
Jan 23, 2018
9a9e4c6
fix merge conflicts
Jan 23, 2018
ec4c065
Merge branch 'pablogsal-bpo32232' into oscar
Jan 23, 2018
1a3e146
Merge remote-tracking branch 'upstream/master'
kuhlenough Jan 23, 2018
4ec2302
refix os.pipe
Jan 23, 2018
fdda86b
temp
Jan 24, 2018
b73d9a5
Merge branch 'master' of https://github.com/python/cpython into oscar
Jan 24, 2018
e660837
fix random things
Jan 24, 2018
e4b940f
fixed root of bug
Jan 24, 2018
1e9e98c
add random support for vxworks
Jan 24, 2018
0d014f4
wat
Jan 26, 2018
228058d
fix leaking fds"
Jan 26, 2018
7fdefac
bpo-32726: Build macOS 10.9+ installer with private copy of Tcl/Tk 8.6
ned-deily Jan 30, 2018
9561d7f
Update NEWS, docs, and patchlevel for 3.7.0b1
ned-deily Jan 30, 2018
a582432
need to remove debug messages later
Jan 31, 2018
f5f8a74
finished 3.7.0b1 - on to b1+
ned-deily Jan 31, 2018
209108b
bpo-32727: smtplib's SMTP.send_message behaves differently with from_…
matrixise Jan 31, 2018
57750be
bpo-30693: zip+tarfile: sort directory listing (#2263)
bmwiedemann Jan 31, 2018
86fdad0
bpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)
zhangyangyu Jan 31, 2018
f3da70f
Make site documentation more clear (#5461)
zhangyangyu Jan 31, 2018
70e3042
bpo-32735: Fix typo in f-strings datetime format specifier example (G…
csabella Jan 31, 2018
7f38637
Update Doc build for split off of 3.7 branch
ned-deily Jan 31, 2018
4d65430
bpo-32565: Add missed versionadded directives for all new opcodes. (G…
miss-islington Feb 1, 2018
78758f2
[3.7] bpo-32711: Fix warnings for Python/ast_unparse.c (GH-5426) (#5475)
miss-islington Feb 1, 2018
71a0b0e
Implement TimerHandle.when() (GH-5473) (GH-5480)
miss-islington Feb 1, 2018
5d2dcd0
Fix typo in hamt.c comments (GH-5478) (#5484)
miss-islington Feb 2, 2018
7876778
bpo-32436: Fix compiler warning (GH-5483) (GH-5486)
miss-islington Feb 2, 2018
e985afc
bpo-32674: Improve the docstring for __import__ (GH-5339) (GH-5488)
miss-islington Feb 2, 2018
709f6ad
bpo-32733: Make test_coroutines robust against -Werror (GH-5487) (GH-…
miss-islington Feb 2, 2018
29fd9ea
Revert "bpo-31356: Add context manager to temporarily disable GC GH-5…
miss-islington Feb 2, 2018
9ea42d2
test
Feb 2, 2018
c7de1d7
bpo-32614: Modify re examples to use a raw string to prevent warning …
miss-islington Feb 2, 2018
2b5937e
bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) (…
miss-islington Feb 2, 2018
a23d30f
bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)
warsaw Feb 3, 2018
f33eced
bpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (GH…
miss-islington Feb 3, 2018
52f7458
bpo-32739: Show default value for rotate() (GH-5485) (GH-5514)
miss-islington Feb 3, 2018
e86db34
[3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)
miss-islington Feb 4, 2018
133514e
bpo-32720: Fixed the definition for width and precision in format min…
miss-islington Feb 4, 2018
1a0239e
[3.7] bpo-32691: Use mod_spec.parent when running modules with pdb (G…
miss-islington Feb 4, 2018
e6499a0
Use assertTrue() instead of deprecated assert_(). (GH-5526) (GH-5527)
miss-islington Feb 4, 2018
5c5e61b
Fix typo -- missing "not" (GH-5528) (GH-5530)
miss-islington Feb 4, 2018
5b933aa
bpo-32765: Update configdialog General tab create page docstring (GH-…
miss-islington Feb 4, 2018
4abcbc0
bpo-30928: IDLE - update NEWS.txt. (GH-5539) (GH-5540)
miss-islington Feb 5, 2018
fea0a12
[3.7] bpo-8722: Document __getattr__ behavior with AttributeError in …
miss-islington Feb 5, 2018
2bb0bfa
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-556…
miss-islington Feb 6, 2018
9197e5d
add timeout
Feb 6, 2018
2c6f668
bpo-30693: Fix tarfile test cleanup on MSWindows (GH-5557) (GH-5567)
miss-islington Feb 6, 2018
4e7a964
bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (…
miss-islington Feb 7, 2018
a702f6b
Fix typo in whatsnew/3.7.rst (GH-5551) (GH-5553)
miss-islington Feb 7, 2018
a747cf6
bpo-32720: Fixed the replacement field grammar documentation. (GH-554…
miss-islington Feb 7, 2018
e1f0fd9
test
Feb 7, 2018
9dad132
change char to wchar
Feb 8, 2018
ad3997c
bpo-32802: Fix Travis build (GH-5589) (GH-5590)
miss-islington Feb 8, 2018
fbe4165
fix problem with sysroot addition;
Feb 8, 2018
ac8e483
Merge branch 'master' into oscar
Feb 8, 2018
73aaf36
add vxwapi as shared lib
Feb 8, 2018
105fcbf
bpo-32585: Add tkinter.ttk.Spinbox. (GH-5221) (GH-5592)
miss-islington Feb 9, 2018
0e36173
bpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-…
miss-islington Feb 9, 2018
3a047a7
Make formatting of some return codes conforming to the general style.…
miss-islington Feb 9, 2018
7df8049
Fix some warnings produced by different compilers. (GH-5593) (GH-5600)
miss-islington Feb 9, 2018
b82e97b
Shared Libs finalyl works! site.py had a abspath function that needed…
Feb 9, 2018
2ef69a1
bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5602)
miss-islington Feb 9, 2018
e39429a
travis: Use -O3 option (GH-5599)
miss-islington Feb 10, 2018
e603320
bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609…
miss-islington Feb 10, 2018
170b3f7
bpo-32792: Preserve mapping order in ChainMap() (GH-5586) (#GH-5617)
miss-islington Feb 11, 2018
a0b998d
bpo-11015: Update test.support documentation (GH-5619)
miss-islington Feb 11, 2018
fe61e8d
bpo-32604: Make _xxsubinterpreters build on Windows (GH-5624)
miss-islington Feb 11, 2018
40f7d9a
[3.7] Add short-circuit for doc changes to AppVeyor (GH-5626)
zware Feb 11, 2018
09df4b7
Fix AppVeyor doc short-circuit (GH-5633)
miss-islington Feb 11, 2018
ba4f218
bpo-32815: Improve docs on the subprocess API *text* parameter (GH-56…
miss-islington Feb 11, 2018
972edd9
Fix typo in Include/objimpl.h, the word "has" was missing (GH-5568) (…
miss-islington Feb 12, 2018
7041c76
remove debug messages; add def for gethostbyaddr
Feb 12, 2018
85f315b
remove broken ifdef
Feb 12, 2018
83b8cd8
fix static builds
Feb 12, 2018
0442599
bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (G…
miss-islington Feb 12, 2018
38b4dd7
bpo-32826: Add "encoding=utf-8" to open() in idle_test/test_help_abou…
miss-islington Feb 12, 2018
74ebbae
bpo-29248: Fix os.readlink() on Windows (GH-5577)
miss-islington Feb 12, 2018
65c32bb
bpo-32837: IDLE - require encoding argument for textview.view_file. (…
miss-islington Feb 12, 2018
09819ef
bpo-32827: Fix usage of _PyUnicodeWriter_Prepare() in decoding errors…
miss-islington Feb 13, 2018
53374cc
bpo-30579: Docs for dynamic traceback creation (GH-5653)
miss-islington Feb 13, 2018
9b5a90b
bpo-32370: Use the correct encoding for ipconfig output in the uuid m…
miss-islington Feb 13, 2018
ef20abe
bpo-31787: Prevent refleaks when calling __init__() more than once (G…
miss-islington Feb 13, 2018
e81a6c8
bpo-31787: Skip refleak check when _hashlib is not available (GH-5660)
miss-islington Feb 13, 2018
2e8d900
bpo-27846: Delete incorrect note in base64 docs (GH-5666)
miss-islington Feb 14, 2018
deab193
remove mercurial dot files (GH-5558)
miss-islington Feb 14, 2018
8e29fd4
Fix installation instructions for *nix (GH-5605)
miss-islington Feb 14, 2018
8caee0f
bpo-32841: Fix cancellation in awaiting asyncio.Condition (GH-5665)
miss-islington Feb 14, 2018
7bc49fb
actually fix wrong module builds whne converting to use _vxworks inst…
Feb 14, 2018
f0616ce
Update comment in posixmodule.c (GH-5681)
miss-islington Feb 14, 2018
960dec6
link the proper alloca for ctypes
Feb 14, 2018
f26b019
Update and sync importlib.resources documentation (GH-5694) (#5697)
miss-islington Feb 16, 2018
af6eaae
bpo-32436: Add docs for contextvars (GH-5685)
miss-islington Feb 16, 2018
7b76b99
add proper include flags for openssl build
Feb 16, 2018
803e1a5
Correct the code example in Python 3.7's What's New (GH-5696)
miss-islington Feb 16, 2018
5588990
VxWorks doesnt support O_NONBLOCK Flag
Feb 16, 2018
3db05a3
bpo-32604: Clean up created subinterpreters before runtime finalizati…
miss-islington Feb 17, 2018
0f76411
bpo-32860: Fix a missing asterisk in the documentation for glob.iglob…
miss-islington Feb 17, 2018
025544a
DOC: fix documentation for copyright and credits (GH-5706)
miss-islington Feb 17, 2018
afb5e55
bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)
miss-islington Feb 17, 2018
aeb5d73
Fix a typo in asyncio docs (GH-5721)
miss-islington Feb 17, 2018
d5be8e1
bpo-30638: Add clinic to `make regen-all` (GH-5671)
miss-islington Feb 18, 2018
fa9a502
[3.7] Improves the ability to build in CI (GH-5729)
miss-islington Feb 18, 2018
7da582d
Clean up Travis config (GH-5727)
miss-islington Feb 18, 2018
3892899
bpo-31333: Re-implement ABCMeta in C (GH-5733)
ilevkivskyi Feb 18, 2018
0442de5
bpo-25988: Emit a warning when use or import ABCs from 'collections'.…
ilevkivskyi Feb 18, 2018
2e84e47
bpo-25988: add NEWS entry for 3.7.0b2 (#5743)
ned-deily Feb 18, 2018
ca82e3c
bpo-32869: Fix incorrect dst buffer size for MultiByteToWideChar (GH-…
miss-islington Feb 18, 2018
034a945
bpo-31333: Fix typo in whatsnew/3.7.rst (GH-5744)
miss-islington Feb 18, 2018
19b7f66
bpo-31972: Improve docstrings for pathlib classes (GH-5310)
miss-islington Feb 19, 2018
2072c80
Improve error message for "setup.py upload" without dist files (GH-21…
miss-islington Feb 19, 2018
0cd3581
bpo-32682: Improve libz version parsing in test_zilb (GH-5347)
miss-islington Feb 19, 2018
622a824
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
miss-islington Feb 19, 2018
a3d6c1b
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5765)
miss-islington Feb 20, 2018
bab4fe3
closes bpo-32859: Don't retry dup3() if it is not available at runtim…
miss-islington Feb 20, 2018
1d927d4
bpo-31848: Fix broken error handling in Aifc_read.initfp() when the S…
miss-islington Feb 20, 2018
eed3c7a
bpo-32604: Swap threads only if the interpreter is different. (gh-5783)
miss-islington Feb 21, 2018
98a86cb
bpo-32540: Update venv documentation (GH-5736)
miss-islington Feb 21, 2018
7452f6d
bpo-28886: doc: Move deprecated abc decorators to separate section (G…
miss-islington Feb 21, 2018
e5d38de
bpo-32008: don't use PROTOCOL_TLSv1 in example (GH-5789)
miss-islington Feb 21, 2018
69607b4
bpo-32889: update valgrind suppressions (GH-5779)
miss-islington Feb 21, 2018
c59bc98
bpo-32874: IDLE: add tests for pyparse (GH-5755)
miss-islington Feb 22, 2018
bc2e110
closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)
miss-islington Feb 22, 2018
dfa1144
bpo-32905: IDLE - remove unused code in pyparse module (GH-5807)
miss-islington Feb 22, 2018
01dd52f
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdis…
miss-islington Feb 22, 2018
e5a9b35
bpo-32457: Improves handling of denormalized executable path when lau…
miss-islington Feb 22, 2018
b4c6bdc
merge
Feb 22, 2018
21fb278
fix redef issue with NONE in _pickle
Feb 22, 2018
640cce7
increase subprocess size
Feb 26, 2018
f64606e
remove all debug messages
Feb 26, 2018
8f2516a
fix broken else
Feb 28, 2018
d16ad7f
move subprocess pipe duplicate into more reasonable placeds and repla…
Feb 28, 2018
bf0607a
fix bug with spawned subprocess not closing p2cwrite
Mar 1, 2018
785ced6
restore correct path after spawning subprocess
Mar 2, 2018
084256d
switch default encoding to ascii
Mar 2, 2018
7d62768
fix hash randomization at initialization
Mar 2, 2018
dd7460b
skip some test cases
Mar 2, 2018
61490c0
ensure correct openssl libs included
Mar 5, 2018
4ca9f18
forgot test
Mar 6, 2018
8092657
keep fixing test cases
Mar 21, 2018
22701dd
lost a days worth of work cuz forgot to push before rebuild >.>, this…
Mar 22, 2018
768c619
skip osfork tests
Mar 22, 2018
36b0634
whoops on beginswith
Mar 22, 2018
0ba5ab7
skip ssl tests if vxworks
Mar 27, 2018
dc42724
idk
Mar 27, 2018
c79857f
expose and use vxworks pathIsAbsolute
Mar 28, 2018
cdaa817
realpath is currently broken
Mar 28, 2018
217b2d9
fix random
Apr 5, 2018
61a4f27
keep fixing test modules
Apr 9, 2018
92465c7
keep fixing path issues
Apr 10, 2018
0461bda
skip test
Apr 10, 2018
72b343d
fixed select blocking
Apr 10, 2018
f569783
fix last commit
Apr 10, 2018
8598648
yeah no select isnt fixed yet
Apr 10, 2018
875bb82
Merge pull request #2 from kuhlenough/oscar
kuhlenough Apr 16, 2018
addd1a0
Merge remote-tracking branch 'upstream/master'
kuhlenough Apr 16, 2018
37b7dc8
remove debug print
ooosssososos Apr 16, 2018
a74b6d6
Merge pull request #3 from kuhlenough/oscar
ooosssososos Apr 16, 2018
fc9529f
remove testing code
ooosssososos Apr 16, 2018
cc3d30b
remove testing code
ooosssososos Apr 16, 2018
df4b6ff
fixed the random problem in vxworks seeding
ooosssososos Apr 16, 2018
39e4d4e
change modificitation to skip
ooosssososos Apr 16, 2018
f2682d6
remove #endif
ooosssososos Apr 16, 2018
ddde264
Merge pull request #4 from kuhlenough/oscar
ooosssososos Apr 16, 2018
d0c89e4
Revert "Update Doc build for split off of 3.7 branch"
kuhlenough Apr 16, 2018
69ff954
Merge branch 'master' of https://github.com/kuhlenough/cpython
kuhlenough Apr 17, 2018
d5127ac
Revert "Fix static linking extensions"
kuhlenough Apr 17, 2018
d0ecc40
Revert "Fix Windows Build"
kuhlenough Apr 17, 2018
43aeefc
Revert "Add more extensions to the test"
kuhlenough Apr 17, 2018
0b620c4
revert linefeed changes
kuhlenough Apr 17, 2018
79f497a
Revert "Fix static linking extensions"
kuhlenough Apr 17, 2018
cbcfdf9
clean-up cruff
kuhlenough Apr 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Include/osdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ extern "C" {
#define DELIM L';'
#endif

#ifdef __VXWORKS__
#define DELIM L';'
#endif

/* Filename separator */
#ifndef SEP
#define SEP L'/'
Expand Down
4 changes: 4 additions & 0 deletions Include/symtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
#define SCOPE_OFFSET 11
#define SCOPE_MASK (DEF_GLOBAL | DEF_LOCAL | DEF_PARAM | DEF_NONLOCAL)

#ifdef __VXWORKS__
#undef LOCAL
#endif

#define LOCAL 1
#define GLOBAL_EXPLICIT 2
#define GLOBAL_IMPLICIT 3
Expand Down
1 change: 1 addition & 0 deletions Misc/NEWS.d/next/Build/2017-10-30.bpo-30914.brk.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow cross-build of VxWorks if --host=*-wrs-vxworks is passed to configure
8 changes: 6 additions & 2 deletions Modules/_multiprocessing/multiprocessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@
# define BOOL int
# define UINT32 uint32_t
# define INT32 int32_t
# define TRUE 1
# define FALSE 0
# ifndef TRUE
# define TRUE 1
# endif
# ifndef FALSE
# define FALSE 0
# endif
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't look correct to me. multiprocessing requires TRUE = 1. I think you should 'undef' the existing TRUE/FALSE and define what multiprocessing expects.

# define INVALID_HANDLE_VALUE (-1)
#endif

Expand Down
4 changes: 2 additions & 2 deletions Modules/clinic/posixmodule.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ os_execve(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames

#endif /* defined(HAVE_EXECV) */

#if (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV))
#if (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV)) || defined(__VXWORKS__)

PyDoc_STRVAR(os_spawnv__doc__,
"spawnv($module, mode, path, argv, /)\n"
Expand Down Expand Up @@ -1765,7 +1765,7 @@ os_spawnv(PyObject *module, PyObject **args, Py_ssize_t nargs)

#endif /* (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV)) */

#if (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV))
#if (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV)) || defined(__VXWORKS__)

PyDoc_STRVAR(os_spawnve__doc__,
"spawnve($module, mode, path, argv, env, /)\n"
Expand Down
3 changes: 3 additions & 0 deletions Modules/faulthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef __VXWORKS__
# include <ioLib.h>
#endif

/* Allocate at maximum 100 MiB of the stack to raise the stack overflow */
#define STACK_OVERFLOW_MAX_SIZE (100 * 1024 * 1024)
Expand Down
4 changes: 4 additions & 0 deletions Modules/fcntlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <stropts.h>
#endif

#ifdef __VXWORKS__
#include <ioLib.h> /* ioctl() */
#endif

/*[clinic input]
module fcntl
[clinic start generated code]*/
Expand Down
5 changes: 5 additions & 0 deletions Modules/getbuildinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include <stdio.h>
#endif

#ifdef __VXWORKS__
#undef DATE
#undef TIME
#endif

#ifndef DATE
#ifdef __DATE__
#define DATE __DATE__
Expand Down
41 changes: 35 additions & 6 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ corresponding Unix manual entries for more information on calls.");
#define HAVE_FSYNC 1
#define fsync _commit
#else
#ifndef __VXWORKS__
Copy link
Member

Choose a reason for hiding this comment

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

Are all of this function absent? It looks suspicious that all of them are grouped alphabetically.

Copy link
Author

Choose a reason for hiding this comment

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

A couple are present in some configurations of VxWorks, but following comment is dated.
"Unix functions that the configure script doesn't check for"
The automake configure script finds all these without issue. So a better change would be to simply remove all these and let automake do it's job. I'm just not prepared to regression test the 1/2 dozen other OS referenced in this section.

/* Unix functions that the configure script doesn't check for */
#define HAVE_EXECV 1
#define HAVE_FORK 1
Expand All @@ -184,6 +185,7 @@ corresponding Unix manual entries for more information on calls.");
#define HAVE_GETEUID 1
#define HAVE_GETGID 1
#define HAVE_GETPPID 1
#endif
#define HAVE_GETUID 1
#define HAVE_KILL 1
#define HAVE_OPENDIR 1
Expand Down Expand Up @@ -246,6 +248,19 @@ extern int lstat(const char *, struct stat *);

#endif /* !_MSC_VER */

#if defined(__VXWORKS__)
#include <vxCpuLib.h>
#include <rtpLib.h>
#define HAVE_RTPSPAWN 1
#ifndef _P_WAIT
#define _P_WAIT 3
#define _P_NOWAIT 2
#define _P_NOWAITO 1
#define _OLD_P_OVERLAY 0
#define _P_OVERLAY 0
#endif
#endif

#ifdef HAVE_UTIME_H
#include <utime.h>
#endif /* HAVE_UTIME_H */
Expand Down Expand Up @@ -4770,7 +4785,7 @@ os__exit_impl(PyObject *module, int status)
#define EXECV_CHAR char
#endif

#if defined(HAVE_EXECV) || defined(HAVE_SPAWNV)
#if defined(HAVE_EXECV) || defined(HAVE_SPAWNV) || defined (HAVE_RTPSPAWN)
static void
free_string_array(EXECV_CHAR **array, Py_ssize_t count)
{
Expand Down Expand Up @@ -4808,7 +4823,7 @@ fsconvert_strdup(PyObject *o, EXECV_CHAR **out)
}
#endif

#if defined(HAVE_EXECV) || defined (HAVE_FEXECVE)
#if defined(HAVE_EXECV) || defined (HAVE_FEXECVE) || defined (HAVE_RTPSPAWN)
static EXECV_CHAR**
parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
{
Expand Down Expand Up @@ -5079,7 +5094,7 @@ os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env)
#endif /* HAVE_EXECV */


#if defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV)
#if defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN)
/*[clinic input]
os.spawnv

Expand Down Expand Up @@ -5156,6 +5171,11 @@ os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv)
_Py_BEGIN_SUPPRESS_IPH
#ifdef HAVE_WSPAWNV
spawnval = _wspawnv(mode, path->wide, argvlist);
#elif defined (HAVE_RTPSPAWN)
spawnval = rtpSpawn(path->narrow, (const char **)argvlist,
NULL, 100, 0, 0, 0);
if ( (spawnval != RTP_ID_ERROR) && (mode == _P_WAIT) )
waitpid(spawnval, &spawnval, 0);
#else
spawnval = _spawnv(mode, path->narrow, argvlist);
#endif
Expand Down Expand Up @@ -5262,6 +5282,11 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
_Py_BEGIN_SUPPRESS_IPH
#ifdef HAVE_WSPAWNV
spawnval = _wspawnve(mode, path->wide, argvlist, envlist);
#elif defined (HAVE_RTPSPAWN)
spawnval = rtpSpawn(path->narrow, (const char **)argvlist,
(const char **)envlist, 100, 0, 0, 0);
if ( (spawnval != RTP_ID_ERROR) && (mode == _P_WAIT) )
waitpid(spawnval, &spawnval, 0);
#else
spawnval = _spawnve(mode, path->narrow, argvlist, envlist);
#endif
Expand Down Expand Up @@ -11150,7 +11175,9 @@ os_cpu_count_impl(PyObject *module)
ncpu = sysinfo.dwNumberOfProcessors;
}
#elif defined(__hpux)
ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL);
ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL);
#elif defined(__VXWORKS__)
ncpu = __builtin_popcount(vxCpuEnabledGet());
#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
ncpu = sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(__DragonFly__) || \
Expand Down Expand Up @@ -12933,11 +12960,13 @@ all_ins(PyObject *m)
if (PyModule_AddIntMacro(m, F_TEST)) return -1;
#endif

#ifdef HAVE_SPAWNV
#if defined(HAVE_SPAWNV) || defined (HAVE_RTPSPAWN)
if (PyModule_AddIntConstant(m, "P_WAIT", _P_WAIT)) return -1;
if (PyModule_AddIntConstant(m, "P_NOWAIT", _P_NOWAIT)) return -1;
if (PyModule_AddIntConstant(m, "P_OVERLAY", _OLD_P_OVERLAY)) return -1;
if (PyModule_AddIntConstant(m, "P_NOWAITO", _P_NOWAITO)) return -1;
#endif
#if defined(HAVE_SPAWNV)
if (PyModule_AddIntConstant(m, "P_OVERLAY", _OLD_P_OVERLAY)) return -1;
if (PyModule_AddIntConstant(m, "P_DETACH", _P_DETACH)) return -1;
#endif

Expand Down
7 changes: 7 additions & 0 deletions Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,11 +978,18 @@ fill_siginfo(siginfo_t *si)

PyStructSequence_SET_ITEM(result, 0, PyLong_FromLong((long)(si->si_signo)));
PyStructSequence_SET_ITEM(result, 1, PyLong_FromLong((long)(si->si_code)));
#ifdef __VXWORKS__
PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(0L));
PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(0L));
PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(0L));
PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(0L));
#else
PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si->si_errno)));
PyStructSequence_SET_ITEM(result, 3, PyLong_FromPid(si->si_pid));
PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
PyStructSequence_SET_ITEM(result, 5,
PyLong_FromLong((long)(si->si_status)));
#endif
#ifdef HAVE_SIGINFO_T_SI_BAND
PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
#else
Expand Down
22 changes: 16 additions & 6 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ if_indextoname(index) -- return the corresponding interface name\n\
# undef HAVE_GETHOSTBYNAME_R_6_ARG
#endif

#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__VXWORKS__)
# include <sys/uio.h>
#endif

Expand All @@ -181,6 +181,13 @@ if_indextoname(index) -- return the corresponding interface name\n\
# endif
#endif

#ifdef __VXWORKS__
# include <ipcom_sock2.h>
# define gethostbyaddr_r ipcom_gethostbyaddr_r
# define h_errno errno
# include <hostLib.h>
#endif

#if !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS)
# define USE_GETHOSTBYNAME_LOCK
#endif
Expand Down Expand Up @@ -525,7 +532,7 @@ set_error(void)
return PyErr_SetFromErrno(PyExc_OSError);
}


/*#ifndef __VXWORKS__ */
Copy link
Member

Choose a reason for hiding this comment

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

If this no longer needed, remove it.

static PyObject *
set_herror(int h_error)
{
Expand All @@ -543,7 +550,7 @@ set_herror(int h_error)

return NULL;
}

/* #endif */

static PyObject *
set_gaierror(int error)
Expand Down Expand Up @@ -896,7 +903,7 @@ init_sockobject(PySocketSockObject *s,
return 0;
}


#ifdef HAVE_SOCKETPAIR
/* Create a new socket object.
This just creates the object and initializes it.
If the creation fails, return NULL and set an exception (implicit
Expand All @@ -916,7 +923,7 @@ new_sockobject(SOCKET_T fd, int family, int type, int proto)
}
return s;
}

#endif

/* Lock to allow python interpreter to continue, but only allow one
thread to be in gethostbyname or getaddrinfo */
Expand Down Expand Up @@ -5419,6 +5426,7 @@ Return the service name from a port number and protocol name.\n\
The optional protocol name, if given, should be 'tcp' or 'udp',\n\
otherwise any protocol will match.");

#ifndef __VXWORKS__
/* Python interface to getprotobyname(name).
This only returns the protocol number, since the other info is
already known or not useful (like the list of aliases). */
Expand All @@ -5445,7 +5453,7 @@ PyDoc_STRVAR(getprotobyname_doc,
"getprotobyname(name) -> integer\n\
\n\
Return the protocol number for the named protocol. (Rarely used.)");

#endif

#ifndef NO_DUP
/* dup() function for socket fds */
Expand Down Expand Up @@ -6385,8 +6393,10 @@ static PyMethodDef socket_methods[] = {
METH_VARARGS, getservbyname_doc},
{"getservbyport", socket_getservbyport,
METH_VARARGS, getservbyport_doc},
#ifndef __VXWORKS__
{"getprotobyname", socket_getprotobyname,
METH_VARARGS, getprotobyname_doc},
#endif
#ifndef NO_DUP
{"dup", socket_dup,
METH_O, dup_doc},
Expand Down
5 changes: 5 additions & 0 deletions Modules/syslogmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ Revision history:

#include <syslog.h>

#ifndef LOG_UPTO
/* all priorities through pri */
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1)
#endif

/* only one instance, only one syslog, so globals should be ok */
static PyObject *S_ident_o = NULL; /* identifier, held by openlog() */
static char S_log_open = 0;
Expand Down
2 changes: 2 additions & 0 deletions Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,13 +1421,15 @@ PyInit_timezone(PyObject *m) {
#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__)
PyObject *otz0, *otz1;
tzset();
#ifndef __VXWORKS__
PyModule_AddIntConstant(m, "timezone", timezone);
Copy link
Member

Choose a reason for hiding this comment

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

Does timezone not exist? What about _timezone?

Copy link
Author

Choose a reason for hiding this comment

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

No timezone, no _timezone, you have to use tzset/tzget

#ifdef HAVE_ALTZONE
PyModule_AddIntConstant(m, "altzone", altzone);
#else
PyModule_AddIntConstant(m, "altzone", timezone-3600);
#endif
PyModule_AddIntConstant(m, "daylight", daylight);
#endif
otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape");
otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape");
PyModule_AddObject(m, "tzname", Py_BuildValue("(NN)", otz0, otz1));
Expand Down
4 changes: 4 additions & 0 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,10 @@ initfsencoding(PyInterpreterState *interp)
Py_FileSystemDefaultEncoding = "utf-8";
Py_FileSystemDefaultEncodeErrors = "surrogatepass";
}
#elif defined(__VXWORKS__)
{
Py_FileSystemDefaultEncoding = "ascii";
}
#else
if (Py_FileSystemDefaultEncoding == NULL)
{
Expand Down
Loading