PostgreSQL Source Code
git master
|
#include <dirent.h>
Go to the source code of this file.
Macros | |
#define | PG_TEMP_FILES_DIR "pgsql_tmp" |
#define | PG_TEMP_FILE_PREFIX "pgsql_tmp" |
Typedefs | |
typedef enum PGFileType | PGFileType |
typedef enum DataDirSyncMethod | DataDirSyncMethod |
Enumerations | |
enum | PGFileType { PGFILETYPE_ERROR , PGFILETYPE_UNKNOWN , PGFILETYPE_REG , PGFILETYPE_DIR , PGFILETYPE_LNK } |
enum | DataDirSyncMethod { DATA_DIR_SYNC_METHOD_FSYNC , DATA_DIR_SYNC_METHOD_SYNCFS } |
Functions | |
PGFileType | get_dirent_type (const char *path, const struct dirent *de, bool look_through_symlinks, int elevel) |
int | compute_remaining_iovec (struct iovec *destination, const struct iovec *source, int iovcnt, size_t transferred) |
ssize_t | pg_pwritev_with_retry (int fd, const struct iovec *iov, int iovcnt, off_t offset) |
ssize_t | pg_pwrite_zeros (int fd, size_t size, off_t offset) |
#define PG_TEMP_FILE_PREFIX "pgsql_tmp" |
Definition at line 63 of file file_utils.h.
#define PG_TEMP_FILES_DIR "pgsql_tmp" |
Definition at line 62 of file file_utils.h.
typedef enum DataDirSyncMethod DataDirSyncMethod |
typedef enum PGFileType PGFileType |
enum DataDirSyncMethod |
Enumerator | |
---|---|
DATA_DIR_SYNC_METHOD_FSYNC | |
DATA_DIR_SYNC_METHOD_SYNCFS |
Definition at line 27 of file file_utils.h.
enum PGFileType |
Enumerator | |
---|---|
PGFILETYPE_ERROR | |
PGFILETYPE_UNKNOWN | |
PGFILETYPE_REG | |
PGFILETYPE_DIR | |
PGFILETYPE_LNK |
Definition at line 18 of file file_utils.h.
int compute_remaining_iovec | ( | struct iovec * | destination, |
const struct iovec * | source, | ||
int | iovcnt, | ||
size_t | transferred | ||
) |
Definition at line 593 of file file_utils.c.
References Assert, and source.
Referenced by mdreadv(), mdwritev(), and pg_pwritev_with_retry().
PGFileType get_dirent_type | ( | const char * | path, |
const struct dirent * | de, | ||
bool | look_through_symlinks, | ||
int | elevel | ||
) |
Definition at line 526 of file file_utils.c.
References dirent::d_type, DT_DIR, DT_LNK, DT_REG, ereport, errcode_for_file_access(), errmsg(), lstat, pg_log_generic(), PG_LOG_PRIMARY, PGFILETYPE_DIR, PGFILETYPE_ERROR, PGFILETYPE_LNK, PGFILETYPE_REG, PGFILETYPE_UNKNOWN, S_ISDIR, S_ISLNK, S_ISREG, stat::st_mode, and stat.
Referenced by CheckPointLogicalRewriteHeap(), CheckPointSnapBuild(), CheckTablespaceDirectory(), copydir(), do_pg_backup_start(), GetConfFilesInDir(), pg_tzenumerate_next(), process_directory_recursively(), RemovePgTempFilesInDir(), RemoveXlogFile(), rmtree(), scan_for_existing_tablespaces(), StartupReplicationSlots(), and walkdir().
ssize_t pg_pwrite_zeros | ( | int | fd, |
size_t | size, | ||
off_t | offset | ||
) |
Definition at line 688 of file file_utils.c.
References Assert, fd(), PG_IOV_MAX, pg_pwritev_with_retry(), size, and unconstify.
Referenced by dir_open_for_write(), FileZero(), and XLogFileInitInternal().
ssize_t pg_pwritev_with_retry | ( | int | fd, |
const struct iovec * | iov, | ||
int | iovcnt, | ||
off_t | offset | ||
) |
Definition at line 638 of file file_utils.c.
References compute_remaining_iovec(), fd(), Min, PG_IOV_MAX, and pg_pwritev().
Referenced by pg_pwrite_zeros().