Re: pid_t data type



Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx> writes:
Casper H.S. *** wrote:
"jason.cipriani@xxxxxxxxx" <jason.cipriani@xxxxxxxxx> writes:

On Mar 18, 5:48 am, Rainer Weikusat <rweiku...@xxxxxxxxxxx> wrote:
[snip]

Does it say somewhere that pid_t will never be a pointer type, or some
other type, like a float (which, while strange, is fine since it's
hidden behind the typedef)? If it can be, then the discussion of using
longs or whatever interchangeably with pid_t's is moot.
It needs to be a signed airthmetic type:
If pid is negative but not (pid_t)-1, sig will be sent to
all processes whose process group ID is equal to the abso-
lute value of pid and for which the process has permission
to send a signal.
Since it needs to be used in comparisons it can't really be float...

Why not? Can't the system restrict itself to the set of floating
point values that can be exactly represented with no loss of
precision (or overflow or whatever)? :-) Unless there's a
requirement I don't know of that a pid_t can be added or subtracted
or multiplied or something.

Various data structures used for searching for keys (eg hash tables or
digital search tries) make use of their numerical properties.
.