[stgt] [PATCH 1/2] add signalfd support

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Tue Sep 15 13:53:32 CEST 2009


On Tue, 15 Sep 2009 14:31:15 +0300
Or Gerlitz <ogerlitz at Voltaire.com> wrote:

> The code doesn't get built on RHEL5.1, see below. Looking on the
> patch, I didn't see an easy and not too much ugly (i.e fill the code
> with ifdefs) way to make it work in both schemes, since some of the
> code which comes with the patch uses signals wheres before that pipe
> was used... anyway, maybe you'll have an idea how / what would be
> the minimal abstraction here that will allow the code to function
> whether signalfd is supported or not

Duh, sorry about that.

I like a cleaner abstraction but I know that I'll remove the pipe code
in the future (probably when RHEL6.x is released) so how about the
following workaround?


diff --git a/usr/bs.c b/usr/bs.c
index e7cfb05..d0fcce4 100644
--- a/usr/bs.c
+++ b/usr/bs.c
@@ -31,7 +31,6 @@
 #include <sys/types.h>
 #include <sys/epoll.h>
 #include <linux/types.h>
-#include <linux/signalfd.h>
 
 #include "list.h"
 #include "tgtd.h"
diff --git a/usr/util.h b/usr/util.h
index acec418..4404a76 100644
--- a/usr/util.h
+++ b/usr/util.h
@@ -8,6 +8,7 @@
 #include <signal.h>
 #include <syscall.h>
 #include <unistd.h>
+#include <linux/types.h>
 
 #include "be_byteshift.h"
 
@@ -118,6 +119,8 @@ static inline int __sync_file_range(int fd, __off64_t offset, __off64_t bytes)
 #endif
 
 #if defined(__NR_signalfd)
+#include <linux/signalfd.h>
+
 static inline int __signalfd(int fd, const sigset_t *mask, int flags)
 {
 	int fd2, ret;
@@ -141,7 +144,9 @@ static inline int __signalfd(int fd, const sigset_t *mask, int flags)
 	return fd2;
 }
 #else
-#define __signalfd() (-1)
+#define __signalfd(fd, mask, flags) (-1)
+struct signalfd_siginfo {
+};
 #endif
 
 #endif
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list