git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
IPStack - Making TCP a little less chatty
[tpg/acess2.git]
/
AcessNative
/
acesskernel_src
/
nativefs.c
diff --git
a/AcessNative/acesskernel_src/nativefs.c
b/AcessNative/acesskernel_src/nativefs.c
index
ca2f7df
..
4f1b377
100644
(file)
--- a/
AcessNative/acesskernel_src/nativefs.c
+++ b/
AcessNative/acesskernel_src/nativefs.c
@@
-6,8
+6,10
@@
* - Host filesystem access
\r
*/
\r
#define DEBUG 1
\r
* - Host filesystem access
\r
*/
\r
#define DEBUG 1
\r
+#define off_t _acess_off_t
\r
#include <acess.h> // Acess
\r
#include <vfs.h> // Acess
\r
#include <acess.h> // Acess
\r
#include <vfs.h> // Acess
\r
+#undef off_t
\r
#include <dirent.h> // Posix
\r
#include <sys/stat.h> // Posix
\r
#include <stdio.h> // Posix
\r
#include <dirent.h> // Posix
\r
#include <sys/stat.h> // Posix
\r
#include <stdio.h> // Posix
\r
@@
-33,6
+35,13
@@
char *NativeFS_ReadDir(tVFS_Node *Node, int Position);
Uint64 NativeFS_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
\r
\r
// === GLOBALS ===
\r
Uint64 NativeFS_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
\r
\r
// === GLOBALS ===
\r
+tVFS_NodeType gNativeFS_FileNodeType = {
\r
+ .Read = NativeFS_Read
\r
+};
\r
+tVFS_NodeType gNativeFS_DirNodeType = {
\r
+ .FindDir = NativeFS_FindDir,
\r
+ .ReadDir = NativeFS_ReadDir,
\r
+};
\r
tVFS_Driver gNativeFS_Driver = {
\r
"nativefs", 0,
\r
NativeFS_Mount, NativeFS_Unmount,
\r
tVFS_Driver gNativeFS_Driver = {
\r
"nativefs", 0,
\r
NativeFS_Mount, NativeFS_Unmount,
\r
@@
-70,9
+79,9
@@
tVFS_Node *NativeFS_Mount(const char *Device, const char **Arguments)
ret->ImplInt = strlen(ret->Data);
\r
ret->ImplPtr = info;
\r
ret->Inode = (Uint64)dp;
\r
ret->ImplInt = strlen(ret->Data);
\r
ret->ImplPtr = info;
\r
ret->Inode = (Uint64)dp;
\r
-
\r
- ret->FindDir = NativeFS_FindDir;
\r
- ret->
ReadDir = NativeFS_ReadDir;
\r
+ ret->Flags = VFS_FFLAG_DIRECTORY;
\r
+
\r
+ ret->
Type = &gNativeFS_DirNodeType;
\r
\r
return ret;
\r
}
\r
\r
return ret;
\r
}
\r
@@
-124,8
+133,7
@@
tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name)
{
\r
LOG("Directory");
\r
baseRet.Inode = (Uint64) opendir(path);
\r
{
\r
LOG("Directory");
\r
baseRet.Inode = (Uint64) opendir(path);
\r
- baseRet.FindDir = NativeFS_FindDir;
\r
- baseRet.ReadDir = NativeFS_ReadDir;
\r
+ baseRet.Type = &gNativeFS_DirNodeType;
\r
baseRet.Flags |= VFS_FFLAG_DIRECTORY;
\r
baseRet.Size = -1;
\r
}
\r
baseRet.Flags |= VFS_FFLAG_DIRECTORY;
\r
baseRet.Size = -1;
\r
}
\r
@@
-133,7
+141,7
@@
tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name)
{
\r
LOG("File");
\r
baseRet.Inode = (Uint64) fopen(path, "r+");
\r
{
\r
LOG("File");
\r
baseRet.Inode = (Uint64) fopen(path, "r+");
\r
- baseRet.
Read = NativeFS_Read
;
\r
+ baseRet.
Type = &gNativeFS_FileNodeType
;
\r
\r
fseek( (FILE*)(tVAddr)baseRet.Inode, 0, SEEK_END );
\r
baseRet.Size = ftell( (FILE*)(tVAddr)baseRet.Inode );
\r
\r
fseek( (FILE*)(tVAddr)baseRet.Inode, 0, SEEK_END );
\r
baseRet.Size = ftell( (FILE*)(tVAddr)baseRet.Inode );
\r
UCC
git Repository :: git.ucc.asn.au