All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] load librtdm without xeno_rtdm
Date: Thu, 22 Dec 2005 22:01:29 +0100	[thread overview]
Message-ID: <43AB1429.2090300@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 410 bytes --]

Hi,

as suggested in an earlier mail, here is a patch that - as I think -
improves the behaviour of librtdm. It will let applications start even
if the kernel services of RTDM are not available. Instead, -ENODEV or
-EAFNOSUPPORT will be returned in this case when the user tries to open
some device or socket later - just like there is no appropriate driver
loaded, which is actually true!

Please apply.

Jan

[-- Attachment #1.2: librtdm.patch --]
[-- Type: text/x-patch, Size: 1901 bytes --]

Index: src/skins/rtdm/core.c
===================================================================
--- src/skins/rtdm/core.c	(Revision 292)
+++ src/skins/rtdm/core.c	(Arbeitskopie)
@@ -18,6 +18,7 @@
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <errno.h>
 
 #include <xenomai/rtdm/rtdm.h>
 #include <xenomai/rtdm/syscall.h>
@@ -27,19 +28,25 @@
 
 int rt_dev_open(const char *path, int oflag, ...)
 {
-  return XENOMAI_SKINCALL2( __rtdm_muxid,
-                            __rtdm_open,
-                            path,
-                            oflag);
+    if (__rtdm_muxid < 0)
+        return -ENODEV;
+
+    return XENOMAI_SKINCALL2( __rtdm_muxid,
+                              __rtdm_open,
+                              path,
+                              oflag);
 }
 
 int rt_dev_socket(int protocol_family, int socket_type, int protocol)
 {
-  return XENOMAI_SKINCALL3( __rtdm_muxid,
-                            __rtdm_socket,
-                            protocol_family,
-                            socket_type,
-                            protocol);
+    if (__rtdm_muxid < 0)
+        return -EAFNOSUPPORT;
+
+    return XENOMAI_SKINCALL3( __rtdm_muxid,
+                              __rtdm_socket,
+                              protocol_family,
+                              socket_type,
+                              protocol);
 }
 
 int rt_dev_close(int fd)
Index: src/skins/rtdm/init.c
===================================================================
--- src/skins/rtdm/init.c	(Revision 292)
+++ src/skins/rtdm/init.c	(Arbeitskopie)
@@ -53,9 +53,9 @@
 	case -ENOSYS:
 	case -ESRCH:
 
-	    fprintf(stderr,"Xenomai: RTDM skin or CONFIG_XENO_OPT_PERVASIVE disabled.\n");
-	    fprintf(stderr,"(modprobe xeno_rtdm.ko?)\n");
-	    exit(1);
+	    /* we ignore this and fail later when the user tries to open
+	       a device or socket. */
+	    break;
 
 	default:
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

             reply	other threads:[~2005-12-22 21:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-22 21:01 Jan Kiszka [this message]
2005-12-28  9:12 ` [Xenomai-core] [PATCH] load librtdm without xeno_rtdm Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43AB1429.2090300@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.