mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
cd92b32622
commit
9f7b8c1a17
@ -142,7 +142,7 @@ class Vfs::Log_file_system : public Single_file_system
|
||||
Genode::Xml_node config)
|
||||
:
|
||||
Single_file_system(Node_type::CONTINUOUS_FILE, name(),
|
||||
Node_rwx::ro(), config),
|
||||
Node_rwx::wo(), config),
|
||||
_label(config.attribute_value("label", Label())),
|
||||
_log(_log_session(env.env()))
|
||||
{ }
|
||||
@ -150,6 +150,7 @@ class Vfs::Log_file_system : public Single_file_system
|
||||
static const char *name() { return "log"; }
|
||||
char const *type() override { return "log"; }
|
||||
|
||||
|
||||
/*********************************
|
||||
** Directory service interface **
|
||||
*********************************/
|
||||
@ -169,6 +170,20 @@ class Vfs::Log_file_system : public Single_file_system
|
||||
catch (Genode::Out_of_ram) { return OPEN_ERR_OUT_OF_RAM; }
|
||||
catch (Genode::Out_of_caps) { return OPEN_ERR_OUT_OF_CAPS; }
|
||||
}
|
||||
|
||||
|
||||
/*******************************
|
||||
** File_io_service interface **
|
||||
*******************************/
|
||||
|
||||
Ftruncate_result ftruncate(Vfs_handle *, file_size) override
|
||||
{
|
||||
/*
|
||||
* Return success to allow for output redirection via '> /dev/log'.
|
||||
* The shell call ftruncate after opening the destination file.
|
||||
*/
|
||||
return FTRUNCATE_OK;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__VFS__LOG_FILE_SYSTEM_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user