54 #define IO_DIRECT_DATA 0x01
55 #define IO_DIRECT_WAL 0x02
56 #define IO_DIRECT_WAL_INIT 0x04
78 #define FILE_POSSIBLY_DELETED(err) ((err) == ENOENT)
80 #define FILE_POSSIBLY_DELETED(err) ((err) == ENOENT || (err) == EACCES)
91 #if defined(O_DIRECT) && defined(pg_attribute_aligned)
92 #define PG_O_DIRECT O_DIRECT
93 #elif defined(F_NOCACHE)
94 #define PG_O_DIRECT 0x80000000
95 #define PG_O_DIRECT_USE_F_NOCACHE
110 extern ssize_t
FileReadV(
File file,
const struct iovec *iov,
int iovcnt, off_t offset,
uint32 wait_event_info);
111 extern ssize_t
FileWriteV(
File file,
const struct iovec *iov,
int iovcnt, off_t offset,
uint32 wait_event_info);
153 extern int BasicOpenFile(
const char *fileName,
int fileFlags);
154 extern int BasicOpenFilePerm(
const char *fileName,
int fileFlags, mode_t fileMode);
187 extern int pg_truncate(
const char *path, off_t length);
188 extern void fsync_fname(
const char *fname,
bool isdir);
189 extern int fsync_fname_ext(
const char *fname,
bool isdir,
bool ignore_perm,
int elevel);
190 extern int durable_rename(
const char *oldfile,
const char *newfile,
int elevel);
195 static inline ssize_t
204 return FileReadV(file, &iov, 1, offset, wait_event_info);
207 static inline ssize_t
216 return FileWriteV(file, &iov, 1, offset, wait_event_info);
#define unconstify(underlying_type, expr)
struct dirent * ReadDir(DIR *dir, const char *dirname)
PGDLLIMPORT int max_safe_fds
void pg_flush_data(int fd, off_t offset, off_t nbytes)
int FileGetRawDesc(File file)
int MakePGDirectory(const char *directoryName)
void FileWriteback(File file, off_t offset, off_t nbytes, uint32 wait_event_info)
int pg_fsync_no_writethrough(int fd)
FILE * AllocateFile(const char *name, const char *mode)
int BasicOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
PGDLLIMPORT int io_direct_flags
int durable_rename(const char *oldfile, const char *newfile, int elevel)
int GetTempTablespaces(Oid *tableSpaces, int numSpaces)
File PathNameOpenTemporaryFile(const char *path, int mode)
int FileSync(File file, uint32 wait_event_info)
int CloseTransientFile(int fd)
int BasicOpenFile(const char *fileName, int fileFlags)
File PathNameCreateTemporaryFile(const char *path, bool error_on_failure)
void PathNameDeleteTemporaryDir(const char *dirname)
int ClosePipeStream(FILE *file)
PGDLLIMPORT bool data_sync_retry
void AtEOXact_Files(bool isCommit)
int FileGetRawFlags(File file)
int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel)
PGDLLIMPORT int recovery_init_sync_method
mode_t FileGetRawMode(File file)
int pg_fsync_writethrough(int fd)
void FileClose(File file)
FILE * OpenPipeStream(const char *command, const char *mode)
void ReleaseExternalFD(void)
void RemovePgTempFilesInDir(const char *tmpdirname, bool missing_ok, bool unlink_all)
bool pg_file_exists(const char *name)
void RemovePgTempFiles(void)
bool TempTablespacesAreSet(void)
void fsync_fname(const char *fname, bool isdir)
int FileFallocate(File file, off_t offset, off_t amount, uint32 wait_event_info)
int FilePrefetch(File file, off_t offset, off_t amount, uint32 wait_event_info)
int data_sync_elevel(int elevel)
File PathNameOpenFile(const char *fileName, int fileFlags)
Oid GetNextTempTableSpace(void)
File PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
bool AcquireExternalFD(void)
struct dirent * ReadDirExtended(DIR *dir, const char *dirname, int elevel)
void InitFileAccess(void)
File OpenTemporaryFile(bool interXact)
int durable_unlink(const char *fname, int elevel)
PGDLLIMPORT int max_files_per_process
void ReserveExternalFD(void)
char * FilePathName(File file)
bool looks_like_temp_rel_name(const char *name)
bool PathNameDeleteTemporaryFile(const char *path, bool error_on_failure)
void set_max_safe_fds(void)
static ssize_t FileRead(File file, void *buffer, size_t amount, off_t offset, uint32 wait_event_info)
void PathNameCreateTemporaryDir(const char *basedir, const char *directory)
static ssize_t FileWrite(File file, const void *buffer, size_t amount, off_t offset, uint32 wait_event_info)
void AtEOSubXact_Files(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid)
int OpenTransientFile(const char *fileName, int fileFlags)
void InitTemporaryFileAccess(void)
int OpenTransientFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
ssize_t FileWriteV(File file, const struct iovec *iov, int iovcnt, off_t offset, uint32 wait_event_info)
void SyncDataDirectory(void)
int FileZero(File file, off_t offset, off_t amount, uint32 wait_event_info)
off_t FileSize(File file)
ssize_t FileReadV(File file, const struct iovec *iov, int iovcnt, off_t offset, uint32 wait_event_info)
int FileTruncate(File file, off_t offset, uint32 wait_event_info)
int pg_truncate(const char *path, off_t length)
void SetTempTablespaces(Oid *tableSpaces, int numSpaces)
DIR * AllocateDir(const char *dirname)
void TempTablespacePath(char *path, Oid tablespace)
static PgChecksumMode mode
static int fd(const char *x, int i)
static const char * directory