ibmi: set the highest process priority to -10

On IBMi PASE, the highest process priority is -10.

PR-URL: https://github.com/libuv/libuv/pull/2642
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Xu Meng 2020-01-20 02:17:44 -06:00 committed by Richard Lau
parent 0e8ff951f3
commit d21f5aeab0
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C
2 changed files with 26 additions and 6 deletions

View File

@ -649,6 +649,16 @@ API
On Windows, setting `PRIORITY_HIGHEST` will only work for elevated user,
for others it will be silently reduced to `PRIORITY_HIGH`.
.. note::
On IBM i PASE, the highest process priority is -10. The constant
`UV_PRIORITY_HIGHEST` is -10, `UV_PRIORITY_HIGH` is -7,
`UV_PRIORITY_ABOVE_NORMAL` is -4, `UV_PRIORITY_NORMAL` is 0,
`UV_PRIORITY_BELOW_NORMAL` is 15 and `UV_PRIORITY_LOW` is 39.
.. note::
On IBM i PASE, you are not allowed to change your priority unless you
have the *JOBCTL special authority (even to lower it).
.. versionadded:: 1.23.0
.. c:function:: int uv_os_uname(uv_utsname_t* buffer)

View File

@ -1182,12 +1182,22 @@ UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd);
UV_EXTERN uv_pid_t uv_os_getpid(void);
UV_EXTERN uv_pid_t uv_os_getppid(void);
#define UV_PRIORITY_LOW 19
#define UV_PRIORITY_BELOW_NORMAL 10
#define UV_PRIORITY_NORMAL 0
#define UV_PRIORITY_ABOVE_NORMAL -7
#define UV_PRIORITY_HIGH -14
#define UV_PRIORITY_HIGHEST -20
#if defined(__PASE__)
/* On IBM i PASE, the highest process priority is -10 */
# define UV_PRIORITY_LOW 39 // RUNPTY(99)
# define UV_PRIORITY_BELOW_NORMAL 15 // RUNPTY(50)
# define UV_PRIORITY_NORMAL 0 // RUNPTY(20)
# define UV_PRIORITY_ABOVE_NORMAL -4 // RUNTY(12)
# define UV_PRIORITY_HIGH -7 // RUNPTY(6)
# define UV_PRIORITY_HIGHEST -10 // RUNPTY(1)
#else
# define UV_PRIORITY_LOW 19
# define UV_PRIORITY_BELOW_NORMAL 10
# define UV_PRIORITY_NORMAL 0
# define UV_PRIORITY_ABOVE_NORMAL -7
# define UV_PRIORITY_HIGH -14
# define UV_PRIORITY_HIGHEST -20
#endif
UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority);
UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority);