Module: xenomai-forge
Branch: next
Commit: ca7abf7612d8579ec79cf28f349feb6c45f4bdb7
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ca7abf7612d8579ec79cf28f349feb6c45f4bdb7

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep 24 11:56:55 2014 +0200

cobalt/rtdm: save open flags in rtdm_fd descriptor

---

 include/cobalt/kernel/rtdm/fd.h |    6 ++++++
 kernel/cobalt/rtdm/core.c       |    1 +
 2 files changed, 7 insertions(+)

diff --git a/include/cobalt/kernel/rtdm/fd.h b/include/cobalt/kernel/rtdm/fd.h
index ec327b3..cf47fcb 100644
--- a/include/cobalt/kernel/rtdm/fd.h
+++ b/include/cobalt/kernel/rtdm/fd.h
@@ -298,6 +298,7 @@ struct rtdm_fd {
        struct cobalt_ppd *owner;
        unsigned int refs;
        int minor;
+       int oflags;
        struct list_head cleanup;
 };
 
@@ -317,6 +318,11 @@ static inline int rtdm_fd_minor(struct rtdm_fd *fd)
        return fd->minor;
 }
 
+static inline int rtdm_fd_flags(struct rtdm_fd *fd)
+{
+       return fd->oflags;
+}
+
 int rtdm_fd_enter(struct rtdm_fd *rtdm_fd, int ufd,
                  unsigned int magic, struct rtdm_fd_ops *ops);
 
diff --git a/kernel/cobalt/rtdm/core.c b/kernel/cobalt/rtdm/core.c
index f5c82f7..cdb0483 100644
--- a/kernel/cobalt/rtdm/core.c
+++ b/kernel/cobalt/rtdm/core.c
@@ -172,6 +172,7 @@ int __rtdm_dev_open(const char *path, int oflag)
                goto fail_create;
 
        context->fd.minor = dev->minor;
+       context->fd.oflags = oflag;
 
        trace_cobalt_fd_open(current, &context->fd, ufd, oflag);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to