Sponsored Content
Top Forums UNIX for Advanced & Expert Users delete all PID that running by UID ?? Post 302277851 by methyl on Sunday 18th of January 2009 12:25:09 PM
Old 01-18-2009
The column headed "C" is the task priority (0-255).
A high number is a low priority.
You may see unix change a task priority dynamically to 200+ if a task might
be looping.
 

10 More Discussions You Might Find Interesting

1. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies

2. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

3. Shell Programming and Scripting

Need to know rhe PID for the Shell Script running

I have a Shell Scritp named "Statistics" which has a Infinate Wille Loop Running I want to restart this Srcipt "Statistics" when i try to run other srcipt Ex "ABC" so i want to kill the "Statistics" script in "ABC" so for this I what to know the PID for that Script "Statistics" which is... (7 Replies)
Discussion started by: pbsrinivas
7 Replies

4. UNIX for Dummies Questions & Answers

UID & GID of the running process

Hi, out of curosity this question just popped in my mind. Is there any way to find out the uid and gid of the running process ? If i do a ls -l of a program then it shows the uid/gid bit (if its set). I want to see as which user/group the program is running ..... is there any way to know this... (2 Replies)
Discussion started by: ankurjain
2 Replies

5. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

6. UNIX for Dummies Questions & Answers

How to find the details of the previously running process with PID

OS: Unix or Linux I (only) know the pid of the process which was running earlier (say 5 hrs back) but it is not running now. Is there a way I could find the details of that process? (atleast the name of the process). Please let me know. (2 Replies)
Discussion started by: vijay.d
2 Replies

7. Shell Programming and Scripting

Check process running Status with PID

Good day I am fairly new to Shell Scripting. I want a script to check if a process is up by checking the process's PID and then return a value for when it's running which would be 0. If it isn't running it should give any other value that 0. Any Help is appreciated Regards (9 Replies)
Discussion started by: 1nsyz1on
9 Replies

8. Shell Programming and Scripting

kill PID running in background in for loop

Guys, can you help me in killing the process which is running in back ground under for loop I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Discussion started by: mohan_xunil
1 Replies

9. UNIX for Dummies Questions & Answers

Common UID's and PID's

Hey Folks, I'm a newbie to Unix. Sorry if this doubt sounds very silly. I know that first 100 UID's are used by system accounts and the rest, for normal users. It'd be great if someone could guide me to a link where i can browse through the list of 100 system managed accounts with their UID's.... (2 Replies)
Discussion started by: prithvirao17
2 Replies

10. Shell Programming and Scripting

Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Discussion started by: Bolanok
2 Replies
getpriority(3C) 					   Standard C Library Functions 					   getpriority(3C)

NAME
getpriority, setpriority - get or set process scheduling priority SYNOPSIS
#include <sys/resource.h> int getpriority(int which, id_t who); int setpriority(int which, id_t who, int priority); DESCRIPTION
The getpriority() function obtains the current scheduling priority of a process, process group, or user. The setpriority() function sets the scheduling priority of a process, process group, or user. Target processes are specified by the values of the which and who arguments. The which argument can be one of the following values: PRIO_PROCESS, PRIO_PGRP, PRIO_USER, PRIO_GROUP, PRIO_SESSION, PRIO_LWP, PRIO_TASK, PRIO_PROJECT, PRIO_ZONE, or PRIO_CONTRACT, indicating that the who argument is to be interpreted as a process ID, a process group ID, an effective user ID, an effective group ID, a session ID, an lwp ID, a task ID, a project ID, a zone ID, or a process contract ID, respectively. A 0 value for the who argument specifies the cur- rent process, process group, or user. A 0 value for the who argument is treated as valid group ID, session ID, lwp ID, task ID, project ID, zone ID, or process contract ID. A P_MYID value for the who argument can be used to specify the current group, session, lwp, task, project, zone, or process contract, respectively. If more than one process is specified, getpriority() returns the highest priority (lowest numerical value) pertaining to any of the speci- fied processes, and setpriority() sets the priorities of all of the specified processes to the specified value. The default priority is 0; negative priorities cause more favorable scheduling. The range of valid priority values is [-20, 20]. If the value specified to setpriority() is less than the system's lowest supported priority value, the system's lowest supported value is used. If it is greater than the system's highest supported value, the system's highest supported value is used. Only a process with appropriate privileges can raise its priority (that is, assign a lower numerical priority value). Any processes or threads using SCHED_FIFO or SCHED_RR is unaffected by a call to setpriority(). This is not considered an error. A process that subsequently reverts to SCHED_OTHER need not have its priority affected by such a setpriority() call. RETURN VALUES
Upon successful completion, getpriority() returns an integer in the range from -20 to 20. Otherwise, -1 is returned and errno is set to indicate the error. Upon successful completion, setpriority() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The getpriority() and setpriority() functions will fail if: ESRCH No process could be located using the which and who argument values specified. EINVAL The value of the which argument was not recognized, or the value of the who argument is not a valid process ID, process group ID, user ID, group ID, session ID, lwp ID, task ID, project ID, or zone ID. In addition, setpriority() may fail if: EPERM A process was located, but neither the real nor effective user ID of the executing process is the privileged user or match the effective user ID of the process whose priority is being changed. EACCES A request was made to change the priority to a lower numeric value (that is, to a higher priority) and the current process does not have appropriate privileges. EXAMPLES
Example 1: Example using getpriority() The following example returns the current scheduling priority for the process ID returned by the call to getpid(2). #include <sys/resource.h> ... int which = PRIO_PROCESS; id_t pid; int ret; pid = getpid(); ret = getpriority(which, pid); Example 2: Example using setpriority() The following example sets the priority for the current process ID to -20. #include <sys/resource.h> ... int which = PRIO_PROCESS; id_t pid; int priority = -20; int ret; pid = getpid(); ret = setpriority(which, pid, priority); USAGE
The effect of changing the scheduling priority can vary depending on the process-scheduling algorithm in effect. Because getpriority() can return -1 on successful completion, it is necessary to set errno to 0 prior to a call to getpriority(). If get- priority() returns -1, then errno can be checked to see if an error occurred or if the value is a legitimate priority. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
nice(1), renice(1), fork(2), sched_get_priority_max(3RT), sched_setscheduler(3RT), attributes(5), standards(5) SunOS 5.10 19 Jul 2004 getpriority(3C)
All times are GMT -4. The time now is 12:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy