Re: pid_t data type
- From: Sanchit <sanchitgupta.1@xxxxxxxxx>
- Date: Mon, 17 Mar 2008 08:41:33 -0700 (PDT)
On Mar 16, 12:34 pm, Rainer Weikusat <rweiku...@xxxxxxxxxxx> wrote:
Logan Shaw <lshaw-use...@xxxxxxxxxxxxx> writes:
Sanchit wrote:
So if i will use long.. and i am not concerned with memory
management.. will it be fine in every case..
If you use pid_t, it will be fine in every case. If you use
long, there are no guarantees. If you use pid_t, you will be
using what the producers of the system have tested. If you
use long, you will be using something that is unsupported and
untested.
A 'typedef-name' is just an alias for an existing type. This means
that if an implementation had a
typedef long pid_t
the only difference between the two would be that usage looked
different in source code. One of the nice properties of C is that
'types' stick to objects and not to values: A value originally
returned be fork can be stored into anything large enough to represent
it without being "damaged" and a compiler is required to not introduce
artificial differences between identically valued numbers coming from
different origins.
Are you sure pid_t is typedef of long.. I really dont know. As on
mymachine sizeof(pid_t)= sizeof(int)
And I think my question is misunderstood. I just want you to tell me
if there are cases where long will fail to take place of pid_t. I dont
care if pid_t is an int or short or long!
.
- Follow-Ups:
- Re: pid_t data type
- From: David Schwartz
- Re: pid_t data type
- From: Gordon Burditt
- Re: pid_t data type
- From: Rainer Weikusat
- Re: pid_t data type
- References:
- pid_t data type
- From: Sanchit
- Re: pid_t data type
- From: Lew Pitcher
- Re: pid_t data type
- From: Sanchit
- Re: pid_t data type
- From: Logan Shaw
- Re: pid_t data type
- From: Rainer Weikusat
- pid_t data type
- Prev by Date: Re: pid_t data type
- Next by Date: Re: pid_t data type
- Previous by thread: Re: pid_t data type
- Next by thread: Re: pid_t data type
- Index(es):