MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / aio_fync_work

Function aio_fync_work

components/libc/posix/io/aio/aio.c:119–137  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

117 * data is not guaranteed to have been successfully transferred.
118 */
119static 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.

Callers

nothing calls this directly

Calls 3

fsyncFunction · 0.50
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected