Discussion:
What's the difference/relation between pid,tgid,pgid,sid?
Cristian Tapus
2006-01-26 22:26:27 UTC
Permalink
Can somebody explain to me or point me to some explanation of what the pgid
and sid are and how they are related to the pid and the tgid?

I am trying to understand how the pid hashing works and how I can change the
pid of a process while it's running. I know I need to do some __detach_pid
and then attach it again under a different pid, but I'm not sure what to do
about the rest of the pid types (PGID, SID)...

Cheers,

Cristian.
Mulyadi Santosa
2006-01-27 05:29:29 UTC
Permalink
Hi Cristian...
Post by Cristian Tapus
Can somebody explain to me or point me to some explanation of what
the pgid and sid are and how they are related to the pid and the
tgid?
Not sure if I can help much with. All I see is:
- pgid is actually task_struct->signal->pgrp. See sys_getpgid() on
kernel/sys.c (2.6.x)
- sid is task_struct->signal->session. See sys_getsid().

Since they are included in signal_struct, I guess this is related with
how signal is handled on process group. Seems it is also related with
security module....maybe Mr Hartman can provide further clue...
Post by Cristian Tapus
I am trying to understand how the pid hashing works and how I can
change the pid of a process while it's running. I know I need to do
some __detach_pid and then attach it again under a different pid, but
I'm not sure what to do about the rest of the pid types (PGID,
SID)...
This is related to your previous post, right? OOT, why do you want to
change runnable task's pid?

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/

Loading...