diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -47,7 +47,7 @@ static int init_cwd(void) return 0; } -core_initcall(init_cwd); +postcore_initcall(init_cwd); /* * - Remove all multiple slashes @@ -448,6 +448,23 @@ out: return errno; } +int erase(int fd, size_t count, unsigned long offset) +{ + struct device_d *dev; + struct fs_driver_d *fsdrv; + FILE *f = &files[fd]; + + dev = f->dev; + + fsdrv = (struct fs_driver_d *)dev->driver->type_data; + + if (f->pos + count > f->size) + count = f->size - f->pos; + errno = fsdrv->erase(dev, f, count, offset); + + return errno; +} + int close(int fd) { struct device_d *dev; |