PostgreSQL Source Code  git master
fileset.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * fileset.h
4  * Management of named temporary files.
5  *
6  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/storage/fileset.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 #ifndef FILESET_H
15 #define FILESET_H
16 
17 #include "storage/fd.h"
18 
19 /*
20  * A set of temporary files.
21  */
22 typedef struct FileSet
23 {
24  pid_t creator_pid; /* PID of the creating process */
25  uint32 number; /* per-PID identifier */
26  int ntablespaces; /* number of tablespaces to use */
27  Oid tablespaces[8]; /* OIDs of tablespaces to use. Assumes that
28  * it's rare that there more than temp
29  * tablespaces. */
31 
32 extern void FileSetInit(FileSet *fileset);
33 extern File FileSetCreate(FileSet *fileset, const char *name);
34 extern File FileSetOpen(FileSet *fileset, const char *name,
35  int mode);
36 extern bool FileSetDelete(FileSet *fileset, const char *name,
37  bool error_on_failure);
38 extern void FileSetDeleteAll(FileSet *fileset);
39 
40 #endif
unsigned int uint32
Definition: c.h:506
int File
Definition: fd.h:51
File FileSetOpen(FileSet *fileset, const char *name, int mode)
Definition: fileset.c:119
bool FileSetDelete(FileSet *fileset, const char *name, bool error_on_failure)
Definition: fileset.c:136
void FileSetInit(FileSet *fileset)
Definition: fileset.c:52
void FileSetDeleteAll(FileSet *fileset)
Definition: fileset.c:150
struct FileSet FileSet
File FileSetCreate(FileSet *fileset, const char *name)
Definition: fileset.c:92
static PgChecksumMode mode
Definition: pg_checksums.c:56
unsigned int Oid
Definition: postgres_ext.h:31
Oid tablespaces[8]
Definition: fileset.h:27
pid_t creator_pid
Definition: fileset.h:24
uint32 number
Definition: fileset.h:25
int ntablespaces
Definition: fileset.h:26
const char * name