Re: signed short fd

From: pgsql(at)mohawksoft(dot)com
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: signed short fd
Date: 2005-03-14 21:25:22
Message-ID: 16480.24.91.171.78.1110835522.squirrel@mail.mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> My copy of APUE says on page 49: "The file descriptor returned by open
> is the lowest numbered unused descriptor. This is used by some
> applications to open a new file on standard input, standard output, or
> standard error."

Yes, I'll restate my questions:

What is meant by "unused?" Is it read to mean that a higher number file is
*never* returned if there is a lower number that has been used and is now
available? Is that something we can 100% absolutely depend on. On All
curent and future platforms?

It is a stupid idea to truncate the upper bytes of an integer without good
reason. I can see LOTS of reasons why this will break something in the
future. The upper bits may be used to identify storage media or
characteristics.

My point is that the spec calls for an "int," PostgreSQL should use an int.

>
> Unless someone can show there's an actual problem this discussion seems
> quite pointless.
>

The point is that this *is* silly, but I am at a loss to understand why it
isn't a no-brainer to change. Why is there a fight over a trivial change
which will ensure that PostgreSQL aligns to the documented behavior of
"open()"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-03-14 23:53:07 Re: signed short fd
Previous Message Andrew Dunstan 2005-03-14 21:05:00 Re: signed short fd