* Flush any OS buffers associated with fh, ensuring that the file * is up to date on disk. Result is >=0 if OK, negative for an * error. * This function is deprecated. It is never called by any other library function, * and you are not required to re-implement it if you are retargeting standard I/O (stdio). */
| 253 | * and you are not required to re-implement it if you are retargeting standard I/O (stdio). |
| 254 | */ |
| 255 | int _sys_ensure(FILEHANDLE fh) |
| 256 | { |
| 257 | #ifdef DFS_USING_POSIX |
| 258 | return fsync(fh); |
| 259 | #else |
| 260 | LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS); |
| 261 | return 0; /* error */ |
| 262 | #endif /* DFS_USING_POSIX */ |
| 263 | } |
| 264 | |
| 265 | /* |
| 266 | * Move the file position to a given offset from the file start. |