/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that changes the current process's priority
then prints the priority. */
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <unistd.h>


int main() {
    int who;
    int which = PRIO_PROCESS; /* get the priority of the specified process */
    int priority;
    
    who = getpid(); /* current process id */
    priority = getpriority(which,who);    /* current priority */
    printf(" The priority is %d \n", priority);
    nice(15);           /* change current priority to 15 */
    priority = getpriority(which,who);
    printf(" The priority is %d \n", priority);
}
