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/n/nice.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/n/nice.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/n/nice.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/n/nice.html on line 8

nice()

Change the priority of a process

Synopsis:

#include <unistd.h>

int  nice( int incr );

Arguments:

incr
The amount that you want to add to the process's priority.

Library:

libc

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

Description:

The nice() function allows a process to change its priority. The invoking process must be in a scheduling class that supports the operation.


Note: This function has no effect in any of the scheduling algorithms that QNX Neutrino supports. Use sched_setparam() or pthread_setschedparam() instead of this function.

The nice() function adds the value of incr to the nice value of the calling process. A process's nice value is a nonnegative number; a greater positive value results in a lower CPU priority.

A maximum nice value of 2 * NZERO - 1 and a minimum nice value of 0 are imposed by the system. NZERO is defined in <limits.h> with a default value of 20. If you request a value above or below these limits, the nice value is set to the corresponding limit. A nice value of 40 is treated as 39. Only a process with superuser privileges can lower the nice value.

Returns:

The new nice value minus NZERO. If an error occurred, -1 is returned, the process's nice value isn't changed, and errno is set.

Errors:

EINVAL
The nice() function was called by a process in a scheduling class other than time-sharing.
EPERM
The incr argument was negative or greater than 40, and the effective user ID of the calling process isn't the superuser.

Classification:

POSIX 1003.1 XSI

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

Caveats:

As -1 is a permissible return value in a successful situation, an application wishing to check for error situations should set errno to 0, then call nice(), and if it returns -1, check to see if errno is nonzero.

See also:

execl(), execle(), execlp(), execlpe(), execv(), execve(), execvp(), execvpe()

nice in the Utilities Reference


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/n/nice.html on line 178

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/n/nice.html on line 178