VMS Help  —  CRTL  nice
    Increases or decreases process priority relative to the process
    current priority by the amount of the argument. This function is
    nonreentrant.

    Format

      #include  <unistd.h>

      int nice  (int increment);

1  –  Argument

 increment

    As a positive argument, decreases priority; as a negative
    argument, increases priority. Issuing nice(0) restores the
    base priority. The resulting priority cannot be less than 1,
    or greater than the process's base priority. If it is, the nice
    function quietly does nothing.

2  –  Description

    When a process calls the vfork function, the resulting child
    inherits the parent's priority.

    With the DECC$ALLOW_UNPRIVILEGED_NICE feature logical enabled,
    the nice function exhibits its legacy behavior of not checking
    the privilege of the calling process (that is, any user may lower
    the nice value to increase process priorities). Also, when the
    caller sets a priority above MAX_PRIORITY, the nice value is set
    to the base priority.

    With DECC$ALLOW_UNPRIVILEGED_NICE disabled, the nice function
    conforms to the X/Open standard of checking the privilege of the
    calling process (only users with ALTPRI privilege can lower the
    nice value to increase process priorities), and when the caller
    sets a priority above MAX_PRIORITY, the nice value is set to MAX_
    PRIORITY.

    See also vfork.

3  –  Return Values

    0                  Indicates success.
    -1                 Indicates failure.
Close Help