summaryrefslogtreecommitdiff
path: root/include/libmnl/libmnl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libmnl/libmnl.h')
-rw-r--r--include/libmnl/libmnl.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
index a647fd9..5adb13c 100644
--- a/include/libmnl/libmnl.h
+++ b/include/libmnl/libmnl.h
@@ -1,14 +1,9 @@
#ifndef _LIBMNL_H_
#define _LIBMNL_H_
-#ifdef __cplusplus
-# include <cstdio>
-# include <cstdint>
-#else
-# include <stdbool.h> /* not in C++ */
-# include <stdio.h>
-# include <stdint.h>
-#endif
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdint.h>
#include <unistd.h>
#include <sys/socket.h> /* for sa_family_t */
#include <linux/netlink.h>
@@ -22,11 +17,13 @@ extern "C" {
*/
#define MNL_SOCKET_AUTOPID 0
-#define MNL_SOCKET_BUFFER_SIZE (getpagesize() < 8192L ? getpagesize() : 8192L)
+#define MNL_SOCKET_BUFFER_SIZE (sysconf(_SC_PAGESIZE) < 8192L ? sysconf(_SC_PAGESIZE) : 8192L)
struct mnl_socket;
-extern struct mnl_socket *mnl_socket_open(int type);
+extern struct mnl_socket *mnl_socket_open(int bus);
+extern struct mnl_socket *mnl_socket_open2(int bus, int flags);
+extern struct mnl_socket *mnl_socket_fdopen(int fd);
extern int mnl_socket_bind(struct mnl_socket *nl, unsigned int groups, pid_t pid);
extern int mnl_socket_close(struct mnl_socket *nl);
extern int mnl_socket_get_fd(const struct mnl_socket *nl);