Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setprio.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setprio.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setprio.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setprio.html on line 8

setprio()

Set the priority of a process

Synopsis:

#include <sched.h>

int setprio( pid_t pid, 
             int prio );

Arguments:

pid
The process ID of the process whose priority you want to set.
prio
The new priority.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The setprio() function changes the priority of thread 1 of process pid to priority prio. If pid is zero, the priority of the calling thread is set.

Returns:

The previous priority, or -1 if an error occurred (errno is set).

Errors:

EINVAL
The priority prio isn't a valid priority.
EPERM
The calling process doesn't have sufficient privilege to set the priority.
ESRCH
The process pid doesn't exist.

Classification:

QNX 4

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

The getprio() and setprio() functions are included in the QNX Neutrino libraries for porting QNX 4 applications. For new programs, use sched_setparam() or pthread_setschedparam().

See also:

errno, getprio(), pthread_getschedparam(), pthread_setschedparam(), sched_getparam(), sched_get_priority_max(), sched_get_priority_min(), sched_getscheduler(), sched_setscheduler(), sched_yield()

Thread scheduling in the QNX Neutrino Microkernel chapter of the System Architecture guide

Scheduling algorithms in the Programming Overview chapter of the QNX Neutrino Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setprio.html on line 165

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setprio.html on line 165