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-2021, 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. */
30 } FileSet;
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
static PgChecksumMode mode
Definition: pg_checksums.c:65
pid_t creator_pid
Definition: fileset.h:24
uint32 number
Definition: fileset.h:25
File FileSetOpen(FileSet *fileset, const char *name, int mode)
Definition: fileset.c:121
unsigned int Oid
Definition: postgres_ext.h:31
void FileSetInit(FileSet *fileset)
Definition: fileset.c:54
bool FileSetDelete(FileSet *fileset, const char *name, bool error_on_failure)
Definition: fileset.c:138
Oid tablespaces[8]
Definition: fileset.h:27
struct FileSet FileSet
void FileSetDeleteAll(FileSet *fileset)
Definition: fileset.c:152
unsigned int uint32
Definition: c.h:441
int ntablespaces
Definition: fileset.h:26
File FileSetCreate(FileSet *fileset, const char *name)
Definition: fileset.c:94
const char * name
Definition: encode.c:561
int File
Definition: fd.h:54