Email List: Xaustin-group-lX
[All Lists]

Re: Comments on XBDd5 ERN 322

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>