]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxclock: hide unnecessary symbols
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 20 Jul 2020 15:22:31 +0000 (17:22 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 20 Jul 2020 15:22:31 +0000 (17:22 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/compiler.h
src/lxc/lxclock.h
src/tests/Makefile.am

index 1852f1c0af1d6fb1ba9c6561a503b1cccea1d024..c230e510cea4d25c2082a39608d76f24bb23154b 100644 (file)
@@ -79,4 +79,8 @@
 #define __hidden __attribute__((visibility("hidden")))
 #endif
 
+#ifndef __public
+#define __public __attribute__((visibility("default")))
+#endif
+
 #endif /* __LXC_COMPILER_H */
index 9f9bc3bf6da387ec5adb1694c2683587d99c8b25..38f49b5b4b667418ce1024b296a2809630f82c7a 100644 (file)
@@ -11,6 +11,8 @@
 #include <time.h>
 #include <unistd.h>
 
+#include "compiler.h"
+
 #ifndef F_OFD_GETLK
 #define F_OFD_GETLK    36
 #endif
@@ -71,7 +73,7 @@ struct lxc_lock {
  * freed when the container is freed), and \c u.f.fd = -1.
  *
  */
-extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name);
+__hidden extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name);
 
 /*!
  * \brief Take an existing lock.
@@ -89,7 +91,7 @@ extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name);
  * (except in the test case) I may remove the support for it in sem as
  * well.
  */
-extern int lxclock(struct lxc_lock *lock, int timeout);
+__hidden extern int lxclock(struct lxc_lock *lock, int timeout);
 
 /*!
  * \brief Unlock specified lock previously locked using \ref lxclock().
@@ -99,24 +101,24 @@ extern int lxclock(struct lxc_lock *lock, int timeout);
  * \return \c 0 on success, \c -2 if provided lock was not already held,
  * otherwise \c -1 with \c errno saved from \c fcntl(2) or sem_post function.
  */
-extern int lxcunlock(struct lxc_lock *lock);
+__hidden extern int lxcunlock(struct lxc_lock *lock);
 
 /*!
  * \brief Free a lock created by \ref lxc_newlock().
  *
  * \param lock Lock.
  */
-extern void lxc_putlock(struct lxc_lock *lock);
+__hidden extern void lxc_putlock(struct lxc_lock *lock);
 
 /*!
  * \brief Lock the current process.
  */
-extern void process_lock(void);
+__hidden extern void process_lock(void);
 
 /*!
  * \brief Unlock the current process.
  */
-extern void process_unlock(void);
+__hidden extern void process_unlock(void);
 
 struct lxc_container;
 
@@ -127,14 +129,14 @@ struct lxc_container;
  *
  * \return As for \ref lxclock().
  */
-extern int container_mem_lock(struct lxc_container *c);
+__hidden extern int container_mem_lock(struct lxc_container *c);
 
 /*!
  * \brief Unlock the containers memory.
  *
  * \param c Container.
  */
-extern void container_mem_unlock(struct lxc_container *c);
+__hidden extern void container_mem_unlock(struct lxc_container *c);
 
 /*!
  * \brief Lock the containers disk data.
@@ -144,7 +146,7 @@ extern void container_mem_unlock(struct lxc_container *c);
  * \return \c 0 on success, or an \ref lxclock() error return
  * values on error.
  */
-extern int container_disk_lock(struct lxc_container *c);
+__hidden extern int container_disk_lock(struct lxc_container *c);
 
 /*!
  * \brief Unlock the containers disk data.
@@ -152,6 +154,6 @@ extern int container_disk_lock(struct lxc_container *c);
  * \param c Container.
  *
  */
-extern void container_disk_unlock(struct lxc_container *c);
+__hidden extern void container_disk_unlock(struct lxc_container *c);
 
 #endif
index cf1447b52cd7ef7c9022f944fc0f130b09de2609..8c84c1d2bc7a38f7cb00560c3f9c1c0694ae9957 100644 (file)
@@ -74,7 +74,12 @@ lxc_test_device_add_remove_SOURCES = device_add_remove.c
 lxc_test_getkeys_SOURCES = getkeys.c
 lxc_test_get_item_SOURCES = get_item.c
 lxc_test_list_SOURCES = list.c
-lxc_test_locktests_SOURCES = locktests.c
+lxc_test_locktests_SOURCES = locktests.c \
+                            ../lxc/caps.c ../lxc/caps.h \
+                            ../lxc/file_utils.c ../lxc/file_utils.h \
+                            ../lxc/log.c ../lxc/log.h \
+                            ../lxc/lxclock.c ../lxc/lxclock.h \
+                            ../lxc/string_utils.c ../lxc/string_utils.h
 lxc_test_lxcpath_SOURCES = lxcpath.c
 lxc_test_may_control_SOURCES = may_control.c
 lxc_test_mount_injection_SOURCES = mount_injection.c \