diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-01-12 12:04:51 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-01-12 12:04:51 +0900 |
commit | e72a37528ddaadd796be73fe9b0a0c08b18476d2 (patch) | |
tree | f1e827966b3b0e02ed56b6cfbe96e9f266d6e610 /src/include | |
parent | 08c3ad27eb5348d0cbffa843a3edb11534f9904a (diff) |
Refactor code checking for file existence
jit.c and dfgr.c had a copy of the same code to check if a file exists
or not, with a twist: jit.c did not check for EACCES when failing the
stat() call for the path whose existence is tested. This refactored
routine will be used by an upcoming patch.
Reviewed-by: Ashutosh Bapat
Discussion: https://postgr.es/m/ZTiV8tn_MIb_H2rE@paquier.xyz
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/storage/fd.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h index c4c60bc0a84..60bba5c9708 100644 --- a/src/include/storage/fd.h +++ b/src/include/storage/fd.h @@ -182,6 +182,7 @@ extern int pg_fsync(int fd); extern int pg_fsync_no_writethrough(int fd); extern int pg_fsync_writethrough(int fd); extern int pg_fdatasync(int fd); +extern bool pg_file_exists(const char *fname); extern void pg_flush_data(int fd, off_t offset, off_t nbytes); extern int pg_truncate(const char *path, off_t length); extern void fsync_fname(const char *fname, bool isdir); |