Re: signed short fd

From: Abhijit Menon-Sen <ams(at)oryx(dot)com>
To: pgsql(at)mohawksoft(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: signed short fd
Date: 2005-03-15 03:04:06
Message-ID: 20050315030406.GA21515@penne.toroid.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 2005-03-14 16:25:22 -0500, pgsql(at)mohawksoft(dot)com wrote:
>
> > "The file descriptor returned by open is the lowest numbered unused
> > descriptor. [...]
>
> What is meant by "unused?"

Perhaps you should actually look at the standard.

"The open( ) function shall return a file descriptor for the named
file that is the lowest file descriptor not currently open for that
process."

"The close( ) function shall deallocate the file descriptor indicated
by fildes. To deallocate means to make the file descriptor available
for return by subsequent calls to open( ) or other functions that
allocate file descriptors."

> 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?

Yes.

-- ams

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-03-15 03:04:59 Re: signed short fd
Previous Message pgsql 2005-03-15 02:52:04 Re: signed short fd