summaryrefslogtreecommitdiff
path: root/eio.h
diff options
context:
space:
mode:
authorroot <root>2011-07-05 20:34:42 +0000
committerroot <root>2011-07-05 20:34:42 +0000
commit9ec5a0945ff19e73cf8953060270c9d558be0847 (patch)
treefa2b9d13422d365d7743e612ee1258850c1f5f0e /eio.h
parentdbeca454f3dc7f49df0fd6a848061a1031eca0f7 (diff)
*** empty log message ***
Diffstat (limited to 'eio.h')
-rw-r--r--eio.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/eio.h b/eio.h
index 2f8f029..bfa110d 100644
--- a/eio.h
+++ b/eio.h
@@ -45,6 +45,7 @@ extern "C" {
#endif
#include <stddef.h>
+#include <signal.h>
#include <sys/types.h>
typedef struct eio_req eio_req;
@@ -195,6 +196,12 @@ struct eio_req
long int3; /* chown, fchown: gid */
int errorno; /* errno value on syscall return */
+#if __i386 || __amd64
+ unsigned char cancelled;
+#else
+ sig_atomic_t cancelled;
+#endif
+
unsigned char flags; /* private */
signed char pri; /* the priority */
@@ -210,10 +217,9 @@ struct eio_req
/* _private_ request flags */
enum {
- EIO_FLAG_CANCELLED = 0x01, /* request was cancelled */
- EIO_FLAG_PTR1_FREE = 0x02, /* need to free(ptr1) */
- EIO_FLAG_PTR2_FREE = 0x04, /* need to free(ptr2) */
- EIO_FLAG_GROUPADD = 0x08 /* some request was added to the group */
+ EIO_FLAG_PTR1_FREE = 0x01, /* need to free(ptr1) */
+ EIO_FLAG_PTR2_FREE = 0x02, /* need to free(ptr2) */
+ EIO_FLAG_GROUPADD = 0x04 /* some request was added to the group */
};
/* undocumented/unsupported/private helper */
@@ -308,7 +314,7 @@ void eio_grp_cancel (eio_req *grp); /* cancels all sub requests but not the g
/* request api */
/* true if the request was cancelled, useful in the invoke callback */
-#define EIO_CANCELLED(req) ((req)->flags & EIO_FLAG_CANCELLED)
+#define EIO_CANCELLED(req) ((req)->cancelled)
#define EIO_RESULT(req) ((req)->result)
/* returns a pointer to the result buffer allocated by eio */