Re: [HACKERS] signed short fd

2005-03-16 Thread Hannu Krosing
Ühel kenal päeval (esmaspäev, 14. märts 2005, 22:13-0500), kirjutas Bruce Momjian: Christopher Kings-Lynne wrote: I really don't intend to do that, and it does seem to happen a lot. I am the first to admit I lack tact, but often times I view the decisions made as rather arbitrary and

Re: [HACKERS] signed short fd

2005-03-15 Thread Mark Woodward
Mark Woodward wrote: Christopher Kings-Lynne wrote: I really don't intend to do that, and it does seem to happen a lot. I am the first to admit I lack tact, but often times I view the decisions made as rather arbitrary and lacking a larger perspective, but that is a rant I

Re: [HACKERS] signed short fd

2005-03-15 Thread Bruce Momjian
Mark Woodward wrote: I actually met him _briefly_ at Linuxworld in Boston. He just said hi, then disappeared. :-) Bruce, I did want to meet you to a greater extent, but you we surrounded by people and looked quite busy. Yea, I was just teasing. It was a very busy conference. I

Re: [HACKERS] signed short fd

2005-03-14 Thread pgsql
Maybe we make the assumption that all OS will implement fd as an array index The POSIX spec requires open() to assign fd's consecutively from zero. http://www.opengroup.org/onlinepubs/007908799/xsh/open.html With all due respect, PostgreSQL now runs natively on Win32. Having a POSIX-only

Re: [HACKERS] signed short fd

2005-03-14 Thread Tom Lane
[EMAIL PROTECTED] writes: The POSIX spec requires open() to assign fd's consecutively from zero. http://www.opengroup.org/onlinepubs/007908799/xsh/open.html With all due respect, PostgreSQL now runs natively on Win32. ... using the POSIX APIs that Microsoft so kindly provides. fd.c will

Re: [HACKERS] signed short fd

2005-03-14 Thread pgsql
[EMAIL PROTECTED] writes: The POSIX spec requires open() to assign fd's consecutively from zero. http://www.opengroup.org/onlinepubs/007908799/xsh/open.html With all due respect, PostgreSQL now runs natively on Win32. ... using the POSIX APIs that Microsoft so kindly provides. fd.c will

Re: [HACKERS] signed short fd

2005-03-14 Thread Tom Lane
[EMAIL PROTECTED] writes: That is hardly anything that I would feel comfortable with. Lets break this down into all the areas that are ambiguous: There isn't anything ambiguous about this, nor is it credible that there are implementations that don't follow the intent of the spec. Consider the

Re: [HACKERS] signed short fd

2005-03-14 Thread pgsql
[EMAIL PROTECTED] writes: That is hardly anything that I would feel comfortable with. Lets break this down into all the areas that are ambiguous: There isn't anything ambiguous about this, nor is it credible that there are implementations that don't follow the intent of the spec. How do you

Re: [HACKERS] signed short fd

2005-03-14 Thread Andrew Dunstan
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: That is hardly anything that I would feel comfortable with. Lets break this down into all the areas that are ambiguous: There isn't anything ambiguous about this, nor is it credible that there are implementations that don't follow

Re: [HACKERS] signed short fd

2005-03-14 Thread pgsql
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

Re: [HACKERS] signed short fd

2005-03-14 Thread Neil Conway
[EMAIL PROTECTED] wrote: 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() (Why characterise this as a fight, rather than

Re: [HACKERS] signed short fd

2005-03-14 Thread pgsql
[EMAIL PROTECTED] wrote: 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() (Why characterise this as a fight,

Re: [HACKERS] signed short fd

2005-03-14 Thread Christopher Kings-Lynne
I really don't intend to do that, and it does seem to happen a lot. I am the first to admit I lack tact, but often times I view the decisions made as rather arbitrary and lacking a larger perspective, but that is a rant I don't want to get right now. Perhaps it's your lack of a real name and

Re: [HACKERS] signed short fd

2005-03-14 Thread Abhijit Menon-Sen
At 2005-03-14 16:25:22 -0500, [EMAIL PROTECTED] 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

Re: [HACKERS] signed short fd

2005-03-14 Thread Bruce Momjian
Christopher Kings-Lynne wrote: I really don't intend to do that, and it does seem to happen a lot. I am the first to admit I lack tact, but often times I view the decisions made as rather arbitrary and lacking a larger perspective, but that is a rant I don't want to get right now.

Re: [HACKERS] signed short fd

2005-03-14 Thread Mark Woodward
Christopher Kings-Lynne wrote: I really don't intend to do that, and it does seem to happen a lot. I am the first to admit I lack tact, but often times I view the decisions made as rather arbitrary and lacking a larger perspective, but that is a rant I don't want to get right now.

Re: [HACKERS] signed short fd

2005-03-14 Thread Christopher Kings-Lynne
Perhaps it's your lack of a real name and complete anonyminity (hence invulnerablility) that gets to people... Is it fixed? Yeah, hi Mark :) Chris ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [HACKERS] signed short fd

2005-03-14 Thread Bruce Momjian
Mark Woodward wrote: Christopher Kings-Lynne wrote: I really don't intend to do that, and it does seem to happen a lot. I am the first to admit I lack tact, but often times I view the decisions made as rather arbitrary and lacking a larger perspective, but that is a rant I

Re: [HACKERS] signed short fd

2005-03-14 Thread Alvaro Herrera
On Mon, Mar 14, 2005 at 10:45:51PM -0500, Bruce Momjian wrote: Mark Woodward wrote: Bruce, I did want to meet you to a greater extent, but you we surrounded by people and looked quite busy. Yea, I was just teasing. It was a very busy conference. I remember at night just wanting to turn

Re: [HACKERS] signed short fd

2005-03-14 Thread Bruce Momjian
Alvaro Herrera wrote: On Mon, Mar 14, 2005 at 10:45:51PM -0500, Bruce Momjian wrote: Mark Woodward wrote: Bruce, I did want to meet you to a greater extent, but you we surrounded by people and looked quite busy. Yea, I was just teasing. It was a very busy conference. I remember

[HACKERS] signed short fd

2005-03-13 Thread Qingqing Zhou
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

Re: [HACKERS] signed short fd

2005-03-13 Thread Tom Lane
Qingqing Zhou [EMAIL PROTECTED] writes: So is there any special reason we don't worry that convert an integer to short will not lose data? It's not possible for that to happen unless the user has set max_files_per_process to more than 32K, so I'm not particularly worried. Do you know of any