mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
Noux: add ioctl() to Vfs
File_io_channel now includes ioctl() because pseudo devices which are implemented as a file-system, e.g. /dev/tty, are controlled via ioctl() requests. The method is exported to the Vfs through the Vfs_io_channel class.
This commit is contained in:
parent
c24a95b819
commit
5c413929ef
@ -27,6 +27,12 @@ namespace Noux {
|
||||
virtual bool write(Sysio *sysio, Vfs_handle *vfs_handle) = 0;
|
||||
virtual bool read(Sysio *sysio, Vfs_handle *vfs_handle) = 0;
|
||||
virtual bool ftruncate(Sysio *sysio, Vfs_handle *vfs_handle) = 0;
|
||||
|
||||
/**
|
||||
* This method is only needed in file-systems which actually implement
|
||||
* a device and is therefore false by default.
|
||||
*/
|
||||
virtual bool ioctl(Sysio *sysio, Vfs_handle *vfs_handle) { return false; }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,7 @@ namespace Noux {
|
||||
bool write(Sysio *sysio, Vfs_handle *handle) { return _msg("write"); }
|
||||
bool read(Sysio *sysio, Vfs_handle *handle) { return _msg("read"); }
|
||||
bool ftruncate(Sysio *sysio, Vfs_handle *handle) { return _msg("ftruncate"); }
|
||||
bool ioctl(Sysio *sysio, Vfs_handle *handle) { return _msg("ioctl"); }
|
||||
};
|
||||
static Pseudo_file_io_service fs;
|
||||
return &fs;
|
||||
|
@ -136,6 +136,11 @@ namespace Noux {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ioctl(Sysio *sysio)
|
||||
{
|
||||
return _fh->fs()->ioctl(sysio, _fh);
|
||||
}
|
||||
|
||||
bool lseek(Sysio *sysio)
|
||||
{
|
||||
switch (sysio->lseek_in.whence) {
|
||||
|
Loading…
Reference in New Issue
Block a user