Subversion Repositories HelenOS

Rev

Rev 2518 | Rev 2521 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2518 Rev 2520
Line 33... Line 33...
33
/**
33
/**
34
 * @file    vfs.c
34
 * @file    vfs.c
35
 * @brief   VFS multiplexer for HelenOS.
35
 * @brief   VFS multiplexer for HelenOS.
36
 */
36
 */
37
 
37
 
-
 
38
#include <ipc/ipc.h>
-
 
39
#include <ipc/services.h>
-
 
40
#include <async.h>
-
 
41
#include <errno.h>
-
 
42
#include "vfs.h"
-
 
43
 
-
 
44
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
-
 
45
{
-
 
46
    ipcarg_t iarg1, iarg2;
-
 
47
 
-
 
48
    /*
-
 
49
     * The connection was opened via the IPC_CONNECT_ME_TO call.
-
 
50
     * This call needs to be answered.
-
 
51
     *
-
 
52
     * The protocol is that the requested action is specified in ARG1
-
 
53
     * of the opening call. If the request has a single integer argument,
-
 
54
     * it is passed in ARG2.
-
 
55
     */
-
 
56
    iarg1 = IPC_GET_ARG1(*icall);
-
 
57
    iarg2 = IPC_GET_ARG2(*icall);
-
 
58
 
-
 
59
    /*
-
 
60
     * Now, the connection can either be from an individual FS,
-
 
61
     * which is trying to register itself and pass us its capabilities.
-
 
62
     * Or, the connection is a regular connection from a client that wants
-
 
63
     * us to do something for it (e.g. open a file, mount a fs etc.).
-
 
64
     */
-
 
65
    switch (iarg1) {
-
 
66
    case VFS_REGISTER:
-
 
67
    case VFS_MOUNT:
-
 
68
    case VFS_UNMOUNT:
-
 
69
    case VFS_OPEN:
-
 
70
    default:
-
 
71
        ipc_answer_fast(iid, ENOTSUP, 0, 0);
-
 
72
        break;
-
 
73
    }
-
 
74
}
-
 
75
 
38
int main(int argc, char **argv)
76
int main(int argc, char **argv)
39
{
77
{
-
 
78
    ipcarg_t phonead;
-
 
79
 
-
 
80
    async_set_client_connection(vfs_connection);
-
 
81
    ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, &phonead);
-
 
82
    async_manager();
40
    return 0;
83
    return 0;
41
}
84
}
42
 
85
 
43
/**
86
/**
44
 * @}
87
 * @}