[freenos] r261 committed - Modified the mount program to directly read the shared FileSystemMount...

  • From: codesite-noreply@xxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Sun, 02 Aug 2009 12:03:28 +0000

Revision: 261
Author: nieklinnenbank
Date: Sun Aug  2 04:36:52 2009
Log: Modified the mount program to directly read the shared FileSystemMount objects.

http://code.google.com/p/freenos/source/detail?r=261

Modified:
 /trunk/bin/mount/Main.cpp
 /trunk/bin/mount/SConscript

=======================================
--- /trunk/bin/mount/Main.cpp   Thu Jun 25 14:50:40 2009
+++ /trunk/bin/mount/Main.cpp   Sun Aug  2 04:36:52 2009
@@ -15,32 +15,22 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */

-#include <API/IPCMessage.h>
-#include <FileSystemMessage.h>
-#include <VirtualFileSystem.h>
-#include <Config.h>
+#include <FileSystemMount.h>
+#include <Shared.h>
+#include <Types.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <fcntl.h>

 int main(int argc, char **argv)
 {
-    FileSystemMessage msg;
-    FileSystemMount mounts[MAX_MOUNTS];
-
-    /* Ask filesystem for active mounts. */
-    msg.action = MountInfo;
-    msg.buffer = (char *) &mounts;
-    msg.size   = sizeof(mounts);
-
-    /* Trap. */
-    IPCMessage(VFSSRV_PID, SendReceive, &msg, sizeof(msg));
+    Shared<FileSystemMount> mounts(FILE_SYSTEM_MOUNT_KEY, MAX_MOUNTS);

     /* Print out. */
     for (Size i = 0; i < MAX_MOUNTS; i++)
     {
-        if (mounts[i].path[0])
-            printf("%s\r\n", mounts[i].path);
+        if (mounts[i]->path[0])
+            printf("%s : PID %u\r\n", mounts[i]->path,
+                                     mounts[i]->procID);
     }
     /* Success. */
     return EXIT_SUCCESS;
=======================================
--- /trunk/bin/mount/SConscript Tue Jun  9 14:55:16 2009
+++ /trunk/bin/mount/SConscript Sun Aug  2 04:36:52 2009
@@ -18,6 +18,6 @@
 from build import *

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
-                     [ 'filesystem', 'filesystem/virtual' ])
+                     [ 'filesystem', 'filesystem/virtual', 'memory', 'process' 
])
 env.Program('mount',  [ 'Main.cpp' ],
             LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])

Other related posts:

  • » [freenos] r261 committed - Modified the mount program to directly read the shared FileSystemMount... - codesite-noreply