# Re: [PATCH v2] Improve portability: Cast pid_t's to intmax_t

2 messages from 2008-09-01 to 2008-09-01. Participants: George Spelvin, Miles Bader.
Thread: https://gitlist.dev/t/15315

## George Spelvin, 2008-09-01 08:28

Subject: Re: [PATCH v2] Improve portability: Cast pid_t's to intmax_t
Message-ID: <20080901082801.29621.qmail@science.horizon.com>
URL: https://gitlist.dev/e/20080901082801.29621.qmail%40science.horizon.com

```
This seems rather pointless.  Whatever Solaris thinks, I really doubt
that process IDs will ever overflow an int, which is 32 bits on all
machines that will ever support more than 32k processes.

You can be paranoid if you like and cast to long, but I don't think
even a massive 64-bit cluster is likely to have more than 2G processes
in the forseeable future.

I'd support a cast to int or unsigned, or a cast to long as a second choice.

Using uintmax_t is formally correct, but practically pointless clutter.

```

## Miles Bader, 2008-09-01 08:54

Subject: Re: [PATCH v2] Improve portability: Cast pid_t's to intmax_t
Message-ID: <buood382qlq.fsf@dhapc248.dev.necel.com>
URL: https://gitlist.dev/e/buood382qlq.fsf%40dhapc248.dev.necel.com
In-Reply-To: <20080901082801.29621.qmail@science.horizon.com>

```
"George Spelvin" <linux@horizon.com> writes:
> You can be paranoid if you like and cast to long, but I don't think
> even a massive 64-bit cluster is likely to have more than 2G processes
> in the forseeable future.

But it isn't it possible for some OS to use a sparse PID namespace?

-Miles

-- 
Brain, n. An apparatus with which we think we think.

```
