Changeset 23364 in vbox
- Timestamp:
- Sep 28, 2009 11:19:49 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 52888
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/fileaio-posix.cpp
r23343 r23364 45 45 #include "internal/fileaio.h" 46 46 47 #if defined(RT_OS_DARWIN) 47 #if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) 48 48 # include <sys/types.h> 49 49 # include <sys/sysctl.h> /* for sysctlbyname */ 50 #endif 51 #if defined(RT_OS_FREEBSD) 52 # include <fcntl.h> /* O_SYNC */ 50 53 #endif 51 54 #include <aio.h> … … 238 241 pAioLimits->cReqsOutstandingMax = cReqsOutstandingMax; 239 242 pAioLimits->cbBufferAlignment = 0; 243 #elif defined(RT_OS_FREEBSD) 244 /* 245 * The AIO API is implemented in a kernel module which is not 246 * loaded by default. 247 * If it is loaded there are additional sysctl parameters. 248 */ 249 int cReqsOutstandingMax = 0; 250 size_t cbParameter = sizeof(int); 251 252 rcBSD = sysctlbyname("vfs.aio.max_aio_per_proc", /* name */ 253 &cReqsOutstandingMax, /* Where to store the old value. */ 254 &cbParameter, /* Size of the memory pointed to. */ 255 NULL, /* Where the new value is located. */ 256 NULL); /* Where the size of the new value is stored. */ 257 if (rcBSD == -1) 258 { 259 /* ENOENT means the value is unknown thus the module is not loaded. */ 260 if (errno == ENOENT) 261 return VERR_NOT_SUPPORTED; 262 else 263 return RTErrConvertFromErrno(errno); 264 } 265 266 pAioLimits->cReqsOutstandingMax = cReqsOutstandingMax; 267 pAioLimits->cbBufferAlignment = 0; 240 268 #else 241 269 pAioLimits->cReqsOutstandingMax = RTFILEAIO_UNLIMITED_REQS; … … 549 577 if (RT_UNLIKELY(rcPosix < 0)) 550 578 { 551 if ( rcPosix== EAGAIN)579 if (errno == EAGAIN) 552 580 rc = VERR_FILE_AIO_INSUFFICIENT_RESSOURCES; 553 581 else … … 581 609 * -1 and sets errno to the appropriate value 582 610 */ 583 #if defined(RT_OS_DARWIN) 611 #if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) 584 612 Assert(rcPosix == -1); 585 613 pReqInt->Rc = RTErrConvertFromErrno(errno);
Note:
See TracChangeset
for help on using the changeset viewer.