LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to know the foreground process group ID of another console ?? (https://www.linuxquestions.org/questions/linux-general-1/how-to-know-the-foreground-process-group-id-of-another-console-409521/)

sreeramabsc 01-30-2006 01:26 AM

How to know the foreground process group ID of another console ??
 
Hi friends,
First of all, I admit that I am not aware whether I can post this question here or not. But this is Linux related and is related to Processes and their information. Also, this is related to C System calls. Hence I was confused as to whether can I post this question here or not. However, I have collected all courage and posting it here !!

I would like to know as to how can we know the foreground process group ID of another console ( or chvt). Say for eg, I am working in /dev/tty1 and there is another process running in /dev/tty2. I would like to know as to what is the foreground process group ID of the process running in /dev/tty2. How can I achieve this? I tried to use the 'ioctl' system call in C language, but I could not succeed, probably due to wrong usage. Could anyone kindly guide me in achieving the above, using C system calls(preferable) or any other method ?

Thanks,
Sreeram


All times are GMT -5. The time now is 04:35 PM.