PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2025, 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 */
22typedef 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
32extern void FileSetInit(FileSet *fileset);
33extern File FileSetCreate(FileSet *fileset, const char *name);
34extern File FileSetOpen(FileSet *fileset, const char *name,
35 int mode);
36extern bool FileSetDelete(FileSet *fileset, const char *name,
37 bool error_on_failure);
38extern void FileSetDeleteAll(FileSet *fileset);
39
40#endif
uint32_t uint32
Definition: c.h:485
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:55
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