-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Issue genodelabs#5302
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* \brief File synchronization interface | ||
* \author Benjamin Lamowski | ||
* \date 2024-07-16 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2024 Genode Labs GmbH | ||
* | ||
* This file is part of the Genode OS framework, which is distributed | ||
* under the terms of the GNU Affero General Public License version 3. | ||
*/ | ||
|
||
#ifndef _LIBC__INTERNAL__SYNC_H_ | ||
#define _LIBC__INTERNAL__SYNC_H_ | ||
|
||
/* libc-internal includes */ | ||
#include <internal/init.h> | ||
#include <internal/plugin.h> | ||
#include <internal/vfs_plugin.h> | ||
|
||
namespace Libc { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
class Sync | ||
{ | ||
private: | ||
This comment has been minimized.
Sorry, something went wrong. |
||
enum { INITIAL, TIMESTAMP_UPDATED, QUEUED, COMPLETE } _state { INITIAL }; | ||
|
||
Vfs::Vfs_handle &_vfs_handle; | ||
Vfs::Timestamp _mtime { Vfs::Timestamp::INVALID }; | ||
|
||
public: | ||
Sync(Vfs::Vfs_handle &vfs_handle, Libc::Vfs_plugin::Update_mtime update_mtime, | ||
Libc::Current_real_time ¤t_real_time); | ||
|
||
Sync(Vfs::Vfs_handle &vfs_handle, Plugin & plugin); | ||
|
||
bool complete(); | ||
}; | ||
} | ||
|
||
#endif /* _LIBC__INTERNAL__SYNC_H_ */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,11 @@ namespace Libc { class Vfs_plugin; } | |
|
||
class Libc::Vfs_plugin final : public Plugin | ||
{ | ||
/* | ||
* Needed to construct a sync object from a Vfs_plugin / Plugin reference. | ||
*/ | ||
friend class Sync; | ||
This comment has been minimized.
Sorry, something went wrong.
chelmuth
|
||
|
||
public: | ||
|
||
enum class Update_mtime { NO, YES }; | ||
|
coding style: see kqueue.h for inspiration how to prevent needless indentation