pgsql-server/src/port fseeko.c

Started by Bruce Momjianalmost 24 years ago3 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: momjian@postgresql.org 02/10/23 17:16:17

Modified files:
src/port : fseeko.c

Log message:
Make BSD/OS fseeko thread-safe.

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#1)
Re: pgsql-server/src/port fseeko.c

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.

--
Peter Eisentraut peter_e@gmx.net

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: pgsql-server/src/port fseeko.c

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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073