Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setpriority(2) — DG/UX 5.4.2A

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fork(2)

nice(2)



setpriority(2)                   DG/UX 5.4.2                  setpriority(2)


NAME
       setpriority - set process scheduling priority

SYNOPSIS
       #include <sys/resource.h>

       int  setpriority (which, who, prio)
       int  which;
       int  who;
       int  prio;

   where:
       which     How the argument who is to be interpreted in identifying
                 one or more processes whose priorities will be set:
                 PRIO_PROCESS, PRIO_PGRP, or PRIO_USER

       who       Identifier of one or more processes whose priorities will
                 be set: a process ID, a process group ID, or user ID,
                 depending on the value of which

       prio      The new priority value

DESCRIPTION
       One or more processes are identified by the combination of the
       arguments which and who.  If which is PRIO_PROCESS, who is
       interpreted as a process ID and a single process is identified.  If
       which is PRIO_PGRP, who is interpreted as a process group ID, and all
       processes that are members of that group are identified.  If which is
       PRIO_USER, who is interpreted as a user ID, and all processes with an
       effective user id of who are identified.  A who value of 0 is
       interpreted as the calling process's process ID, process group ID,
       and effective-user-id, respectively, for the three cases listed.  For
       example, all processes in the calling process's process group may be
       identified with which set to PRIO_PGRP and who set to zero.

       The setpriority call sets the priorities of all the identified
       processes to prio, subject to the access control constraints
       described below.  The access checks are applied to each process in
       the identified set.  If one or more processes fail the checks,
       setpriority still changes the priority of those processes that pass
       the checks, but the error return value will be given.

ACCESS CONTROL
       In order to set a process's priority to a larger numerical value
       (less favorable scheduling) or leave it unchanged, the calling
       process must have an effective-user-id that is 0 or that matches the
       target process's effective-user-id.

       In order to set a process's priority to a smaller numerical value,
       the calling process must have an effective-user-id that is 0.

RETURN VALUE
       0      Successful completion.




Licensed material--property of copyright holder(s)                         1




setpriority(2)                   DG/UX 5.4.2                  setpriority(2)


       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       ESRCH     Using the which and who values specified, no processes were
                 located at all, or if any processes were located, none
                 passed the access checks.

       EINVAL    Which was not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER.

       EACCES    One or more (but not all) of the processes in the
                 identified set did not pass the access checks described
                 above.

SEE ALSO
       fork(2), nice(2).








































Licensed material--property of copyright holder(s)                         2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026