WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Stubdom: add support for file creation.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Stubdom: add support for file creation.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Mar 2008 05:40:28 -0700
Delivery-date: Thu, 20 Mar 2008 05:42:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1205839581 0
# Node ID 1eae3adc5bf7e9cfcf0cf363bf553bc075ec7390
# Parent  1efc81ab19cde25e0ba9436dd5c0bb9866be1730
Stubdom: add support for file creation.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 extras/mini-os/include/fcntl.h |    6 ++++++
 extras/mini-os/lib/sys.c       |   22 ++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff -r 1efc81ab19cd -r 1eae3adc5bf7 extras/mini-os/include/fcntl.h
--- a/extras/mini-os/include/fcntl.h    Tue Mar 18 11:15:20 2008 +0000
+++ b/extras/mini-os/include/fcntl.h    Tue Mar 18 11:26:21 2008 +0000
@@ -1,5 +1,9 @@
 #ifndef _I386_FCNTL_H
 #define _I386_FCNTL_H
+
+#ifdef HAVE_LIBC
+#include_next <fcntl.h>
+#else
 
 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
    located on an ext2 file system */
@@ -90,3 +94,5 @@ int open(const char *path, int flags, ..
 int open(const char *path, int flags, ...);
 int fcntl(int fd, int cmd, ...);
 #endif
+
+#endif
diff -r 1efc81ab19cd -r 1eae3adc5bf7 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c  Tue Mar 18 11:15:20 2008 +0000
+++ b/extras/mini-os/lib/sys.c  Tue Mar 18 11:26:21 2008 +0000
@@ -171,8 +171,26 @@ int open(const char *pathname, int flags
         printk("open(%s) -> %d\n", pathname, fd);
         return fd;
     }
-    printk("open(%s)", pathname);
-    fs_fd = fs_open(fs_import, (void *) pathname);
+    printk("open(%s, %x)", pathname, flags);
+    switch (flags & ~O_ACCMODE) {
+        case 0:
+            fs_fd = fs_open(fs_import, (void *) pathname);
+            break;
+        case O_CREAT|O_TRUNC:
+        {
+            va_list ap;
+            mode_t mode;
+            va_start(ap, flags);
+            mode = va_arg(ap, mode_t);
+            va_end(ap);
+            fs_fd = fs_create(fs_import, (void *) pathname, 0, mode);
+            break;
+        }
+        default:
+            printk(" unsupported flags\n");
+            stack_walk();
+            do_exit();
+    }
     if (fs_fd < 0) {
        errno = EIO;
        return -1;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Stubdom: add support for file creation., Xen patchbot-unstable <=