Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FilePgetpriority()Psetpriority() GEMDOSSyntaxLONG Psetpriority( which, who, pri )
WORD which;
WORD who;
WORD pri;
Function Psetpriority() sets the current priority value for a process.
Opcode 345 (0x0159)
Availability Available when a 'MiNT' cookie with a version of at least
1.15 release is detected.
Parameters Psetpriority() sets the priority pri (not an increment but
an absolute value) for the processes specified by which and
who. The interpretation of parameter who depends on which:
PRIO_PROCESS 0 sets the priority of process with
process id which. A who of 0 implies the
process id of the calling process.
PRIO_PGRP 1 sets the priority of the process group
with process group id who. A who of 0
implies the process group id of the
calling process.
PRIO_USER 2 sets the priority of the process of the
user with user id who. A who of 0
implies the user id of the calling
process.
pri argument is silently changed to the maximum (resp.
minimum) possible value if it is not in the range between
PRIO_MIN (-20) and PRIO_MAX (+20).
Binding move.w pri,-(sp)
move.w who,-(sp)
move.w which,-(sp)
move.w #$0159,-(sp)
trap #1
addq.l #8,sp
Return Value The function returns E_OK on success or a negative error
code otherwise. The following error conditions are defined:
EINVAL, invalid argument for who, which or pri.
EACCES, the calling process is not an owner of one or more
of the selected processes. The other selected processes are
still affected.
EPERM, the calling process does not have privileges to change
the priority of one or more of the selected processes. This
can only happen if an attempt was made to change the priority
of a process to a positive value.
ESRCH, the combination of which and who does not match any
existing process.
The error condition reported is the last error condition
encountered (in other words if both EACCES and EPERM occur
the return value is arbitrary).
Comments This call makes calls Pnice() and Prenice() obsolete.
See Also Pgetpriority()