Пример #1
0
int FileWrite( FHANDLE handle, void *buffer, int size )
{
	int ret = 0;

	if( handle.dt == DT_CD ) {
		ret = fioWrite( handle.fh, buffer, size );
	}
	else if( handle.dt == DT_HDD ) {
		ret = fileXioWrite( handle.fh, buffer, size );
	}
	else if( handle.dt == DT_MC ) {
		ret = fioWrite( handle.fh, buffer, size );
	}
	else if( handle.dt == DT_USB ) {
		ret = fioWrite( handle.fh, buffer, size );
	}
	else if( handle.dt == DT_HOST ) {
		ret = fioWrite( handle.fh, buffer, size );
	}
	else if( handle.dt == DT_SMB_SHARE ) {
		ret = smbc_write( handle.fh, buffer, size );
	}

	return ret;
}
Пример #2
0
void AsyncFio::write(int fd, const void *src, unsigned int len) {
	WaitSema(_ioSema);
	checkSync();
	assert(fd < MAX_HANDLES);
	_runningOp = _ioSlots + fd;
	fileXioWrite(fd, (unsigned char*)src, len);
	SignalSema(_ioSema);
}
Пример #3
0
static err_t Write(filestream* p,const void* Data,size_t Size,size_t* Written)
{
    err_t Err;
    int n;

	n = fileXioWrite(p->fd, (void*)Data, (unsigned int)Size);
    if (n<0)
    {
        n=0;
        Err = ERR_WRITE;
    }
    else
        Err = (n != Size) ? ERR_WRITE:ERR_NONE;

    if (Written)
        *Written = n;
    return Err;
}