mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-06 05:54:15 +00:00
ca971bbfd8
This patch changes the top-level directory layout as a preparatory step for improving the tools for managing 3rd-party source codes. The rationale is described in the issue referenced below. Issue #1082
51 lines
892 B
C++
51 lines
892 B
C++
/*
|
|
* \brief Symlink file-system node
|
|
* \author Norman Feske
|
|
* \author Christian Helmuth
|
|
* \date 2013-11-11
|
|
*
|
|
* FIXME unfinished
|
|
*/
|
|
|
|
#ifndef _SYMLINK_H_
|
|
#define _SYMLINK_H_
|
|
|
|
/* local includes */
|
|
#include <node.h>
|
|
#include <lx_util.h>
|
|
|
|
|
|
namespace File_system {
|
|
class Symlink;
|
|
}
|
|
|
|
|
|
class File_system::Symlink : public Node
|
|
{
|
|
private:
|
|
|
|
char _link_to[MAX_PATH_LEN];
|
|
|
|
public:
|
|
|
|
Symlink(char const *name) { Node::name(name); }
|
|
|
|
size_t read(char *dst, size_t len, seek_off_t seek_offset)
|
|
{
|
|
size_t count = min(len, sizeof(_link_to) + 1);
|
|
Genode::strncpy(dst, _link_to, count);
|
|
return count;
|
|
}
|
|
|
|
size_t write(char const *src, size_t len, seek_off_t seek_offset)
|
|
{
|
|
size_t count = min(len, sizeof(_link_to) + 1);
|
|
Genode::strncpy(_link_to, src, count);
|
|
return count;
|
|
}
|
|
|
|
file_size_t length() const { return strlen(_link_to) + 1; }
|
|
};
|
|
|
|
#endif /* _SYMLINK_H_ */
|