PostgreSQL Source Code  git master
file_utils.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * Assorted utility functions to work on files.
4  *
5  *
6  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/common/file_utils.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef FILE_UTILS_H
14 #define FILE_UTILS_H
15 
16 #include <dirent.h>
17 
18 typedef enum PGFileType
19 {
25 } PGFileType;
26 
27 #ifdef FRONTEND
28 extern int fsync_fname(const char *fname, bool isdir);
29 extern void fsync_pgdata(const char *pg_data, int serverVersion);
30 extern void fsync_dir_recurse(const char *dir);
31 extern int durable_rename(const char *oldfile, const char *newfile);
32 extern int fsync_parent_path(const char *fname);
33 #endif
34 
35 extern PGFileType get_dirent_type(const char *path,
36  const struct dirent *de,
37  bool look_through_symlinks,
38  int elevel);
39 
40 #endif /* FILE_UTILS_H */
void fsync_fname(const char *fname, bool isdir)
Definition: fd.c:660
PGFileType
Definition: file_utils.h:18
PGFileType get_dirent_type(const char *path, const struct dirent *de, bool look_through_symlinks, int elevel)
Definition: file_utils.c:410
Definition: dirent.h:9
static char * pg_data
Definition: initdb.c:124
int durable_rename(const char *oldfile, const char *newfile, int elevel)
Definition: fd.c:686
static int elevel
Definition: vacuumlazy.c:333
static int fsync_parent_path(const char *fname, int elevel)
Definition: fd.c:3567