9
0
Fork 0

implement truncate for devfs

This commit is contained in:
Sascha Hauer 2007-07-05 21:46:42 +02:00
parent 30433b4db9
commit 11534fdfa2
1 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,13 @@ static int devfs_close(struct device_d *dev, FILE *f)
return 0;
}
static int devfs_truncate(struct device_d *dev, FILE *f, ulong size)
{
if (size > f->dev->size)
return -ENOSPC;
return 0;
}
DIR* devfs_opendir(struct device_d *dev, const char *pathname)
{
DIR *dir;
@ -135,6 +142,7 @@ static struct fs_driver_d devfs_driver = {
.close = devfs_close,
.opendir = devfs_opendir,
.readdir = devfs_readdir,
.truncate = devfs_truncate,
.closedir = devfs_closedir,
.stat = devfs_stat,
.erase = devfs_erase,