1/*-------------------------------------------------------------------------
4 * Management of large buffered temporary files.
6 * The BufFile routines provide a partial replacement for stdio atop
7 * virtual file descriptors managed by fd.c. Currently they only support
8 * buffered access to a virtual file, without any of stdio's formatting
9 * features. That's enough for immediate needs, but the set of facilities
10 * could be expanded if necessary.
12 * BufFile also supports working with temporary files that exceed the OS
13 * file size limit and/or the largest offset representable in an int.
14 * It might be better to split that out as a separately accessible module,
15 * but currently we have no need for oversize temp files without buffered
18 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
19 * Portions Copyright (c) 1994, Regents of the University of California
21 * src/include/storage/buffile.h
23 *-------------------------------------------------------------------------
31/* BufFile is an opaque type whose details are not known outside buffile.c. */
36 * prototypes for functions in buffile.c
54 int mode,
bool missing_ok);
BufFile * BufFileOpenFileSet(FileSet *fileset, const char *name, int mode, bool missing_ok)
int BufFileSeekBlock(BufFile *file, int64 blknum)
pg_nodiscard size_t BufFileRead(BufFile *file, void *ptr, size_t size)
void BufFileExportFileSet(BufFile *file)
void BufFileReadExact(BufFile *file, void *ptr, size_t size)
BufFile * BufFileCreateTemp(bool interXact)
void BufFileTell(BufFile *file, int *fileno, off_t *offset)
void BufFileWrite(BufFile *file, const void *ptr, size_t size)
size_t BufFileReadMaybeEOF(BufFile *file, void *ptr, size_t size, bool eofOK)
void BufFileTruncateFileSet(BufFile *file, int fileno, off_t offset)
BufFile * BufFileCreateFileSet(FileSet *fileset, const char *name)
int BufFileSeek(BufFile *file, int fileno, off_t offset, int whence)
int64 BufFileSize(BufFile *file)
void BufFileClose(BufFile *file)
int64 BufFileAppend(BufFile *target, BufFile *source)
void BufFileDeleteFileSet(FileSet *fileset, const char *name, bool missing_ok)
static PgChecksumMode mode
static rewind_source * source