signed short fd - Mailing list pgsql-hackers

From Qingqing Zhou
Subject signed short fd
Date
Msg-id d1378u$2ekt$2@news.hub.org
Whole thread Raw
Responses Re: signed short fd
List 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







pgsql-hackers by date:

Previous
From: Robert Creager
Date:
Subject: Re: date_trunc problem in HEAD
Next
From: Greg Stark
Date:
Subject: Re: [BUGS] We are not following the spec for HAVING without GROUP