[aklug] Re: mindbender

From: Shane R. Spencer <shane@bogomip.com>
Date: Fri Mar 25 2011 - 10:08:50 AKDT

On 03/24/2011 07:33 PM, bryanm@acsalaska.net wrote:
> On Thu, March 24, 2011 9:26 am, Shane R. Spencer wrote:
>> On 03/24/2011 04:03 AM, bryanm@acsalaska.net wrote:
>>> Consider this command:
>>>
>>> $ killall killall
>>>
>>> In order to complete successfully, the process would have to
>>> prematurely terminate itself; which, of course, means that it
>>> would not complete successfully.
>>>
>>> It's a unix paradox!
>>
>> killall
>> -> Store list of all processes that aren't mine
>> -> Check their pattern
>> -> Match -> Kill
>>
>> from killall.c
>>
>> ...
>> self = getpid ();
>> ...
>> if (!(pid = (pid_t) atoi (de->d_name)) || pid == self)
>> continue;
>> ...
>>
>> I think the developer was aware of complete uselessness of process suicide.
>
> How disappointingly practical. But still, suppose one were to
> remove that bit of code and run the altered killall. What then?

Then it would kill itself at some point while iterating through the list and the rest of
the matching processes would never get the kill sig. :)

> --
> Bryan Medsker
> bryanm@acsalaska.net
>
> ---------
> To unsubscribe, send email to<aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Mar 25 10:08:41 2011

This archive was generated by hypermail 2.1.8 : Fri Mar 25 2011 - 10:08:41 AKDT