Files

35 lines
597 B
C
Raw Permalink Normal View History

2018-02-23 00:57:47 +00:00
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/iosupport.h>
2018-05-27 20:47:46 +01:00
int fsync( int fileDesc ) {
2018-02-23 00:57:47 +00:00
int ret = -1;
unsigned int dev = 0;
unsigned int fd = -1;
struct _reent *r = _REENT;
__handle * handle;
handle = __get_handle(fileDesc);
if ( NULL == handle ) {
errno = EINVAL;
return ret;
}
dev = handle->device;
if(devoptab_list[dev]->fsync_r) {
r->deviceData = devoptab_list[dev]->deviceData;
ret = devoptab_list[dev]->fsync_r(r, handle->fileStruct);
} else
r->_errno=ENOSYS;
return ret;
}