Hi All,
To give more details about the behavior on kill on Linux. We can find any multi-threaded process and call kill 0 for any thread of it. For Linux, kill 0 returns success for that thread. But for other UNIX, kill 0 could not find that thread .
For example,
#ps -eaf|grep automount
root 2480 1 0 Jan02 ? 00:00:11 automount
#pstack 2480 |grep -i LWP
Thread 5 (Thread 0x41e37940 (LWP 2481)):
Thread 4 (Thread 0x41e48940 (LWP 2482)):
Thread 3 (Thread 0x42849940 (LWP 2485)):
Thread 2 (Thread 0x412a2940 (LWP 2488)):
Thread 1 (Thread 0x2b5ed7783af0 (LWP 2480)):
On Linux, Kill(0,2485) finds, but for other UNIX it does not find.
It seems that kill(0,pid) first search pid for process , if process does not exists with that id, then it goes till thread level.
Please let me know any alternative or I can restrict to test process by pid till process level.
Many thanks in advance.
Regards,
Mrinmoy
|