From 3497244c41eb467df7c3748701f2e1a5e4c32224 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Sat, 12 Jul 2014 09:01:27 -0500 Subject: [PATCH] Added ZMQ_SHARED message option to zmq_msg_get() --- AUTHORS | 1 + include/zmq.h | 1 + src/zmq.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/AUTHORS b/AUTHORS index 712d0dcd..aeeeab34 100644 --- a/AUTHORS +++ b/AUTHORS @@ -95,6 +95,7 @@ Taras Shpot Tero Marttila Terry Wilson Thijs Terlouw +Thomas Rodgers Toralf Wittner Tore Halvorsen Trevor Bernard diff --git a/include/zmq.h b/include/zmq.h index 3c4aedfb..436c506b 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -311,6 +311,7 @@ ZMQ_EXPORT const char *zmq_msg_gets (zmq_msg_t *msg, const char *property); /* Message options */ #define ZMQ_MORE 1 #define ZMQ_SRCFD 2 +#define ZMQ_SHARED 3 /* Send/recv options. */ #define ZMQ_DONTWAIT 1 diff --git a/src/zmq.cpp b/src/zmq.cpp index fc9002d2..93ebc491 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -629,6 +629,8 @@ int zmq_msg_get (zmq_msg_t *msg_, int property_) case ZMQ_SRCFD: // warning: int64_t to int return ((zmq::msg_t*) msg_)->fd (); + case ZMQ_SHARED: + return (((zmq::msg_t*) msg_)->flags () & zmq::msg_t::shared)? 1: 0; default: errno = EINVAL; return -1;