signed short fd

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: signed short fd
Date: 2005-03-14 05:19:41
Message-ID: d1378u$2ekt$2@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We have the following definition in fd.c:

typedef struct vfd
{
signed short fd; /* current FD, or VFD_CLOSED if none */
...
} Vfd;

but seems we use Vfd.fd as an integer, say in fileNameOpenFile() we have:

vfdP->fd = BasicOpenFile(fileName, fileFlags, fileMode);

So is there any special reason we don't worry that convert an integer to
short will not lose data? Maybe we make the assumption that all OS will
implement "fd" as an array index and is at most 2^16 this big, but why not
use an integer?

Regards,
Qingqing

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-03-14 05:35:32 Re: [BUGS] We are not following the spec for HAVING without GROUP
Previous Message Robert Creager 2005-03-14 05:09:29 Re: date_trunc problem in HEAD