Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
8f86cac2
Commit
8f86cac2
authored
Feb 09, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMQII-69: Make 0MQ build on HP-UX
parent
fd673ae2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
4 deletions
+87
-4
fd_signaler.cpp
src/fd_signaler.cpp
+78
-0
ip.cpp
src/ip.cpp
+1
-3
tcp_connecter.hpp
src/tcp_connecter.hpp
+8
-1
No files found.
src/fd_signaler.cpp
View file @
8f86cac2
...
@@ -211,6 +211,84 @@ zmq::fd_t zmq::fd_signaler_t::get_fd ()
...
@@ -211,6 +211,84 @@ zmq::fd_t zmq::fd_signaler_t::get_fd ()
return
r
;
return
r
;
}
}
#elif defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX
#include <sys/types.h>
#include <sys/socket.h>
zmq
::
fd_signaler_t
::
fd_signaler_t
()
{
int
sv
[
2
];
int
rc
=
socketpair
(
AF_UNIX
,
SOCK_STREAM
,
0
,
sv
);
errno_assert
(
rc
==
0
);
w
=
sv
[
0
];
r
=
sv
[
1
];
// Set the reader to non-blocking mode.
int
flags
=
fcntl
(
r
,
F_GETFL
,
0
);
if
(
flags
==
-
1
)
flags
=
0
;
rc
=
fcntl
(
r
,
F_SETFL
,
flags
|
O_NONBLOCK
);
errno_assert
(
rc
!=
-
1
);
}
zmq
::
fd_signaler_t
::~
fd_signaler_t
()
{
close
(
w
);
close
(
r
);
}
void
zmq
::
fd_signaler_t
::
signal
(
int
signal_
)
{
zmq_assert
(
signal_
>=
0
&&
signal_
<
64
);
unsigned
char
c
=
(
unsigned
char
)
signal_
;
ssize_t
nbytes
=
send
(
w
,
&
c
,
1
,
0
);
errno_assert
(
nbytes
==
1
);
}
uint64_t
zmq
::
fd_signaler_t
::
poll
()
{
// Set the reader to blocking mode.
int
flags
=
fcntl
(
fd
,
F_GETFL
,
0
);
if
(
flags
==
-
1
)
flags
=
0
;
int
rc
=
fcntl
(
fd
,
F_SETFL
,
flags
&
~
O_NONBLOCK
);
errno_assert
(
rc
!=
-
1
);
// Poll for events.
uint64_t
signals
=
check
();
// Set the reader to non-blocking mode.
flags
=
fcntl
(
r
,
F_GETFL
,
0
);
if
(
flags
==
-
1
)
flags
=
0
;
rc
=
fcntl
(
r
,
F_SETFL
,
flags
|
O_NONBLOCK
);
errno_assert
(
rc
!=
-
1
);
return
signals
;
}
uint64_t
zmq
::
fd_signaler_t
::
check
()
{
unsigned
char
buffer
[
64
];
ssize_t
nbytes
=
recv
(
r
,
buffer
,
64
,
0
);
if
(
nbytes
==
-
1
&&
errno
==
EAGAIN
)
return
0
;
zmq_assert
(
nbytes
!=
-
1
);
uint64_t
signals
=
0
;
for
(
int
pos
=
0
;
pos
!=
nbytes
;
pos
++
)
{
zmq_assert
(
buffer
[
pos
]
<
64
);
signals
|=
(
uint64_t
(
1
)
<<
(
buffer
[
pos
]));
}
return
signals
;
}
zmq
::
fd_t
zmq
::
fd_signaler_t
::
get_fd
()
{
return
r
;
}
#else
#else
#include <sys/types.h>
#include <sys/types.h>
...
...
src/ip.cpp
View file @
8f86cac2
...
@@ -96,8 +96,6 @@ static int resolve_nic_name (in_addr* addr_, char const *interface_)
...
@@ -96,8 +96,6 @@ static int resolve_nic_name (in_addr* addr_, char const *interface_)
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/if.h>
#include "formatting.hpp"
static
int
resolve_nic_name
(
in_addr
*
addr_
,
char
const
*
interface_
)
static
int
resolve_nic_name
(
in_addr
*
addr_
,
char
const
*
interface_
)
{
{
// Create a socket.
// Create a socket.
...
@@ -107,7 +105,7 @@ static int resolve_nic_name (in_addr* addr_, char const *interface_)
...
@@ -107,7 +105,7 @@ static int resolve_nic_name (in_addr* addr_, char const *interface_)
struct
ifreq
ifr
;
struct
ifreq
ifr
;
// Copy interface name for ioctl get.
// Copy interface name for ioctl get.
zmq_
strncpy
(
ifr
.
ifr_name
,
interface_
,
sizeof
(
ifr
.
ifr_name
));
strncpy
(
ifr
.
ifr_name
,
interface_
,
sizeof
(
ifr
.
ifr_name
));
// Fetch interface address.
// Fetch interface address.
int
rc
=
ioctl
(
sd
,
SIOCGIFADDR
,
(
caddr_t
)
&
ifr
,
sizeof
(
struct
ifreq
));
int
rc
=
ioctl
(
sd
,
SIOCGIFADDR
,
(
caddr_t
)
&
ifr
,
sizeof
(
struct
ifreq
));
...
...
src/tcp_connecter.hpp
View file @
8f86cac2
...
@@ -20,8 +20,15 @@
...
@@ -20,8 +20,15 @@
#ifndef __ZMQ_TCP_CONNECTER_HPP_INCLUDED__
#ifndef __ZMQ_TCP_CONNECTER_HPP_INCLUDED__
#define __ZMQ_TCP_CONNECTER_HPP_INCLUDED__
#define __ZMQ_TCP_CONNECTER_HPP_INCLUDED__
#include "platform.hpp"
#include "fd.hpp"
#include "fd.hpp"
#include "ip.hpp"
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#else
#include <sys/types.h>
#include <sys/socket.h>
#endif
namespace
zmq
namespace
zmq
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment