Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef FD_H
00040 #define FD_H
00041
00042 #include <dirent.h>
00043
00044
00045
00046
00047
00048
00049 typedef char *FileName;
00050
00051 typedef int File;
00052
00053
00054
00055 extern int max_files_per_process;
00056
00057
00058
00059
00060 extern int max_safe_fds;
00061
00062
00063
00064
00065
00066
00067
00068 extern File PathNameOpenFile(FileName fileName, int fileFlags, int fileMode);
00069 extern File OpenTemporaryFile(bool interXact);
00070 extern void FileClose(File file);
00071 extern int FilePrefetch(File file, off_t offset, int amount);
00072 extern int FileRead(File file, char *buffer, int amount);
00073 extern int FileWrite(File file, char *buffer, int amount);
00074 extern int FileSync(File file);
00075 extern off_t FileSeek(File file, off_t offset, int whence);
00076 extern int FileTruncate(File file, off_t offset);
00077 extern char *FilePathName(File file);
00078
00079
00080 extern FILE *AllocateFile(const char *name, const char *mode);
00081 extern int FreeFile(FILE *file);
00082
00083
00084 extern FILE *OpenPipeStream(const char *command, const char *mode);
00085 extern int ClosePipeStream(FILE *file);
00086
00087
00088 extern DIR *AllocateDir(const char *dirname);
00089 extern struct dirent *ReadDir(DIR *dir, const char *dirname);
00090 extern int FreeDir(DIR *dir);
00091
00092
00093 extern int OpenTransientFile(FileName fileName, int fileFlags, int fileMode);
00094 extern int CloseTransientFile(int fd);
00095
00096
00097 extern int BasicOpenFile(FileName fileName, int fileFlags, int fileMode);
00098
00099
00100 extern void InitFileAccess(void);
00101 extern void set_max_safe_fds(void);
00102 extern void closeAllVfds(void);
00103 extern void SetTempTablespaces(Oid *tableSpaces, int numSpaces);
00104 extern bool TempTablespacesAreSet(void);
00105 extern Oid GetNextTempTableSpace(void);
00106 extern void AtEOXact_Files(void);
00107 extern void AtEOSubXact_Files(bool isCommit, SubTransactionId mySubid,
00108 SubTransactionId parentSubid);
00109 extern void RemovePgTempFiles(void);
00110
00111 extern int pg_fsync(int fd);
00112 extern int pg_fsync_no_writethrough(int fd);
00113 extern int pg_fsync_writethrough(int fd);
00114 extern int pg_fdatasync(int fd);
00115 extern int pg_flush_data(int fd, off_t offset, off_t amount);
00116
00117
00118 #define PG_TEMP_FILES_DIR "pgsql_tmp"
00119 #define PG_TEMP_FILE_PREFIX "pgsql_tmp"
00120
00121 #endif