1.1 --- a/libfsserver/lib/files/host_file_opener.cc Tue Jan 04 23:27:53 2022 +0100
1.2 +++ b/libfsserver/lib/files/host_file_opener.cc Tue Jan 04 23:43:56 2022 +0100
1.3 @@ -20,6 +20,7 @@
1.4 */
1.5
1.6 #include <sys/stat.h>
1.7 +#include <unistd.h>
1.8
1.9 #include <fsclient/client.h>
1.10
1.11 @@ -131,4 +132,39 @@
1.12 return L4_EOK;
1.13 }
1.14
1.15 +/* Remove a filesystem object. */
1.16 +
1.17 +long HostFileOpener::remove_object(const char *path, fileid_t fileid)
1.18 +{
1.19 + (void) path; (void) fileid;
1.20 + return L4_EOK;
1.21 +}
1.22 +
1.23 +/* Unlink a filesystem object. */
1.24 +
1.25 +long HostFileOpener::unlink_object(const char *path, fileid_t fileid)
1.26 +{
1.27 + /* Ignore the fileid and always use the path. */
1.28 +
1.29 + (void) fileid;
1.30 +
1.31 + // NOTE: Return code may need converting.
1.32 +
1.33 + int err = unlink(path);
1.34 +
1.35 + if (err)
1.36 + return err;
1.37 +
1.38 + /* Remove the file identifier mapping. */
1.39 +
1.40 + std::string s(path);
1.41 +
1.42 + HostFileIdentifiers::iterator it = _fileids.find(s);
1.43 +
1.44 + if (it != _fileids.end())
1.45 + _fileids.erase(it);
1.46 +
1.47 + return L4_EOK;
1.48 +}
1.49 +
1.50 // vim: tabstop=4 expandtab shiftwidth=4