Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
2 changes: 2 additions & 0 deletions Doc/library/resource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ this module for those platforms.
``setrlimit`` may also raise :exc:`error` if the underlying system call
fails.

VxWorks only support setting RLIMIT_NOFILE and idtype must be P_PID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"supports" with a S, no? (I'm not sure, English is not my first language!) Please use :data: to format properly the RLIMIT_NOFILE constant.

Suggested change
VxWorks only support setting RLIMIT_NOFILE and idtype must be P_PID.
VxWorks only supports setting :data:`RLIMIT_NOFILE` and idtype must be P_PID.

I don't understand "idtype must be P_PID": what does it mean? Is it something specific to VxWorks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's VxWorks specific requires.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I remove that statements for python user doesn't need to care about it.


.. function:: prlimit(pid, resource[, limits])

Combines :func:`setrlimit` and :func:`getrlimit` in one function and
Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def test_args(self):
self.assertRaises(TypeError, resource.setrlimit)
self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42)

@unittest.skipIf(sys.platform == "vxworks",
"setting RLIMIT_FSIZE is not supported on VxWorks")
def test_fsize_ismax(self):
try:
(cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
Expand Down Expand Up @@ -110,6 +112,8 @@ def test_getrusage(self):
pass

# Issue 6083: Reference counting bug
@unittest.skipIf(sys.platform == "vxworks",
"setting RLIMIT_CPU is not supported on VxWorks")
def test_setrusage_refcount(self):
try:
limits = resource.getrlimit(resource.RLIMIT_CPU)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Skip setting RLIMIT_FSIZE and RLIMIT_CPU test case for VxWorks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please move this NEWS entry to the Misc/NEWS.d/next/Tests/ directory, and mention the name of the fixed test, for example:

Port test_resource to VxWorks: skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU.