O nás     Inzerce     KontaktSpolehlivé informace o IT již od roku 2011
Hledat
Nepřehlédněte: Nejlepší IT: Pozoruhodné IT produkty pro rok 2024 podruhé
Správa dokumentů
Digitální transformace
Informační systémy
Hlavní rubriky: Informační systémy, Mobilní technologie, Datová centra, Sítě, IT bezpečnost, Software, Hardware, Zkušenosti a názory, Speciály

Pozoruhodné IT produkty 2024 podruhé
E-knihy o IT zdarma
Manuál Linux
[Linux manuál]

nice: změnit příjemnou hodnotu procesu

Originální popis anglicky: nice - change the nice value of a process

Návod, kniha: POSIX Programmer's Manual

STRUČNĚ

#include <unistd.h>
 
 
int nice(int incr);
 

POPIS / INSTRUKCE

The nice() function shall add the value of incr to the nice value of the calling process. A process' nice value is a non-negative number for which a more positive value shall result in less favorable scheduling.
A maximum nice value of 2*{NZERO}-1 and a minimum nice value of 0 shall be imposed by the system. Requests for values above or below these limits shall result in the nice value being set to the corresponding limit. Only a process with appropriate privileges can lower the nice value.
Calling the nice() function has no effect on the priority of processes or threads with policy SCHED_FIFO or SCHED_RR. The effect on processes or threads with other scheduling policies is implementation-defined.
The nice value set with nice() shall be applied to the process. If the process is multi-threaded, the nice value shall affect all system scope threads in the process.
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 whether errno is non-zero.

NÁVRATOVÁ HODNOTA

Upon successful completion, nice() shall return the new nice value -{NZERO}. Otherwise, -1 shall be returned, the process' nice value shall not be changed, and errno shall be set to indicate the error.

CHYBY / ERRORY

The nice() function shall fail if:
EPERM
The incr argument is negative and the calling process does not have appropriate privileges.
 
The following sections are informative.

PŘÍKLADY POUŽITÍ

Changing the Nice Value

The following example adds the value of the incr argument, -20, to the nice value of the calling process.
 
#include <unistd.h> ... int incr = -20; int ret;
 
ret = nice(incr);

APPLICATION USAGE

None.

RATIONALE

None.

FUTURE DIRECTIONS

None.

SOUVISEJÍCÍ

getpriority() , setpriority() , the Base Definitions volume of IEEE Std 1003.1-2001, <limits.h>, <unistd.h> Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
2003 IEEE/The Open Group
©2011-2024 BusinessIT.cz, ISSN 1805-0522 | Názvy použité v textech mohou být ochrannými známkami příslušných vlastníků.
Provozovatel: Bispiral, s.r.o., kontakt: BusinessIT(at)Bispiral.com | Inzerce: Best Online Media, s.r.o., zuzana@online-media.cz
O vydavateli | Pravidla webu BusinessIT.cz a ochrana soukromí | Používáme účetní program Money S3 | pg(9466)