Set hidden visibility for calls used in lttng-ctl
authorDavid Goulet <dgoulet@efficios.com>
Fri, 24 Aug 2012 18:36:58 +0000 (14:36 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 24 Aug 2012 19:16:14 +0000 (15:16 -0400)
The liblttng-ctl had multiple dynamic symbols that are only used inside
the lttng-tools code tree and should not be exposed to the user.

This commit sets every function calls found with "objdump -T" with a
hidden visibility attribute.

The strpbrk_or_eos() is set static and the struct net_families as well
so we don't export those two symbols.

At this stage there is still the filter_* calls that need to be fixed.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/error.c
src/common/futex.c
src/common/hashtable/utils.c
src/common/runas.c
src/common/sessiond-comm/inet.c
src/common/sessiond-comm/inet6.c
src/common/sessiond-comm/sessiond-comm.c
src/common/sessiond-comm/unix.c
src/common/uri.c
src/common/utils.c

index 016027acdc7ef15a29bdd8a946fbbc97fc7af02b..d5403d804d5c9dc658fcff946a1e74c074bf97a5 100644 (file)
@@ -109,6 +109,7 @@ static const char *error_string_array[] = {
  *
  * These code MUST be negative in other to treat that as an error value.
  */
  *
  * These code MUST be negative in other to treat that as an error value.
  */
+__attribute__((visibility("hidden")))
 const char *error_get_str(int32_t code)
 {
        code = -code;
 const char *error_get_str(int32_t code)
 {
        code = -code;
index adfe66b1c29feb3295949253f315819c8d110d92..3c18f75fc8be6067f64d2a8fa5c97f54ca130dbc 100644 (file)
@@ -49,6 +49,7 @@
  * futex() call. If active, we set the value and wake everyone else we indicate
  * that we are gone (cleanup() case).
  */
  * futex() call. If active, we set the value and wake everyone else we indicate
  * that we are gone (cleanup() case).
  */
+__attribute__((visibility("hidden")))
 void futex_wait_update(int32_t *futex, int active)
 {
        if (active) {
 void futex_wait_update(int32_t *futex, int active)
 {
        if (active) {
@@ -65,6 +66,7 @@ void futex_wait_update(int32_t *futex, int active)
 /*
  * Prepare futex.
  */
 /*
  * Prepare futex.
  */
+__attribute__((visibility("hidden")))
 void futex_nto1_prepare(int32_t *futex)
 {
        uatomic_set(futex, -1);
 void futex_nto1_prepare(int32_t *futex)
 {
        uatomic_set(futex, -1);
@@ -76,6 +78,7 @@ void futex_nto1_prepare(int32_t *futex)
 /*
  * Wait futex.
  */
 /*
  * Wait futex.
  */
+__attribute__((visibility("hidden")))
 void futex_nto1_wait(int32_t *futex)
 {
        cmm_smp_mb();
 void futex_nto1_wait(int32_t *futex)
 {
        cmm_smp_mb();
@@ -90,6 +93,7 @@ void futex_nto1_wait(int32_t *futex)
 /*
  * Wake 1 futex.
  */
 /*
  * Wake 1 futex.
  */
+__attribute__((visibility("hidden")))
 void futex_nto1_wake(int32_t *futex)
 {
        if (caa_unlikely(uatomic_read(futex) == -1)) {
 void futex_nto1_wake(int32_t *futex)
 {
        if (caa_unlikely(uatomic_read(futex) == -1)) {
index 3a0e2b76c8e644d0b4930214e2ac04ab8bd88e93..dd599d798e03417d7e0dd26eea7d7b4db9f34c98 100644 (file)
@@ -449,6 +449,7 @@ static uint32_t __attribute__((unused)) hashlittle(const void *key,
 /*
  * Hash function for number value.
  */
 /*
  * Hash function for number value.
  */
+__attribute__((visibility("hidden")))
 unsigned long hash_key_ulong(void *_key, unsigned long seed)
 {
        union {
 unsigned long hash_key_ulong(void *_key, unsigned long seed)
 {
        union {
@@ -469,6 +470,7 @@ unsigned long hash_key_ulong(void *_key, unsigned long seed)
 /*
  * Hash function for number value.
  */
 /*
  * Hash function for number value.
  */
+__attribute__((visibility("hidden")))
 unsigned long hash_key_ulong(void *_key, unsigned long seed)
 {
        uint32_t key = (uint32_t) _key;
 unsigned long hash_key_ulong(void *_key, unsigned long seed)
 {
        uint32_t key = (uint32_t) _key;
@@ -480,6 +482,7 @@ unsigned long hash_key_ulong(void *_key, unsigned long seed)
 /*
  * Hash function for string.
  */
 /*
  * Hash function for string.
  */
+__attribute__((visibility("hidden")))
 unsigned long hash_key_str(void *key, unsigned long seed)
 {
        return hashlittle(key, strlen((char *) key), seed);
 unsigned long hash_key_str(void *key, unsigned long seed)
 {
        return hashlittle(key, strlen((char *) key), seed);
@@ -488,6 +491,7 @@ unsigned long hash_key_str(void *key, unsigned long seed)
 /*
  * Hash function compare for number value.
  */
 /*
  * Hash function compare for number value.
  */
+__attribute__((visibility("hidden")))
 int hash_match_key_ulong(void *key1, void *key2)
 {
        if (key1 == key2) {
 int hash_match_key_ulong(void *key1, void *key2)
 {
        if (key1 == key2) {
@@ -500,6 +504,7 @@ int hash_match_key_ulong(void *key1, void *key2)
 /*
  * Hash compare function for string.
  */
 /*
  * Hash compare function for string.
  */
+__attribute__((visibility("hidden")))
 int hash_match_key_str(void *key1, void *key2)
 {
        if (strcmp(key1, key2) == 0) {
 int hash_match_key_str(void *key1, void *key2)
 {
        if (strcmp(key1, key2) == 0) {
index 43b154f10869de2e85a57bb7bcc03c7bb646bb72..cb697feee797a0baf36a4e70e008f2e33cb3f787 100644 (file)
@@ -333,6 +333,7 @@ int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid)
        }
 }
 
        }
 }
 
+__attribute__((visibility("hidden")))
 int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid)
 {
        struct run_as_mkdir_data data;
 int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid)
 {
        struct run_as_mkdir_data data;
@@ -344,6 +345,7 @@ int run_as_mkdir_recursive(const char *path, mode_t mode, uid_t uid, gid_t gid)
        return run_as(_mkdir_recursive, &data, uid, gid);
 }
 
        return run_as(_mkdir_recursive, &data, uid, gid);
 }
 
+__attribute__((visibility("hidden")))
 int run_as_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid)
 {
        struct run_as_mkdir_data data;
 int run_as_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid)
 {
        struct run_as_mkdir_data data;
@@ -359,6 +361,7 @@ int run_as_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid)
  * Note: open_run_as is currently not working. We'd need to pass the fd
  * opened in the child to the parent.
  */
  * Note: open_run_as is currently not working. We'd need to pass the fd
  * opened in the child to the parent.
  */
+__attribute__((visibility("hidden")))
 int run_as_open(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid)
 {
        struct run_as_open_data data;
 int run_as_open(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid)
 {
        struct run_as_open_data data;
index e049d021b04727f1ee6559063043f3d0ddada701..e8d3afef316696ebdef315e92e58870f5c784c52 100644 (file)
@@ -47,6 +47,7 @@ static const struct lttcomm_proto_ops inet_ops = {
 /*
  * Creates an PF_INET socket.
  */
 /*
  * Creates an PF_INET socket.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto)
 {
        int val = 1, ret;
 int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto)
 {
        int val = 1, ret;
@@ -77,6 +78,7 @@ error:
 /*
  * Bind socket and return.
  */
 /*
  * Bind socket and return.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_bind_inet_sock(struct lttcomm_sock *sock)
 {
        int ret;
 int lttcomm_bind_inet_sock(struct lttcomm_sock *sock)
 {
        int ret;
@@ -93,6 +95,7 @@ int lttcomm_bind_inet_sock(struct lttcomm_sock *sock)
 /*
  * Connect PF_INET socket.
  */
 /*
  * Connect PF_INET socket.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_connect_inet_sock(struct lttcomm_sock *sock)
 {
        int ret, closeret;
 int lttcomm_connect_inet_sock(struct lttcomm_sock *sock)
 {
        int ret, closeret;
@@ -122,6 +125,7 @@ error_connect:
  * Do an accept(2) on the sock and return the new lttcomm socket. The socket
  * MUST be bind(2) before.
  */
  * Do an accept(2) on the sock and return the new lttcomm socket. The socket
  * MUST be bind(2) before.
  */
+__attribute__((visibility("hidden")))
 struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
 {
        int new_fd;
 struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
 {
        int new_fd;
@@ -163,6 +167,7 @@ error:
 /*
  * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
 /*
  * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_listen_inet_sock(struct lttcomm_sock *sock, int backlog)
 {
        int ret;
 int lttcomm_listen_inet_sock(struct lttcomm_sock *sock, int backlog)
 {
        int ret;
@@ -193,6 +198,7 @@ end:
  *
  * Return the size of received data.
  */
  *
  * Return the size of received data.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
 ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
@@ -229,6 +235,7 @@ ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
  *
  * Return the size of sent data.
  */
  *
  * Return the size of sent data.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
 ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
@@ -271,6 +278,7 @@ ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
 /*
  * Shutdown cleanly and close.
  */
 /*
  * Shutdown cleanly and close.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_close_inet_sock(struct lttcomm_sock *sock)
 {
        int ret;
 int lttcomm_close_inet_sock(struct lttcomm_sock *sock)
 {
        int ret;
index 98aba04306d6dea93020fde056e620f5df5f4fdf..8fe0276013bce4b0f6e613b6230d55b377ffe58f 100644 (file)
@@ -47,6 +47,7 @@ static const struct lttcomm_proto_ops inet6_ops = {
 /*
  * Creates an PF_INET socket.
  */
 /*
  * Creates an PF_INET socket.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto)
 {
        int val = 1, ret;
 int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto)
 {
        int val = 1, ret;
@@ -77,6 +78,7 @@ error:
 /*
  * Bind socket and return.
  */
 /*
  * Bind socket and return.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock)
 {
        int ret;
 int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock)
 {
        int ret;
@@ -93,6 +95,7 @@ int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock)
 /*
  * Connect PF_INET socket.
  */
 /*
  * Connect PF_INET socket.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_connect_inet6_sock(struct lttcomm_sock *sock)
 {
        int ret, closeret;
 int lttcomm_connect_inet6_sock(struct lttcomm_sock *sock)
 {
        int ret, closeret;
@@ -122,6 +125,7 @@ error_connect:
  * Do an accept(2) on the sock and return the new lttcomm socket. The socket
  * MUST be bind(2) before.
  */
  * Do an accept(2) on the sock and return the new lttcomm socket. The socket
  * MUST be bind(2) before.
  */
+__attribute__((visibility("hidden")))
 struct lttcomm_sock *lttcomm_accept_inet6_sock(struct lttcomm_sock *sock)
 {
        int new_fd;
 struct lttcomm_sock *lttcomm_accept_inet6_sock(struct lttcomm_sock *sock)
 {
        int new_fd;
@@ -163,6 +167,7 @@ error:
 /*
  * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
 /*
  * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_listen_inet6_sock(struct lttcomm_sock *sock, int backlog)
 {
        int ret;
 int lttcomm_listen_inet6_sock(struct lttcomm_sock *sock, int backlog)
 {
        int ret;
@@ -193,6 +198,7 @@ end:
  *
  * Return the size of received data.
  */
  *
  * Return the size of received data.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
 ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
@@ -229,6 +235,7 @@ ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
  *
  * Return the size of sent data.
  */
  *
  * Return the size of sent data.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
 ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags)
 {
@@ -271,6 +278,7 @@ ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
 /*
  * Shutdown cleanly and close.
  */
 /*
  * Shutdown cleanly and close.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_close_inet6_sock(struct lttcomm_sock *sock)
 {
        int ret;
 int lttcomm_close_inet6_sock(struct lttcomm_sock *sock)
 {
        int ret;
index 01e5f865dd7d18a5948420076805d3ae02d72504..8ced84734772bb213a70e9a0e5bf71d9a8515f50 100644 (file)
@@ -39,7 +39,7 @@
 /* For Inet6 socket */
 #include "inet6.h"
 
 /* For Inet6 socket */
 #include "inet6.h"
 
-struct lttcomm_net_family net_families[] = {
+static struct lttcomm_net_family net_families[] = {
        { LTTCOMM_INET, lttcomm_create_inet_sock },
        { LTTCOMM_INET6, lttcomm_create_inet6_sock },
 };
        { LTTCOMM_INET, lttcomm_create_inet_sock },
        { LTTCOMM_INET6, lttcomm_create_inet6_sock },
 };
@@ -73,6 +73,7 @@ static const char *lttcomm_readable_code[] = {
  *
  * These code MUST be negative in other to treat that as an error value.
  */
  *
  * These code MUST be negative in other to treat that as an error value.
  */
+__attribute__((visibility("hidden")))
 const char *lttcomm_get_readable_code(enum lttcomm_return_code code)
 {
        code = -code;
 const char *lttcomm_get_readable_code(enum lttcomm_return_code code)
 {
        code = -code;
@@ -88,6 +89,7 @@ const char *lttcomm_get_readable_code(enum lttcomm_return_code code)
  * Create socket from an already allocated lttcomm socket structure and init
  * sockaddr in the lttcomm sock.
  */
  * Create socket from an already allocated lttcomm socket structure and init
  * sockaddr in the lttcomm sock.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_create_sock(struct lttcomm_sock *sock)
 {
        int ret, _sock_type, _sock_proto, domain;
 int lttcomm_create_sock(struct lttcomm_sock *sock)
 {
        int ret, _sock_type, _sock_proto, domain;
@@ -127,6 +129,7 @@ error:
 /*
  * Return allocated lttcomm socket structure.
  */
 /*
  * Return allocated lttcomm socket structure.
  */
+__attribute__((visibility("hidden")))
 struct lttcomm_sock *lttcomm_alloc_sock(enum lttcomm_sock_proto proto)
 {
        struct lttcomm_sock *sock;
 struct lttcomm_sock *lttcomm_alloc_sock(enum lttcomm_sock_proto proto)
 {
        struct lttcomm_sock *sock;
@@ -151,6 +154,7 @@ end:
  * This is mostly useful when lttcomm_sock are passed between process where the
  * fd and ops have to be changed within the correct address space.
  */
  * This is mostly useful when lttcomm_sock are passed between process where the
  * fd and ops have to be changed within the correct address space.
  */
+__attribute__((visibility("hidden")))
 struct lttcomm_sock *lttcomm_alloc_copy_sock(struct lttcomm_sock *src)
 {
        struct lttcomm_sock *sock;
 struct lttcomm_sock *lttcomm_alloc_copy_sock(struct lttcomm_sock *src)
 {
        struct lttcomm_sock *sock;
@@ -175,6 +179,7 @@ alloc_error:
  * This is mostly useful when lttcomm_sock are passed between process where the
  * fd and ops have to be changed within the correct address space.
  */
  * This is mostly useful when lttcomm_sock are passed between process where the
  * fd and ops have to be changed within the correct address space.
  */
+__attribute__((visibility("hidden")))
 void lttcomm_copy_sock(struct lttcomm_sock *dst, struct lttcomm_sock *src)
 {
        /* Safety net */
 void lttcomm_copy_sock(struct lttcomm_sock *dst, struct lttcomm_sock *src)
 {
        /* Safety net */
@@ -191,6 +196,7 @@ void lttcomm_copy_sock(struct lttcomm_sock *dst, struct lttcomm_sock *src)
 /*
  * Init IPv4 sockaddr structure.
  */
 /*
  * Init IPv4 sockaddr structure.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_init_inet_sockaddr(struct lttcomm_sockaddr *sockaddr,
                const char *ip, unsigned int port)
 {
 int lttcomm_init_inet_sockaddr(struct lttcomm_sockaddr *sockaddr,
                const char *ip, unsigned int port)
 {
@@ -221,6 +227,7 @@ error:
 /*
  * Init IPv6 sockaddr structure.
  */
 /*
  * Init IPv6 sockaddr structure.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_init_inet6_sockaddr(struct lttcomm_sockaddr *sockaddr,
                const char *ip, unsigned int port)
 {
 int lttcomm_init_inet6_sockaddr(struct lttcomm_sockaddr *sockaddr,
                const char *ip, unsigned int port)
 {
@@ -249,6 +256,7 @@ error:
 /*
  * Return allocated lttcomm socket structure from lttng URI.
  */
 /*
  * Return allocated lttcomm socket structure from lttng URI.
  */
+__attribute__((visibility("hidden")))
 struct lttcomm_sock *lttcomm_alloc_sock_from_uri(struct lttng_uri *uri)
 {
        int ret;
 struct lttcomm_sock *lttcomm_alloc_sock_from_uri(struct lttng_uri *uri)
 {
        int ret;
@@ -301,6 +309,7 @@ alloc_error:
 /*
  * Destroy and free lttcomm socket.
  */
 /*
  * Destroy and free lttcomm socket.
  */
+__attribute__((visibility("hidden")))
 void lttcomm_destroy_sock(struct lttcomm_sock *sock)
 {
        if (sock != NULL) {
 void lttcomm_destroy_sock(struct lttcomm_sock *sock)
 {
        if (sock != NULL) {
index 837d12b48e1ac9d78ed66818b76191d881e78b32..9ef04ee0df1943ce41b4ca886ee2913d27d21619 100644 (file)
@@ -35,6 +35,7 @@
 /*
  * Connect to unix socket using the path name.
  */
 /*
  * Connect to unix socket using the path name.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_connect_unix_sock(const char *pathname)
 {
        struct sockaddr_un sun;
 int lttcomm_connect_unix_sock(const char *pathname)
 {
        struct sockaddr_un sun;
@@ -76,6 +77,7 @@ error:
  * Do an accept(2) on the sock and return the new file descriptor. The socket
  * MUST be bind(2) before.
  */
  * Do an accept(2) on the sock and return the new file descriptor. The socket
  * MUST be bind(2) before.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_accept_unix_sock(int sock)
 {
        int new_fd;
 int lttcomm_accept_unix_sock(int sock)
 {
        int new_fd;
@@ -95,6 +97,7 @@ int lttcomm_accept_unix_sock(int sock)
  * Creates a AF_UNIX local socket using pathname bind the socket upon creation
  * and return the fd.
  */
  * Creates a AF_UNIX local socket using pathname bind the socket upon creation
  * and return the fd.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_create_unix_sock(const char *pathname)
 {
        struct sockaddr_un sun;
 int lttcomm_create_unix_sock(const char *pathname)
 {
        struct sockaddr_un sun;
@@ -129,6 +132,7 @@ error:
 /*
  * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
 /*
  * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_listen_unix_sock(int sock)
 {
        int ret;
 int lttcomm_listen_unix_sock(int sock)
 {
        int ret;
@@ -147,6 +151,7 @@ int lttcomm_listen_unix_sock(int sock)
  *
  * Return the size of received data.
  */
  *
  * Return the size of received data.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
 {
        struct msghdr msg;
 ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
 {
        struct msghdr msg;
@@ -175,6 +180,7 @@ ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
  *
  * Return the size of sent data.
  */
  *
  * Return the size of sent data.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
 {
        struct msghdr msg;
 ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
 {
        struct msghdr msg;
@@ -205,6 +211,7 @@ ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
 /*
  * Shutdown cleanly a unix socket.
  */
 /*
  * Shutdown cleanly a unix socket.
  */
+__attribute__((visibility("hidden")))
 int lttcomm_close_unix_sock(int sock)
 {
        int ret, closeret;
 int lttcomm_close_unix_sock(int sock)
 {
        int ret, closeret;
@@ -228,6 +235,7 @@ int lttcomm_close_unix_sock(int sock)
  *
  * Returns the size of data sent, or negative error value.
  */
  *
  * Returns the size of data sent, or negative error value.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
 {
        struct msghdr msg;
 ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
 {
        struct msghdr msg;
@@ -282,6 +290,7 @@ ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
  * Expect at most "nb_fd" file descriptors. Returns the number of fd
  * actually received in nb_fd.
  */
  * Expect at most "nb_fd" file descriptors. Returns the number of fd
  * actually received in nb_fd.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd)
 {
        struct iovec iov[1];
 ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd)
 {
        struct iovec iov[1];
@@ -347,6 +356,7 @@ end:
  *
  * Returns the size of data sent, or negative error value.
  */
  *
  * Returns the size of data sent, or negative error value.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
 {
        struct msghdr msg;
 ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
 {
        struct msghdr msg;
@@ -402,6 +412,7 @@ ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
  *
  * Returns the size of received data, or negative error value.
  */
  *
  * Returns the size of received data, or negative error value.
  */
+__attribute__((visibility("hidden")))
 ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
                lttng_sock_cred *creds)
 {
 ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
                lttng_sock_cred *creds)
 {
@@ -491,6 +502,7 @@ end:
  * Set socket option to use credentials passing.
  */
 #ifdef __linux__
  * Set socket option to use credentials passing.
  */
 #ifdef __linux__
+__attribute__((visibility("hidden")))
 int lttcomm_setsockopt_creds_unix_sock(int sock)
 {
        int ret, on = 1;
 int lttcomm_setsockopt_creds_unix_sock(int sock)
 {
        int ret, on = 1;
@@ -503,6 +515,7 @@ int lttcomm_setsockopt_creds_unix_sock(int sock)
        return ret;
 }
 #elif (defined(__FreeBSD__) || defined(__CYGWIN__))
        return ret;
 }
 #elif (defined(__FreeBSD__) || defined(__CYGWIN__))
+__attribute__((visibility("hidden")))
 int lttcomm_setsockopt_creds_unix_sock(int sock)
 {
        return 0;
 int lttcomm_setsockopt_creds_unix_sock(int sock)
 {
        return 0;
index ec5d426630b9300e925df81fa8d794b2ed282c94..3550af9755d22c5c0449cc2f11c8cb2657a4d6df 100644 (file)
@@ -56,7 +56,7 @@ static const struct uri_proto proto_uri[] = {
  * Return pointer to the character in s matching one of the characters in
  * accept. If nothing is found, return pointer to the end of string (eos).
  */
  * Return pointer to the character in s matching one of the characters in
  * accept. If nothing is found, return pointer to the end of string (eos).
  */
-const inline char *strpbrk_or_eos(const char *s, const char *accept)
+static const inline char *strpbrk_or_eos(const char *s, const char *accept)
 {
        char *p = strpbrk(s, accept);
        if (p == NULL) {
 {
        char *p = strpbrk(s, accept);
        if (p == NULL) {
@@ -140,6 +140,7 @@ error:
 /*
  * Build a string URL from a lttng_uri object.
  */
 /*
  * Build a string URL from a lttng_uri object.
  */
+__attribute__((visibility("hidden")))
 int uri_to_str_url(struct lttng_uri *uri, char *dst, size_t size)
 {
        int ipver, ret;
 int uri_to_str_url(struct lttng_uri *uri, char *dst, size_t size)
 {
        int ipver, ret;
@@ -176,6 +177,7 @@ int uri_to_str_url(struct lttng_uri *uri, char *dst, size_t size)
  *
  * Return 0 if equal else 1.
  */
  *
  * Return 0 if equal else 1.
  */
+__attribute__((visibility("hidden")))
 int uri_compare(struct lttng_uri *uri1, struct lttng_uri *uri2)
 {
        return memcmp(uri1, uri2, sizeof(struct lttng_uri));
 int uri_compare(struct lttng_uri *uri1, struct lttng_uri *uri2)
 {
        return memcmp(uri1, uri2, sizeof(struct lttng_uri));
@@ -184,6 +186,7 @@ int uri_compare(struct lttng_uri *uri1, struct lttng_uri *uri2)
 /*
  * Free URI memory.
  */
 /*
  * Free URI memory.
  */
+__attribute__((visibility("hidden")))
 void uri_free(struct lttng_uri *uri)
 {
        /* Safety check */
 void uri_free(struct lttng_uri *uri)
 {
        /* Safety check */
@@ -195,6 +198,7 @@ void uri_free(struct lttng_uri *uri)
 /*
  * Return an allocated URI.
  */
 /*
  * Return an allocated URI.
  */
+__attribute__((visibility("hidden")))
 struct lttng_uri *uri_create(void)
 {
        struct lttng_uri *uri;
 struct lttng_uri *uri_create(void)
 {
        struct lttng_uri *uri;
@@ -223,6 +227,7 @@ struct lttng_uri *uri_create(void)
  * This code was originally licensed GPLv2 so we acknolwedge the Free Software
  * Foundation here for the work and to make sure we are compliant with it.
  */
  * This code was originally licensed GPLv2 so we acknolwedge the Free Software
  * Foundation here for the work and to make sure we are compliant with it.
  */
+__attribute__((visibility("hidden")))
 ssize_t uri_parse(const char *str_uri, struct lttng_uri **uris)
 {
        int ret, i = 0;
 ssize_t uri_parse(const char *str_uri, struct lttng_uri **uris)
 {
        int ret, i = 0;
index 729aa76f9fd161ddeefbafc19db6374e3da14e54..781888eb351d1ff720b13826706c3cd41812a51c 100644 (file)
@@ -32,6 +32,7 @@
  * /tmp/test1 does, the real path is returned. In normal time, realpath(3)
  * fails if the end point directory does not exist.
  */
  * /tmp/test1 does, the real path is returned. In normal time, realpath(3)
  * fails if the end point directory does not exist.
  */
+__attribute__((visibility("hidden")))
 char *utils_expand_path(const char *path)
 {
        const char *end_path = path;
 char *utils_expand_path(const char *path)
 {
        const char *end_path = path;
@@ -84,6 +85,7 @@ error:
 /*
  * Create a pipe in dst.
  */
 /*
  * Create a pipe in dst.
  */
+__attribute__((visibility("hidden")))
 int utils_create_pipe(int *dst)
 {
        int ret;
 int utils_create_pipe(int *dst)
 {
        int ret;
@@ -106,6 +108,7 @@ int utils_create_pipe(int *dst)
  * Make sure the pipe opened by this function are closed at some point. Use
  * utils_close_pipe().
  */
  * Make sure the pipe opened by this function are closed at some point. Use
  * utils_close_pipe().
  */
+__attribute__((visibility("hidden")))
 int utils_create_pipe_cloexec(int *dst)
 {
        int ret, i;
 int utils_create_pipe_cloexec(int *dst)
 {
        int ret, i;
@@ -134,6 +137,7 @@ error:
 /*
  * Close both read and write side of the pipe.
  */
 /*
  * Close both read and write side of the pipe.
  */
+__attribute__((visibility("hidden")))
 void utils_close_pipe(int *src)
 {
        int i, ret;
 void utils_close_pipe(int *src)
 {
        int i, ret;
@@ -158,6 +162,7 @@ void utils_close_pipe(int *src)
 /*
  * Create a new string using two strings range.
  */
 /*
  * Create a new string using two strings range.
  */
+__attribute__((visibility("hidden")))
 char *utils_strdupdelim(const char *begin, const char *end)
 {
        char *str;
 char *utils_strdupdelim(const char *begin, const char *end)
 {
        char *str;
This page took 0.033532 seconds and 4 git commands to generate.