Consistently use "superuser" instead of "super user"
[pgsql.git] / src / include / storage / buffile.h
blob7ae5ea2dde0b0c028ec22d6e3b89e2b4967c5a89
1 /*-------------------------------------------------------------------------
3 * buffile.h
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
16 * access.
18 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
19 * Portions Copyright (c) 1994, Regents of the University of California
21 * src/include/storage/buffile.h
23 *-------------------------------------------------------------------------
26 #ifndef BUFFILE_H
27 #define BUFFILE_H
29 #include "storage/fileset.h"
31 /* BufFile is an opaque type whose details are not known outside buffile.c. */
33 typedef struct BufFile BufFile;
36 * prototypes for functions in buffile.c
39 extern BufFile *BufFileCreateTemp(bool interXact);
40 extern void BufFileClose(BufFile *file);
41 extern size_t BufFileRead(BufFile *file, void *ptr, size_t size);
42 extern void BufFileWrite(BufFile *file, void *ptr, size_t size);
43 extern int BufFileSeek(BufFile *file, int fileno, off_t offset, int whence);
44 extern void BufFileTell(BufFile *file, int *fileno, off_t *offset);
45 extern int BufFileSeekBlock(BufFile *file, long blknum);
46 extern int64 BufFileSize(BufFile *file);
47 extern long BufFileAppend(BufFile *target, BufFile *source);
49 extern BufFile *BufFileCreateFileSet(FileSet *fileset, const char *name);
50 extern void BufFileExportFileSet(BufFile *file);
51 extern BufFile *BufFileOpenFileSet(FileSet *fileset, const char *name,
52 int mode, bool missing_ok);
53 extern void BufFileDeleteFileSet(FileSet *fileset, const char *name,
54 bool missing_ok);
55 extern void BufFileTruncateFileSet(BufFile *file, int fileno, off_t offset);
57 #endif /* BUFFILE_H */