* The aio_fsync() function shall asynchronously perform a file synchronization * operation, as specified by the op argument, for I/O operations associated with * the file indicated by the file descriptor aio_fildes member of the aiocb * structure referenced by the aiocbp argument and queued at the time of the * call to aio_fsync(). The function call shall return when the synchronization * req
| 117 | * data is not guaranteed to have been successfully transferred. |
| 118 | */ |
| 119 | static void aio_fync_work(struct rt_work* work, void* work_data) |
| 120 | { |
| 121 | int result; |
| 122 | rt_base_t level; |
| 123 | struct aiocb *cb = (struct aiocb*)work_data; |
| 124 | |
| 125 | RT_ASSERT(cb != RT_NULL); |
| 126 | |
| 127 | result = fsync(cb->aio_fildes); |
| 128 | /* modify result */ |
| 129 | level = rt_hw_interrupt_disable(); |
| 130 | if (result < 0) |
| 131 | cb->aio_result = errno; |
| 132 | else |
| 133 | cb->aio_result = 0; |
| 134 | rt_hw_interrupt_enable(level); |
| 135 | |
| 136 | return ; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * @brief Initiates an asynchronous fsync operation. |
nothing calls this directly
no test coverage detected