fileset.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*-------------------------------------------------------------------------
  2. *
  3. * fileset.h
  4. * Management of named temporary files.
  5. *
  6. * Portions Copyright (c) 1996-2022, 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. #ifndef FILESET_H
  14. #define FILESET_H
  15. #include "storage/fd.h"
  16. /*
  17. * A set of temporary files.
  18. */
  19. typedef struct FileSet
  20. {
  21. pid_t creator_pid; /* PID of the creating process */
  22. uint32 number; /* per-PID identifier */
  23. int ntablespaces; /* number of tablespaces to use */
  24. Oid tablespaces[8]; /* OIDs of tablespaces to use. Assumes that
  25. * it's rare that there more than temp
  26. * tablespaces. */
  27. } FileSet;
  28. extern void FileSetInit(FileSet *fileset);
  29. extern File FileSetCreate(FileSet *fileset, const char *name);
  30. extern File FileSetOpen(FileSet *fileset, const char *name,
  31. int mode);
  32. extern bool FileSetDelete(FileSet *fileset, const char *name,
  33. bool error_on_failure);
  34. extern void FileSetDeleteAll(FileSet *fileset);
  35. #endif