Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nice(3) [ultrix man page]

nice(3) 						     Library Functions Manual							   nice(3)

Name
       nice - set program priority

Syntax
       int nice(incr)
       int incr;

Description
       The scheduling priority of the process is augmented by incr.  Positive priorities get less service than normal.	Priority 10 is recommended
       to users who wish to execute long-running programs without flack from the administration.

       Negative increments are ignored except on behalf of the super-user.  The priority is limited to the range -20 (most urgent) to 20 (least).

       The priority of a process is passed to a child process by For a privileged process to return to normal  priority  from  an  unknown  state,
       should  be  called successively with arguments -40 (goes to priority -20 because of truncation), 20 (to get to 0), then 0 (to maintain com-
       patibility with previous versions of this call).

Environment
       In any mode, nice returns -1 and sets on an error.  On success, the return value depends on the mode in which your  program  was  compiled.
       In  POSIX  or  System V mode, it is the new priority; otherwise, it is zero.  Note that, in POSIX and System V mode, -1 can indicate either
       success or failure; must be used to determine which.

See Also
       nice(1), fork(2), setpriority(2), renice(8)

																	   nice(3)

Check Out this Related Man Page

nice(3UCB)					     SunOS/BSD Compatibility Library Functions						nice(3UCB)

NAME
nice - change priority of a process SYNOPSIS
/usr/ucb/cc [ flag ... ] file ... #include<unistd.h> int nice(incr) int incr; DESCRIPTION
The scheduling priority of the process is augmented by incr. Positive priorities get less service than normal. Priority 10 is recommended to users who wish to execute long-running programs without undue impact on system performance. Negative increments are illegal, except when specified by the privileged user. The priority is limited to the range -20 (most urgent) to 20 (least). Requests for values above or below these limits result in the scheduling priority being set to the corresponding limit. The priority of a process is passed to a child process by fork(2). For a privileged process to return to normal priority from an unknown state, nice() should be called successively with arguments -40 (goes to priority -20 because of truncation), 20 (to get to 0), then 0 (to maintain compatibility with previous versions of this call). RETURN VALUES
Upon successful completion, nice() returns 0. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
The priority is not changed if: EPERM The value of incr specified was negative, and the effective user ID is not the privileged user. SEE ALSO
cc(1B), nice(1), renice(1), fork(2), priocntl(2), getpriority(3C) NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-threaded applications is unsupported. SunOS 5.11 30 Oct 2007 nice(3UCB)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help! urgent!

I have an old HPUX 1020. The /home size was 43% free yesterday. This morning I found out that it is 100% full. I didn't find any core files. I need a script or a command that check for the largest files on ./home. Thanks! (8 Replies)
Discussion started by: sunbird
8 Replies

2. UNIX for Dummies Questions & Answers

Please Help Me With This Nice And Renice Stuff

i read a book about this a couple of times and i still find it confusing. they talking about when you increase a priority number, that decreases nice number. I really dont understand this. I'm working on a solaris and linux red hat 7.2 system. if anyone can explain this stuff to me in... (3 Replies)
Discussion started by: TRUEST
3 Replies

3. UNIX for Advanced & Expert Users

Increasing priority of a process

Hi! Experts, Is there anyway to incerase the priority of a process which is already started and running??.. I think nice can used for increase priority when we start the process.. But donno how to do when its already running.. Any help would be apreciated.. Jyoti (2 Replies)
Discussion started by: jyotipg
2 Replies

4. UNIX for Dummies Questions & Answers

nice (user command)

Can someone tell me .. how to find a user & process who has executed nice (scheduled priority) to one of his process. .Tks.. (5 Replies)
Discussion started by: sivan
5 Replies

5. AIX

Where to Order 5.1L Cds

Anyone know where you can purchase a 5.1 cd set? IBM no longer ships this out and do not have a set. I have a burned copy, but would be nice to have the originals. I'd like to send my copies offsite for DR once i get an original set. Thanks! (2 Replies)
Discussion started by: slacker
2 Replies

6. Shell Programming and Scripting

File filter

Hi Everyone , have a nice i would need a little help on this i have file which contains blocks such as given below <hgsdp:msisdn=923228719047,loc; HLR SUBSCRIBER DATA SUBSCRIBER IDENTITY MSISDN IMSI STATE AUTHD 923228719047 410072110070614 CONNECTED ... (3 Replies)
Discussion started by: Dastard
3 Replies

7. Shell Programming and Scripting

need urgent help

Programname=$(basename $0) # While scheduling to cron, program name is needed. Usage="Usage: $Programname " IsCronJob=1 # default, script will run at now. isBackUp=0 # default, it will take back up. lFlag=0 # it is optional. default value is zero LFlag=0 # it is optional. dfault... (10 Replies)
Discussion started by: namishtiwari
10 Replies

8. Solaris

start a process with the highest priority

hello, I have a process lauched by non-root user. how to lauch this process with a very high priority? I know this has to do with nice command but how to allow a user to lauch his process with a very high priority and without ROOT intervention? PS: this process is always lauched from a... (2 Replies)
Discussion started by: melanie_pfefer
2 Replies

9. UNIX for Dummies Questions & Answers

how to Decrease priority of a particular process in time of process creation

how to decrease priority of a particular process in time of process creation... and also how to decrease priority of a particular process after process creation.. can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies

10. AIX

priority for process

hi how to change the priority of a process for eg.if a,b,c these there process are running and if i have to give the b process as high priority and high severe level what should i do (3 Replies)
Discussion started by: senmak
3 Replies

11. UNIX for Advanced & Expert Users

Is nice command a myth?

Hello, Some guy said to me that using the nice command to decrease the priority of a process is a myth, that the operating system corrects the priorities as the processes need cpu. Is this true? (4 Replies)
Discussion started by: psimoes79
4 Replies

12. Programming

Need help in Unix C programming

hey guys. im currently trying to make a program in unix (redhat, compiling the .c file using gcc) and i need urgent urgent help. i need to save objects of structures in a file but they dont seem to be saving properly. ive been on it for a whole day now. dunno why i cant do it. when i try to... (4 Replies)
Discussion started by: mjumrani
4 Replies

13. War Stories

Prize of being an Admin

Was wondering if anyone has come across any situation where you do your best to help users and in return you get a nice escalation from top level management! Here's my story: One fine morning, I was sitting idle, doing next to nothing, I got an alert from helpdesk people about a problem with... (30 Replies)
Discussion started by: admin_xor
30 Replies

14. Linux

Determining Values for NIce and Priority items in limits.conf file

I've been looking online trying to find the correct value nice and priority can take in the limits.conf file. ON the man page it says; Does this mean priority can be any negative number and any positive? Then Does this mean any number between -20 and 19 also what does the definition of nice... (13 Replies)
Discussion started by: matthewfs
13 Replies

15. UNIX for Advanced & Expert Users

Help Required with Automation Harness

Hi All I have to be careful how I word this as the last time I mentioned it everyone assumed I am a recruiter and I got some flack for it. So let me start by assuring you that I am not one, and this is not a commercial post in any way. I'm posting this to see if I can interest anyone in... (2 Replies)
Discussion started by: steadyonabix
2 Replies