parent
18e586daed
commit
316f9e4df3
|
@ -767,6 +767,17 @@ struct Libc::Kernel final : Vfs::Io_response_handler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alloc new watch handler for given path
|
||||||
|
*/
|
||||||
|
Vfs::Vfs_watch_handle *alloc_watch_handle(char const *path)
|
||||||
|
{
|
||||||
|
Vfs::Vfs_watch_handle *watch_handle { nullptr };
|
||||||
|
typedef Vfs::Directory_service::Watch_result Result;
|
||||||
|
return _libc_env.vfs().watch(path, &watch_handle, _heap) == Result::WATCH_OK
|
||||||
|
? watch_handle : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************
|
/****************************************
|
||||||
** Vfs::Io_response_handler interface **
|
** Vfs::Io_response_handler interface **
|
||||||
|
@ -857,6 +868,12 @@ void Libc::dispatch_pending_io_signals()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Vfs::Vfs_watch_handle *Libc::watch(char const *path)
|
||||||
|
{
|
||||||
|
return kernel->alloc_watch_handle(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Genode::Duration Libc::current_time()
|
Genode::Duration Libc::current_time()
|
||||||
{
|
{
|
||||||
return kernel->current_time();
|
return kernel->current_time();
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <base/duration.h>
|
#include <base/duration.h>
|
||||||
#include <util/xml_node.h>
|
#include <util/xml_node.h>
|
||||||
|
#include <vfs/vfs_handle.h>
|
||||||
|
|
||||||
namespace Libc {
|
namespace Libc {
|
||||||
|
|
||||||
|
@ -51,6 +52,16 @@ namespace Libc {
|
||||||
|
|
||||||
void dispatch_pending_io_signals();
|
void dispatch_pending_io_signals();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get watch handle for given path
|
||||||
|
*
|
||||||
|
* \param path path that should be be watched
|
||||||
|
*
|
||||||
|
* \return point to the watch handle object or a nullptr
|
||||||
|
* when the watch operation failed
|
||||||
|
*/
|
||||||
|
Vfs::Vfs_watch_handle *watch(char const *path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get time since startup in ms
|
* Get time since startup in ms
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user