Re: Large file support available

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Large file support available
Date: 2002-08-24 03:44:03
Message-ID: 200208240344.g7O3i3A23211@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


OK, with no one replying to this, I will take it upon myself to resolve
this. According to the Mac OSX fseek() manual page:

The fgetpos(), fsetpos(), fseek(), ftell(), and rewind() functions
conform to ANSI X3.159-1989 (``ANSI C'').

The fseeko() and ftello() functions conform to Version 2 of the
Single UNIX Specification (``SUSv2'').

which basically says that we should be using fseek or preferably
fseekpos, not fseeko. I realize that the advantage of fseeko is that it
has the same API as fseek, but if we are going to fix this, we may as
well do it right and use fgetpos if we have it.

Is there anyone who has fseeko() but _not_ fsetpos()?

---------------------------------------------------------------------------

Bruce Momjian wrote:
>
> Peter, I have received no reply to this question.
>
> ---------------------------------------------------------------------------
>
> Bruce Momjian wrote:
> > Peter Eisentraut wrote:
> > > Tom Lane writes:
> > >
> > > > Also, even with configure --disable-largefile, I find that pg_config.h
> > > > still contains
> > > >
> > > > /* Define to 1 to make fseeko visible on some hosts. */
> > > > #define _LARGEFILE_SOURCE 1
> > > >
> > > > /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
> > > > #define HAVE_FSEEKO 1
> > > >
> > > > This strikes me as probably Not a Good Thing, although I haven't dug to
> > > > see what the implications are.
> > >
> > > This is harmless (until proven otherwise). fseeko() is identical to
> > > fseek() except that the offset argument uses off_t, and _LARGEFILE_SOURCE
> > > makes fseeko() and friends visible in the headers. That's all. No large
> > > files involved.
> >
> > I am confused. fseeko() doesn't look standard to me. I though
> > fgetpos/fsetpos() where the standard interfaces for large file support;
> > from BSD/OS:
> >
> > The fgetpos(), fsetpos(), fseek(), ftell(), and rewind() functions con-
> > form to ANSI C X3.159-1989 (``ANSI C '').
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania 19073
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2002-08-24 03:58:02 Re: [GENERAL] PostgreSQL 7.2.2: Security Release
Previous Message Bruce Momjian 2002-08-24 03:36:57 Re: [GENERAL] PostgreSQL 7.2.2: Security Release