Changeset 21493 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Jul 10, 2009 7:58:31 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r19346 r21493 148 148 fOpenMode |= O_DIRECT; 149 149 #endif 150 #if defined(O_DIRECT) && (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) 151 /* Disable the kernel cache. */ 152 if (fOpen & RTFILE_O_NO_CACHE) 153 fOpenMode |= O_DIRECT; 154 #endif 150 155 151 156 /* create/truncate file */ … … 204 209 || fcntl(fh, F_SETFD, FD_CLOEXEC) >= 0) 205 210 { 206 *pFile = (RTFILE)fh; 207 Assert((int)*pFile == fh); 208 LogFlow(("RTFileOpen(%p:{%RTfile}, %p:{%s}, %#x): returns %Rrc\n", 209 pFile, *pFile, pszFilename, pszFilename, fOpen, rc)); 210 return VINF_SUCCESS; 211 #if defined(RT_OS_SOLARIS) || defined(RT_OS_DARWIN) 212 iErr = 0; 213 /* Switch direct I/O on now if requested */ 214 if (fOpen & RTFILE_O_NO_CACHE) 215 # if defined(RT_OS_SOLARIS) 216 iErr = directio(fh, DIRECTIO_ON); 217 # elif defined(RT_OS_DARWIN) 218 iErr = fcntl(fh, F_NOCACHE); 219 # endif 220 if (iErr < 0) 221 iErr = errno; 222 else 223 #endif 224 { 225 *pFile = (RTFILE)fh; 226 Assert((int)*pFile == fh); 227 LogFlow(("RTFileOpen(%p:{%RTfile}, %p:{%s}, %#x): returns %Rrc\n", 228 pFile, *pFile, pszFilename, pszFilename, fOpen, rc)); 229 return VINF_SUCCESS; 230 } 211 231 } 212 232 iErr = errno; -
trunk/src/VBox/Runtime/r3/win/fileio-win.cpp
r19186 r21493 263 263 if (fOpen & RTFILE_O_ASYNC_IO) 264 264 dwFlagsAndAttributes |= FILE_FLAG_OVERLAPPED; 265 if (fOpen & RTFILE_O_NO_CACHE) 266 dwFlagsAndAttributes |= FILE_FLAG_NO_BUFFERING; 265 267 266 268 /*
Note:
See TracChangeset
for help on using the changeset viewer.