BlockHandle goes to devices.cpp
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23367 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -131,74 +131,3 @@ CharHandle::Size() const
|
|||||||
// 1024 GB
|
// 1024 GB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
BlockHandle::BlockHandle(int handle)
|
|
||||||
: Handle(handle)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BlockHandle::BlockHandle(void)
|
|
||||||
: Handle()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BlockHandle::~BlockHandle()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
BlockHandle::InitCheck() const
|
|
||||||
{
|
|
||||||
uint32 map = Drvmap();
|
|
||||||
if (!(map & (1 << fHandle)))
|
|
||||||
return ENODEV;
|
|
||||||
//XXX: check size
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ssize_t
|
|
||||||
BlockHandle::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
|
|
||||||
{
|
|
||||||
const char *string = (const char *)buffer;
|
|
||||||
|
|
||||||
// can't seek
|
|
||||||
for (i = 0; i < bufferSize; i++) {
|
|
||||||
if (Bconstat(fHandle) == 0)
|
|
||||||
return i;
|
|
||||||
string[i] = (char)Bconin(fHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bufferSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ssize_t
|
|
||||||
BlockHandle::WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize)
|
|
||||||
{
|
|
||||||
const char *string = (const char *)buffer;
|
|
||||||
|
|
||||||
// can't seek
|
|
||||||
for (i = 0; i < bufferSize; i++) {
|
|
||||||
Bconout(fHandle, string[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bufferSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
off_t
|
|
||||||
BlockHandle::Size() const
|
|
||||||
{
|
|
||||||
// ToDo: fix this!
|
|
||||||
return 1024LL * 1024 * 1024 * 1024;
|
|
||||||
// 1024 GB
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user