From owner-freebsd-hackers Fri Jun 7 6:26:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id D7F9837B404 for ; Fri, 7 Jun 2002 06:26:43 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1920) id 9F948AE163; Fri, 7 Jun 2002 06:26:43 -0700 (PDT) Date: Fri, 7 Jun 2002 06:26:43 -0700 From: Maxime Henrion To: hackers@FreeBSD.org Cc: Alexey Privalov Subject: Re: randompid Message-ID: <20020607132643.GF85244@elvis.mu.org> References: <20020607200648.M19436-100000@land3.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020607200648.M19436-100000@land3.nsu.ru> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Alexey Privalov wrote: > hi all. > > i`m trying to set randompid: > > root@land3# sysctl kern.randompid=1 > kern.randompid: 0 -> 0 > > what`s a need to set on? The value you give to this sysctl is not a boolean, it's a value used in the formula which computes the randompid. This value is sanity checked, that's why giving 1 doesn't do anything. Here is the code which is responsible for this : if (pid < 0 || pid > PID_MAX - 100) /* out of range */ pid = PID_MAX - 100; else if (pid < 2) /* NOP */ pid = 0; else if (pid < 100) /* Make it reasonable */ pid = 100; This should give you enough information to chose a good value. :-) Maxime To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message