Re: pgsql-server/src/port fseeko.c

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Bruce Momjian - CVS <momjian(at)postgresql(dot)org>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql-server/src/port fseeko.c
Date: 2002-10-25 00:00:33
Message-ID: 200210250000.g9P00XV04412@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Peter Eisentraut wrote:
> Bruce Momjian - CVS writes:
>
> > Log message:
> > Make BSD/OS fseeko thread-safe.
>
> I don't think that standard fseeko is thread safe. The whole FILE* based
> API is suspect.

I think the issue is that when you do a SEEK_CUR/SEEK_END, you have to
take a snapshot of where the current pointer is or the current file
size, so you should lock out other threads while you do those
operations. If you didn't, there could be random unreliability in the
function.

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

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2002-10-25 01:33:18 pgsql-server/src/bin/pg_dump common.c pg_backu ...
Previous Message Tom Lane 2002-10-24 23:35:56 pgsql-server/src/interfaces/libpq fe-connect.c ...