[lxc-devel] [lxd/master] unixfd: hide symbols
brauner on Github
lxc-bot at linuxcontainers.org
Mon Oct 21 13:39:07 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191021/a321e498/attachment.bin>
-------------- next part --------------
From 0910a4a4613d5340aaacfc2e4bd10d14bbd6daf4 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 21 Oct 2019 15:35:23 +0200
Subject: [PATCH] unixfd: hide symbols
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
lxd/include/compiler.h | 4 ++++
shared/netutils/netns_getifaddrs.c | 4 +++-
shared/netutils/unixfd.h | 21 +++++++++++++--------
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/lxd/include/compiler.h b/lxd/include/compiler.h
index 65457cb31b..2be62d6eb3 100644
--- a/lxd/include/compiler.h
+++ b/lxd/include/compiler.h
@@ -59,6 +59,10 @@
# define __hot __attribute__((hot))
#endif
+#ifndef __hidden
+# define __hidden __attribute__((visibility("hidden")))
+#endif
+
#define __cgfsng_ops
#endif /* __LXC_COMPILER_H */
diff --git a/shared/netutils/netns_getifaddrs.c b/shared/netutils/netns_getifaddrs.c
index 7487b13621..8db051a4d3 100644
--- a/shared/netutils/netns_getifaddrs.c
+++ b/shared/netutils/netns_getifaddrs.c
@@ -1,6 +1,8 @@
// +build none
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
#include <arpa/inet.h>
#include <errno.h>
#include <linux/if.h>
diff --git a/shared/netutils/unixfd.h b/shared/netutils/unixfd.h
index 5aa3fc9a53..64234869bb 100644
--- a/shared/netutils/unixfd.h
+++ b/shared/netutils/unixfd.h
@@ -1,20 +1,25 @@
// +build linux
// +build cgo
-//
+
#ifndef LXD_UNIXFD_H
#define LXD_UNIXFD_H
#include <sys/socket.h>
#include <sys/types.h>
-extern int lxc_abstract_unix_send_fds(int fd, int *sendfds, int num_sendfds,
- void *data, size_t size);
+#include "../../lxd/include/compiler.h"
+
+__hidden extern int lxc_abstract_unix_send_fds(int fd, int *sendfds,
+ int num_sendfds, void *data,
+ size_t size);
-extern ssize_t lxc_abstract_unix_recv_fds_iov(int fd, int *recvfds,
- int num_recvfds,
- struct iovec *iov, size_t iovlen);
+__hidden extern ssize_t lxc_abstract_unix_recv_fds_iov(int fd, int *recvfds,
+ int num_recvfds,
+ struct iovec *iov,
+ size_t iovlen);
-extern ssize_t lxc_abstract_unix_recv_fds(int fd, int *recvfds, int num_recvfds,
- void *data, size_t size);
+__hidden extern ssize_t lxc_abstract_unix_recv_fds(int fd, int *recvfds,
+ int num_recvfds, void *data,
+ size_t size);
#endif // LXD_UNIXFD_H
More information about the lxc-devel
mailing list