Sponsored Content
Top Forums Programming Reading a process control block Post 22353 by linuxpenguin on Saturday 1st of June 2002 02:42:08 AM
Old 06-01-2002
Re: Reading a process control block

Hi,

firstly, which unix are you using.
now if you are using a unix that supports the /proc area which stores all the info of the processes what ou can do is write a c program that reads the "pid number" file in the /proc area. now the process block info is stored in a structure in these files. you can simply go on reading these structures

also read "man proc" for more info

I hope this should solve your problem

rgds
penguin
 

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

unix process control

can anyone send me enything about "unix process control " nicko@freemail.com.mk (2 Replies)
Discussion started by: nicko
2 Replies

2. UNIX for Advanced & Expert Users

control the process

I found that in my system , there are some strange process , it will make the system crash so I would like to control the system no such process is running , this is if the system process that its process name is "ora" AND its ppid is not "2" , then it will crash the system, can suggest how to... (2 Replies)
Discussion started by: ust
2 Replies

3. Shell Programming and Scripting

2 Questions about my process control script

Hi all, My tiny mind is struggling with the following script that shuts down Tomcat on Sol. 8 and kills any defunct processes Tomcat might leave behind (as it so often does). I realize that fixing Tomcat would be best, but this is a band-aid so I won't have to do as much off-hours support of... (3 Replies)
Discussion started by: dkaplowitz
3 Replies

4. UNIX for Dummies Questions & Answers

init and process control

I'm trying to wrap my head around process control in Unix... particularly init and how it fits in to the equation. Init is responsible for creating sessions by spawning instances of getty which calls login effectively creating sessions right? Why then can init belong to a session? If you ps jx... (4 Replies)
Discussion started by: dexfantasy
4 Replies

5. Shell Programming and Scripting

How to control/overide shutdown/reboot process?

Dear all, I want to control my server from shutting down and rebooting. It will ask for some question before the process, ex: who are you? what is the reason for shutting down? ... I think I can overide that binary of shutdown/reboot command, but it is confused. We have many way to... (5 Replies)
Discussion started by: fongthai
5 Replies

6. UNIX for Advanced & Expert Users

Control process from different terminal (over SSH)

I pressed CTRL Z and suspended the job. then I pressed bg, The process re-started to throw output on the terminal and its not allowing me to access the prompt. its not even accepting CTRL Z. The process has been running for about 2 hours now and I want to suspend it by opening another terminal.... (3 Replies)
Discussion started by: rakeshou
3 Replies

7. Shell Programming and Scripting

job/process scheduling or control

Hi forum, I have a problem concerning job or process scheduling and control. I have to run 24 jobs (could be more sometimes less) of the same programme with different parameters. The machine this code is running on is an 8-core machine, so I was thinking that running all the processes at once... (0 Replies)
Discussion started by: deiphon
0 Replies

8. Shell Programming and Scripting

control timeout of sqlplus process

Hi, I'm using simple sqlplus to test DB availability. When DB is going down, sqlplus command is hang for a few minutes I want to implement the following: 1. execute sqlplus 2. if after 20 sec I dont get a response, kill the process and exit with error. 3. if I get immediate response... (2 Replies)
Discussion started by: gdan2000
2 Replies

9. Shell Programming and Scripting

Reading control characters into variables

Hi, I am trying to write a shell script to help with some digital signature work currently being undertaken where we have a file that contains a number of rows ending with ^M. What I need to do is concatenate this using shell scripting and retain the control character. E.G. abc^M... (5 Replies)
Discussion started by: chris01010
5 Replies
GETPGRP(2)						      BSD System Calls Manual							GETPGRP(2)

NAME
getpgrp -- get process group LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> pid_t getpgrp(void); pid_t getpgid(pid_t pid); DESCRIPTION
The process group of the current process is returned by getpgrp(). The process group of the process identified by pid is returned by getpgid(). If pid is zero, getpgid() returns the process group of the current process. Process groups are used for distribution of signals, and by terminals to arbitrate requests for their input: processes that have the same process group as the terminal are foreground and may read, while others will block with a signal if they attempt to read. This call is thus used by programs such as csh(1) to create process groups in implementing job control. The tcgetpgrp() and tcsetpgrp() calls are used to get/set the process group of the control terminal. RETURN VALUES
The getpgrp() call always succeeds. Upon successful completion, the getpgid() call returns the process group of the specified process; oth- erwise, it returns a value of -1 and sets errno to indicate the error. ERRORS
getpgid() will succeed unless: [ESRCH] there is no process whose process ID equals pid SEE ALSO
getsid(2), setpgid(2), termios(4) HISTORY
The getpgrp() function call appeared in 4.0BSD. The getpgid() function call is derived from its usage in System V Release 4. STANDARDS
The getpgrp() function call is expected to conform to ISO/IEC 9945-1:1990 (``POSIX.1''). COMPATIBILITY
This version of getpgrp() differs from past Berkeley versions by not taking a pid_t pid argument. This incompatibility is required by ISO/IEC 9945-1:1990 (``POSIX.1''). From the ISO/IEC 9945-1:1990 (``POSIX.1'') Rationale: 4.3BSD provides a getpgrp() function that returns the process group ID for a specified process. Although this function is used to support job control, all known job-control shells always specify the calling process with this function. Thus, the simpler AT&T System V UNIX getpgrp() suffices, and the added complexity of the 4.3BSD getpgrp() has been omitted from POSIX.1. The old functionality is available from the getpgid() function. BSD
June 4, 1993 BSD
All times are GMT -4. The time now is 05:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy