public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] where does PID wrap around?
@ 2006-07-27  2:02 Iain Buchanan
  2006-07-27  2:20 ` Zhang Le
  0 siblings, 1 reply; 4+ messages in thread
From: Iain Buchanan @ 2006-07-27  2:02 UTC (permalink / raw
  To: gentoo-user

Hi all,

I know that PID's wrap around if they get to a sufficiently large number
- anyone know what that number is?

2^16 (65536), or 2^15 (32768)?

Is it fixed for a particular system / kernel / universe? or even better,
is there a #define I can use from one of the system headers?

thanks,
-- 
Iain Buchanan <iaindb at netspace dot net dot au>

The advertisement is the most truthful part of a newspaper.
		-- Thomas Jefferson

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] where does PID wrap around?
  2006-07-27  2:02 [gentoo-user] where does PID wrap around? Iain Buchanan
@ 2006-07-27  2:20 ` Zhang Le
  2006-07-27  3:41   ` Iain Buchanan
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang Le @ 2006-07-27  2:20 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

On 7/27/06, Iain Buchanan <iaindb@netspace.net.au> wrote:
>
> Hi all,
>
> I know that PID's wrap around if they get to a sufficiently large number
> - anyone know what that number is?
>
> 2^16 (65536), or 2^15 (32768)?


$ cat /proc/sys/kernel/pid_max
32768

Is it fixed for a particular system / kernel / universe? or even better,
> is there a #define I can use from one of the system headers?
>
> it is defined in kernel/pid.c
int pid_max = PID_MAX_DEFAULT;

-- 
Zhang Le, Robert
Linux Engineer/Trainer
http://zhllg.spaces.msn.com
http://zh.gentoo-wiki.com
http://savannah.nongnu.org/projects/pgubook
http://groups.google.com/group/gentoo-china
http://groups.google.com/group/szlug

[-- Attachment #2: Type: text/html, Size: 1407 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] where does PID wrap around?
  2006-07-27  2:20 ` Zhang Le
@ 2006-07-27  3:41   ` Iain Buchanan
  2006-07-27  4:27     ` Richard Fish
  0 siblings, 1 reply; 4+ messages in thread
From: Iain Buchanan @ 2006-07-27  3:41 UTC (permalink / raw
  To: gentoo-user

On Thu, 2006-07-27 at 10:20 +0800, Zhang Le wrote:
> On 7/27/06, Iain Buchanan <iaindb@netspace.net.au> wrote:
>         Hi all,
>         
>         I know that PID's wrap around if they get to a sufficiently
>         large number
>         - anyone know what that number is?
>         
>         2^16 (65536), or 2^15 (32768)?
>  
> $ cat /proc/sys/kernel/pid_max
> 32768
> 
>         Is it fixed for a particular system / kernel / universe? or
>         even better,
>         is there a #define I can use from one of the system headers? 
>         
> it is defined in kernel/pid.c
> int pid_max = PID_MAX_DEFAULT;

and PID_MAX_DEFAULT, if you want to #include something, ends up in
<linux/threads.h>

thanks!
-- 
Iain Buchanan <iaindb at netspace dot net dot au>

Never underestimate the bandwidth of a station wagon full of tapes.
		-- Dr. Warren Jackson, Director, UTCS

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] where does PID wrap around?
  2006-07-27  3:41   ` Iain Buchanan
@ 2006-07-27  4:27     ` Richard Fish
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Fish @ 2006-07-27  4:27 UTC (permalink / raw
  To: gentoo-user

On 7/26/06, Iain Buchanan <iaindb@netspace.net.au> wrote:
> and PID_MAX_DEFAULT, if you want to #include something, ends up in
> <linux/threads.h>

You can also use the sysctl() function to get the value at run-time,
just in case it has been changed.  But that will only work on linux.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-27  4:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-27  2:02 [gentoo-user] where does PID wrap around? Iain Buchanan
2006-07-27  2:20 ` Zhang Le
2006-07-27  3:41   ` Iain Buchanan
2006-07-27  4:27     ` Richard Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox