Add fio_socklen_t

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>
diff --git a/engines/net.c b/engines/net.c
index 6866ba2..781dd10 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -280,11 +280,7 @@
 
 	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,
@@ -381,11 +377,7 @@
 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;
diff --git a/os/os-hpux.h b/os/os-hpux.h
index 43098ad..93240b3 100644
--- a/os/os-hpux.h
+++ b/os/os-hpux.h
@@ -55,6 +55,9 @@
 #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;
diff --git a/os/os.h b/os/os.h
index a24004b..189041f 100644
--- a/os/os.h
+++ b/os/os.h
@@ -115,6 +115,10 @@
 #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)
 {
diff --git a/server.c b/server.c
index 37ba593..07f3216 100644
--- a/server.c
+++ b/server.c
@@ -400,7 +400,7 @@
 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;
 
@@ -631,7 +631,7 @@
 {
 	struct sockaddr_in saddr_in;
 	struct sockaddr addr;
-	socklen_t len;
+	fio_socklen_t len;
 	int sk, opt, ret;
 
 	dprint(FD_NET, "starting server\n");