public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Dave Goel <deego3@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Linux] Linux PID algorithm is BRAINDEAD!
Date: Mon, 12 Oct 2015 14:12:44 -0400	[thread overview]
Message-ID: <20151012181244.GA22589@thunk.org> (raw)
In-Reply-To: <CAOCW0DhWKeOh75BGQtMAif7WVZAs5JXw=vgu99sm3egrimTE4g@mail.gmail.com>

On Mon, Oct 12, 2015 at 01:49:59PM -0400, Dave Goel wrote:
> 
> OTOH, I guess if one has to write cleaner/other meta scripts without
> proper traps, the cleaner can simply check if linux's PID counter
> is too close to the current PID, and if so, refrain from drastic
> actions. For the latter, I wonder if there's a way to
> get "current PID counter."

How about:

	current_pid = fork();
	if (current_pid == 0)
		exit(0);
	(void) waitpid(current_pid);

Translating this to perl or python shouldn't be that difficult.

						- Ted

      reply	other threads:[~2015-10-12 18:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10  2:00 [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel
2015-10-10  3:20 ` yalin wang
2015-10-10 21:58 ` Theodore Ts'o
2015-10-11  3:51   ` Dave Goel
2015-10-11 17:44   ` Dave Goel
2015-10-12 15:04     ` Theodore Ts'o
2015-10-12 17:49       ` Dave Goel
2015-10-12 18:12         ` Theodore Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151012181244.GA22589@thunk.org \
    --to=tytso@mit.edu \
    --cc=deego3@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox