}
}
-// Check a traditional Uinx return code (-1 and sets errno on error), throw
+// Check a traditional Unix return code (-1 and sets errno on error), throw
// on error.
inline void checkUnixError(ssize_t ret, const char* msg) {
if (UNLIKELY(ret == -1)) {
};
/**
- * Create an AsyncIO context capacble of holding at most 'capacity' pending
+ * Create an AsyncIO context capable of holding at most 'capacity' pending
* requests at the same time. As requests complete, others can be scheduled,
* as long as this limit is not exceeded.
*
*
* If pollMode is POLLABLE, pollFd() will return a file descriptor that
* can be passed to poll / epoll / select and will become readable when
- * any IOs on this AioReader have completed. If you do this, you must use
+ * any IOs on this AsyncIO have completed. If you do this, you must use
* pollCompleted() instead of wait() -- do not read from the pollFd()
* file descriptor directly.
*/
}
}
-TemporaryFile thisBinary(6 << 20); // 6MiB
+TemporaryFile tempFile(6 << 20); // 6MiB
void testReadsSerially(const std::vector<TestSpec>& specs,
AsyncIO::PollMode pollMode) {
AsyncIO aioReader(1, pollMode);
AsyncIO::Op op;
- int fd = ::open(thisBinary.path().c_str(), O_DIRECT | O_RDONLY);
+ int fd = ::open(tempFile.path().c_str(), O_DIRECT | O_RDONLY);
PCHECK(fd != -1);
SCOPE_EXIT {
::close(fd);
std::unique_ptr<AsyncIO::Op[]> ops(new AsyncIO::Op[specs.size()]);
std::vector<std::unique_ptr<char[]>> bufs(specs.size());
- int fd = ::open(thisBinary.path().c_str(), O_DIRECT | O_RDONLY);
+ int fd = ::open(tempFile.path().c_str(), O_DIRECT | O_RDONLY);
PCHECK(fd != -1);
SCOPE_EXIT {
::close(fd);
TEST(AsyncIO, NonBlockingWait) {
AsyncIO aioReader(1, AsyncIO::NOT_POLLABLE);
AsyncIO::Op op;
- int fd = ::open(thisBinary.path().c_str(), O_DIRECT | O_RDONLY);
+ int fd = ::open(tempFile.path().c_str(), O_DIRECT | O_RDONLY);
PCHECK(fd != -1);
SCOPE_EXIT {
::close(fd);