HPUX decides to be different yet again, add an OS typedef
to handle this instead of ifdefs in the code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
do {
if (nd->net_protocol == IPPROTO_UDP) {
do {
if (nd->net_protocol == IPPROTO_UDP) {
-#ifdef __hpux
- int len = sizeof(nd->addr);
-#else
- socklen_t len = sizeof(nd->addr);
-#endif
+ fio_socklen_t len = sizeof(nd->addr);
struct sockaddr *from = (struct sockaddr *) &nd->addr;
ret = recvfrom(io_u->file->fd, io_u->xfer_buf,
struct sockaddr *from = (struct sockaddr *) &nd->addr;
ret = recvfrom(io_u->file->fd, io_u->xfer_buf,
static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
{
struct netio_data *nd = td->io_ops->data;
static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
{
struct netio_data *nd = td->io_ops->data;
-#ifdef __hpux
- int socklen = sizeof(nd->addr);
-#else
- socklen_t socklen = sizeof(nd->addr);
-#endif
+ fio_socklen_t socklen = sizeof(nd->addr);
if (nd->net_protocol == IPPROTO_UDP) {
f->fd = nd->listenfd;
if (nd->net_protocol == IPPROTO_UDP) {
f->fd = nd->listenfd;
#define FIO_OS_HAVE_AIOCB_TYPEDEF
typedef struct aiocb64 os_aiocb_t;
#define FIO_OS_HAVE_AIOCB_TYPEDEF
typedef struct aiocb64 os_aiocb_t;
+#define FIO_OS_HAVE_SOCKLEN_T
+typedef int fio_socklen_t;
+
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
return EINVAL;
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
return EINVAL;
#define FIO_MAX_JOBS 2048
#endif
#define FIO_MAX_JOBS 2048
#endif
+#ifndef FIO_OS_HAVE_SOCKLEN_T
+typedef socklen_t fio_socklen_t;
+#endif
+
#ifdef FIO_USE_GENERIC_SWAP
static inline uint16_t fio_swap16(uint16_t val)
{
#ifdef FIO_USE_GENERIC_SWAP
static inline uint16_t fio_swap16(uint16_t val)
{
static int accept_loop(int listen_sk)
{
struct sockaddr_in addr;
static int accept_loop(int listen_sk)
{
struct sockaddr_in addr;
- socklen_t len = sizeof(addr);
+ fio_socklen_t len = sizeof(addr);
struct pollfd pfd;
int ret, sk, flags, exitval = 0;
struct pollfd pfd;
int ret, sk, flags, exitval = 0;
{
struct sockaddr_in saddr_in;
struct sockaddr addr;
{
struct sockaddr_in saddr_in;
struct sockaddr addr;
int sk, opt, ret;
dprint(FD_NET, "starting server\n");
int sk, opt, ret;
dprint(FD_NET, "starting server\n");