5c413929ef
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.
40 lines
967 B
C++
40 lines
967 B
C++
/*
|
|
* \brief Interface for operations provided by file I/O service
|
|
* \author Norman Feske
|
|
* \date 2011-02-17
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2011-2012 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU General Public License version 2.
|
|
*/
|
|
|
|
#ifndef _NOUX__FILE_IO_SERVICE_H_
|
|
#define _NOUX__FILE_IO_SERVICE_H_
|
|
|
|
namespace Noux {
|
|
|
|
class Vfs_handle;
|
|
class Sysio;
|
|
|
|
/**
|
|
* Abstract file-system interface
|
|
*/
|
|
struct File_io_service
|
|
{
|
|
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; }
|
|
};
|
|
}
|
|
|
|
#endif /* _NOUX__FILE_IO_SERVICE_H_ */
|