FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-103545: Add macOS specific constants for ``os.setpriority`` to ``os`` by ronaldoussoren · Pull Request #104606 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .rst  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
11 changes: 11 additions & 0 deletions Doc/library/os.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,17 @@ process and user.
.. versionadded:: 3.3


.. data:: PRIO_DARWIN_THREAD
PRIO_DARWIN_PROCESS
PRIO_DARWIN_BG
PRIO_DARWIN_NONUI

Parameters for the :func:`getpriority` and :func:`setpriority` functions.

.. availability:: macOS

.. versionadded:: 3.12

.. function:: getresuid()

Return a tuple (ruid, euid, suid) denoting the current process's
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``os.PRIO_DARWIN_THREAD``, ``os.PRIO_DARWIN_PROCESS``, ``os.PRIO_DARWIN_BG`` and ``os.PRIO_DARWIN_NONUI``. These can be used with ``os.setpriority`` to run the process at a lower priority and make use of the efficiency cores on Apple Silicon systems.
12 changes: 12 additions & 0 deletions Modules/posixmodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15917,6 +15917,18 @@ all_ins(PyObject *m)
#ifdef PRIO_USER
if (PyModule_AddIntMacro(m, PRIO_USER)) return -1;
#endif
#ifdef PRIO_DARWIN_THREAD
if (PyModule_AddIntMacro(m, PRIO_DARWIN_THREAD)) return -1;
#endif
#ifdef PRIO_DARWIN_PROCESS
if (PyModule_AddIntMacro(m, PRIO_DARWIN_PROCESS)) return -1;
#endif
#ifdef PRIO_DARWIN_BG
if (PyModule_AddIntMacro(m, PRIO_DARWIN_BG)) return -1;
#endif
#ifdef PRIO_DARWIN_NONUI
if (PyModule_AddIntMacro(m, PRIO_DARWIN_NONUI)) return -1;
#endif
#ifdef O_CLOEXEC
if (PyModule_AddIntMacro(m, O_CLOEXEC)) return -1;
#endif
Expand Down

Back | FazBrowse Home | New Git URL