| 6926 | } |
| 6927 | |
| 6928 | TSReturnCode |
| 6929 | TSAIOWrite(int fd, off_t offset, char *buf, const size_t bufSize, TSCont contp) |
| 6930 | { |
| 6931 | sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS); |
| 6932 | |
| 6933 | Continuation *pCont = reinterpret_cast<Continuation *>(contp); |
| 6934 | AIOCallback *pAIO = new_AIOCallback(); |
| 6935 | |
| 6936 | // TODO: Might be able to remove this when allocations can never fail. |
| 6937 | sdk_assert(sdk_sanity_check_null_ptr((void *)pAIO) == TS_SUCCESS); |
| 6938 | |
| 6939 | pAIO->aiocb.aio_fildes = fd; |
| 6940 | pAIO->aiocb.aio_offset = offset; |
| 6941 | pAIO->aiocb.aio_buf = buf; |
| 6942 | pAIO->aiocb.aio_nbytes = bufSize; |
| 6943 | pAIO->action = pCont; |
| 6944 | pAIO->thread = pCont->mutex->thread_holding; |
| 6945 | |
| 6946 | if (ink_aio_write(pAIO, 1) == 1) { |
| 6947 | return TS_SUCCESS; |
| 6948 | } |
| 6949 | |
| 6950 | return TS_ERROR; |
| 6951 | } |
| 6952 | |
| 6953 | TSReturnCode |
| 6954 | TSAIOThreadNumSet(int thread_num) |
no test coverage detected