vfs: check userland buffers before reading them.
[haiku.git] / src / system / boot / loader / file_systems / amiga_ffs / File.h
blob0758ee5cae99fe58129ab09f492d72f2388e56bf
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef FILE_H
6 #define FILE_H
9 #include <boot/vfs.h>
11 #include "Volume.h"
14 namespace FFS {
16 class File : public Node {
17 public:
18 File(Volume &volume, int32 block);
19 virtual ~File();
21 status_t InitCheck();
23 virtual status_t Open(void **_cookie, int mode);
24 virtual status_t Close(void *cookie);
26 virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize);
27 virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize);
29 virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
30 virtual int32 Type() const;
31 virtual off_t Size() const;
32 virtual ino_t Inode() const;
34 private:
35 Volume &fVolume;
36 FileBlock fNode;
39 } // namespace FFS
41 #endif /* FILE_H */