MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / openFile

Function openFile

src/jrd/os/posix/unix.cpp:887–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885
886
887static int openFile(const PathName& name, const bool forcedWrites,
888 const bool notUseFSCache, const bool readOnly)
889{
890/**************************************
891 *
892 * o p e n F i l e
893 *
894 **************************************
895 *
896 * Functional description
897 * Open a file with appropriate flags.
898 *
899 **************************************/
900
901 int flag = O_BINARY | (readOnly ? O_RDONLY : O_RDWR);
902#ifdef SUPERSERVER_V2
903 flag |= SYNC;
904 // what to do with O_DIRECT here ?
905#else
906 if (forcedWrites)
907 flag |= SYNC;
908 if (notUseFSCache)
909 flag |= O_DIRECT;
910#endif
911
912 return os_utils::open(name.c_str(), flag);
913}
914
915
916static void maybeCloseFile(int& desc)

Callers 2

PIO_force_writeFunction · 0.70
PIO_openFunction · 0.70

Calls 2

openFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected