Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1244983

Re: [Linux] Linux PID algorithm is BRAINDEAD!

From Theodore Ts'o <tytso@mit.edu>
Newsgroups linux.kernel
Subject Re: [Linux] Linux PID algorithm is BRAINDEAD!
Date 2015-10-12 20:20 +0200
Message-ID <qiPRw-6RC-15@gated-at.bofh.it> (permalink)
References <qhRLI-3BY-9@gated-at.bofh.it> <qialk-5a5-3@gated-at.bofh.it> <qisUW-71l-15@gated-at.bofh.it> <qiMTD-2Aw-15@gated-at.bofh.it> <qiPyb-6fF-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-10 04:10 +0200
  Re: [Linux] Linux PID algorithm is BRAINDEAD! yalin wang <yalin.wang2010@gmail.com> - 2015-10-10 05:30 +0200
  Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-11 00:00 +0200
    Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-11 06:00 +0200
    Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-11 19:50 +0200
      Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-12 17:10 +0200
        Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-12 20:00 +0200
          Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-12 20:20 +0200

csiph-web