From a9aa5ee181fca87633fd02f5b966eaf9e01d7aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 28 May 2003 01:56:24 +0000 Subject: [PATCH] Implemented bfs_setflags(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3367 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/ToDo | 2 +- .../kernel/file_systems/bfs/kernel_interface.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/ToDo b/src/add-ons/kernel/file_systems/bfs/ToDo index c3adb15d1a..7426532709 100644 --- a/src/add-ons/kernel/file_systems/bfs/ToDo +++ b/src/add-ons/kernel/file_systems/bfs/ToDo @@ -66,7 +66,7 @@ Volume kernel_interface - - missing functions, maybe they are not really needed: bfs_rename_attr(), bfs_rename_index(), bfs_initialize(), bfs_setflags(), bfs_link() + - missing functions, maybe they are not really needed: bfs_rename_attr(), bfs_rename_index(), bfs_initialize(), bfs_link() - bfs_rename() currently doesn't respect any permissions diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index efc4c95f21..d104be36ab 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -692,13 +692,18 @@ bfs_ioctl(void *_ns, void *_node, void *_cookie, int cmd, void *buffer, size_t b } +/** Sets the open-mode flags for the open file cookie - only + * supports O_APPEND currently, but that should be sufficient + * for a file system. + */ + int -bfs_setflags(void *ns, void *node, void *cookie, int flags) +bfs_setflags(void *_ns, void *_node, void *_cookie, int flags) { FUNCTION_START(("node = %p, flags = %d", node, flags)); - // ToDo: implement bfs_setflags()! - INFORM(("setflags not yet implemented...\n")); + file_cookie *cookie = (file_cookie *)_cookie; + cookie->open_mode = (cookie->open_mode & ~O_APPEND) | (flags & O_APPEND); return B_OK; }