| To: | yyyyyyyyyyyyyy@xxxxxxxxxxxxx, yyyyyy@xxxxxxxxxxx |
|---|---|
| Subject: | Re: Comments on XBDd5 ERN 322 |
| From: | yyyyyyyyyyyyyyy@xxxxxx |
| Date: | Tue, 13 Mar 2001 20:55:08 +0100 (MET) |
> Whatever choices these people made that led them to start
> thinking about letting getpid() fail were incorrect choices.
I think we all agree.
There is no reason at all (in my eyes) to worry about the size
of a pid. One writes
pid_t p = getpid();
and all is OK.
But then, what about printing? It seems to me that a routine like
void outpid(pid_t p) {
if (p < 0) {
putchar('-');
outpid(-p);
} else {
if (p)
outpid(p/10);
putchar('0'+(p%10));
}
}
prints a pid without making assumptions on the size of a pid.
Andries
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | sizeof(uid_t) > sizeof(long), Josh Knight |
|---|---|
| Next by Date: | RE: RE: Re: set -e and SIGCHLD, Bruce Korb |
| Previous by Thread: | Re: Comments on XBDd5 ERN 322, schilling |
| Next by Thread: | Re: Comments on XBDd5 ERN 322, Paul Eggert |
| Indexes: | [Date] [Thread] [All Lists] |