summaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_pollq.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-12-25 11:01:25 -0800
committerGarrett D'Amore <garrett@damore.org>2019-12-26 15:45:48 -0800
commitd590eceab74772a8d5fa50c94074b09927577ee4 (patch)
tree8c34dc1f510d86540e27437ee15f80e9d88306bb /src/platform/posix/posix_pollq.h
parent440ddf86b3b3b6be47943c5b6408d63b091f2c28 (diff)
downloadnng-d590eceab74772a8d5fa50c94074b09927577ee4.tar.gz
nng-d590eceab74772a8d5fa50c94074b09927577ee4.tar.bz2
nng-d590eceab74772a8d5fa50c94074b09927577ee4.zip
Various clang tidy fixups in the POSIX pollers.
Diffstat (limited to 'src/platform/posix/posix_pollq.h')
-rw-r--r--src/platform/posix/posix_pollq.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/platform/posix/posix_pollq.h b/src/platform/posix/posix_pollq.h
index b9786330..76105acc 100644
--- a/src/platform/posix/posix_pollq.h
+++ b/src/platform/posix/posix_pollq.h
@@ -1,5 +1,5 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -23,18 +23,21 @@
#include <poll.h>
typedef struct nni_posix_pfd nni_posix_pfd;
-typedef void (*nni_posix_pfd_cb)(nni_posix_pfd *, int, void *);
-
-extern int nni_posix_pollq_sysinit(void);
-extern void nni_posix_pollq_sysfini(void);
+typedef void (*nni_posix_pfd_cb)(nni_posix_pfd *, unsigned, void *);
extern int nni_posix_pfd_init(nni_posix_pfd **, int);
extern void nni_posix_pfd_fini(nni_posix_pfd *);
-extern int nni_posix_pfd_arm(nni_posix_pfd *, int);
+extern int nni_posix_pfd_arm(nni_posix_pfd *, unsigned);
extern int nni_posix_pfd_fd(nni_posix_pfd *);
extern void nni_posix_pfd_close(nni_posix_pfd *);
extern void nni_posix_pfd_set_cb(nni_posix_pfd *, nni_posix_pfd_cb, void *);
+#define NNI_POLL_IN ((unsigned) POLLIN)
+#define NNI_POLL_OUT ((unsigned) POLLOUT)
+#define NNI_POLL_HUP ((unsigned) POLLHUP)
+#define NNI_POLL_ERR ((unsigned) POLLERR)
+#define NNI_POLL_INVAL ((unsigned) POLLNVAL)
+
#endif // NNG_PLATFORM_POSIX
#endif // PLATFORM_POSIX_POLLQ_H